Can MMD compile folder and file name extension differ? Or even the names?

I’m compiling MMD. The output is a folder named whatever you tell it in compile, containing all the images from the Project, plus a markdown file of the same name. If I were to “just” push this to GitHub pages, the address will be something like Exactly like that, in fact, with the .md in the folder name and the .html at the end coming out because GitHub runs Jekyll converting to anything.html.

You’d kind of like to have a different folder name from file name. In this case, maybe v20180615 for the folder and for the file.

Is there a way to explain this to Scrivener, or do I have a little post-processing problem?


Scrivener uses the export filename for the folder name, so that later on, if you select that as your compile target folder again, it will automatically preserve any files already in the folder that are not part of the compile output list (those will all be overwritten), and to avoid cases where one ends up with “” recursion.

Additionally with the Overwrite preserves other existing files checkbox, if you compile repeatedly into the same folder that contains a “” compile folder, the behaviour described above will be used rather than completely regenerating the folder from scratch every time.

You can make use of this automation without having to use “.ext” style folder names as well: rename the compile folder to have the suffix “-mmd” or “_mmd“. In that case, you would compile into this folder directly, so”" could be compiled into the “~/any_name_you_want-mmd/” folder, without a subfolder being created, and without existing files in that folder being overwritten. This is the best approach for maintaining a stable working area in conjunction with automatically generated content from Scrivener.

That’s probably the behaviour you want here, as otherwise your .git files are going to get blown away every time.

I think I don’t understand. Whatever folder name I give for the project, it also gives the contained .md file the exact same name.

If I compile to, I get // folder
    mumble.png // file

And the URL in GitHub is messy, with a .md in it. If I compile to just foo, I get

foo/ // folder
    foo // file, won't be a page because not .md

Best idea I have so far is to compile directly into the git project folder, scriv-gic-pages, carefully not destroying the .git folder etc., and then renaming the scrivener-git-pages file (the actual document bit, actually .md content), either to if I want it to be the actual home page or to if I want the address to be …/scriv-git-pages/something.html.

Am I missing something here? Thanks!

Longer term, of course, I’ll be splitting the file and can name things whatever I want to name them. Short term, while publishing a single file, it’d be nice if the target folder and the target .md file didn’t have to have the same name in an MMD compile.

Try renaming it to “foo_mmd” or “foo-mmd” and then compiling into it with whatever filename you want. You should get:

scriv-git-pages/ foo_mmd/ mumble.png

I don’t understand. I only get to put in one name at the top of the compile. MMD creates a folder of that name, and puts all the images in that folder, plus a file of /exactly/ that name.

If I compile to I get a folder named and a file name inside it. if I compile to scriv-git-pages I get a folder named scriv-git-pages and inside it a file named scriv-git-pages.

Yes, that’s the default behaviour, so long as the folder you’re compiling into doesn’t have the suffix, or doesn’t already have a “.md” folder name.

That would make sense too; that’s no different than the above test, you’re just using a different output name.

Try compiling into a folder called “foo_mmd”, and type whatever you want to into the save field.

Whatever folder you compile an MMD into, if that project includes images, it creates a NEW folder under the folder you’re positioned on. That folder’s name will be the save name in the compile, and inside that folder will appear the images from the document and an md file of that same save name. See the pics below.

I’m guessing there’s no way around this.

Screen Shot 2018-06-15 at 7.34.42 PM.png

From the screenshot it looks like you tried “foo_md”. The code will only recognise “_mmd” or “-mmd” for this particular behaviour.

God save me, that’s true (not that I ever doubted you) and it’s even in the manual!

With the greatest love and respect for you all, that is possibly the least reasonable feature I have ever seen in over a half-century of software development. Surely there’s a way to have a checkbox that does that, or something? Not a magic partial file-name string hidden on page 530 of the manual.

And, while I’m whining, I don’t want to call the folder anything _mmd. :slight_smile:

Today is a good day to write a post-processor, I guess. Well, maybe tomorrow.

I completely agree with the above poster. I do software development too, and this is a really weird patch.

I’m not sure what you mean by calling it a “patch”, but I guess we’ll just have to agree to disagree on that point. Naming convention based results are in my experience quite common and a useful way to extend functioning without a proliferation of user interface.

As noted before, the desired behaviour is furthermore the default behaviour for most outputs: if you compile to MMD→HTML then you get a “sample.html” folder. If you compile into that location again you do not get a nested folder created within it. One really only needs to bother diving into the documentation if they wish to adopt a more advanced workflow, such as the one being described in this thread.