MMD: xslt files in ~/Library/Application Support/Scrivener?

As far as I understand, when extending the MMD export options (using the xslt file metadata item) by adding new xslt files, they now have to be copied into the Scrivener bundle. At least, that is what I have done.

This is bad in many ways. It would be much nicer to have them outside the bundle.

Perhaps the MMD implementation could, in addition to the xslt directory included in the bundle, look for additional xslt files in another place, such as ~/Library/Application Support/Scrivener/MMD/XSLT or something.

This would, e.g., make it possible to upgrade Scrivener without fear of destroying own MMD customizations.

What do you think?

I think this is an excellent idea, although perhaps it should just be ~/Library/Application Support/MultiMarkdown/XSLT, so that it would be compatible with other MMD installations, such as TextMate (in the future, that is. The current version of TM’s MMD does not recognise the XSLT File meta-data).

I’ll leave Fletcher to comment on this.

But remember you can just export as MMD and then use MultiMarkdown manually, outside of Scrivener, rather than relying on what is inside Scrivener. In beta 4, you can include images in MMD files, but this will only work when you export as an MMD file and process it outside of Scrivener, for instance.

Thanks. Having a common directory for XSLTs in all applications is, of course, preferrable.

Now, how long do I have to wait? Or do I have to hack the .pl:s myself? :laughing:

Hmmm… Not sure about all the implications of this.

Possible issues:

MMD is cross-platform, and designed to be used in a bunch of different ways. I am not sure that there is a good single location to put stuff, but that doesn’t make it impossible.

All of the XSLT files have to be in the same folder. It wouldn’t work to have some of them in the Scrivener app (which we do want, so that new users don’t have to install things) and some of them in the Library. They need to be in one place.

Possible ideas - when Scrivener is launched, check to see if the Library/Application Support/Scrivener/MultiMarkdown/XSLT folder exists. If so, leave it alone. If not, create it by copying the default folder out of the Scrivener application.

I think I need some time to mull this one over. Please continue to post feedback and ideas about this concept and I will think out loud here… It could be a good idea, I am just not sure about the mechanics of implementing it.

I’ve started playing with this, and Keith and I are bouncing a few ideas around.

It would be possible to make a Mac OS X installer that would put MMD stuff in the user’s library folder (of course, that is code for I have already done it…) It doesn’t delete files that are user installed. If a user modified existing files, however, they could be overwritten if there was an upgrade.

I’m intrigued with some of the possibilities here, but it’s still being worked on.

Interesting idea…

I’ve created an installer for the next release of MMD. The next beta of Scrivener should support it, and one of my next steps is to get my drag and drop apps to support it.

My newest version of the TextMate bundle uses this as the location for MMD as well.

I think this will work out well for everyone, and simplify keeping all of your MMD tools using the same version.

I hope to have the next version up in the next week or so.

Is the version of MMD that supports user library folder xslt files in scrivener at the moment, or do I have to upgrade the MMD portion?

Also, if I had a custom xslt file that imports one of the built in ones that scrivener comes with, would I have to specify the full path through the application bundle, or would it know to look in its common xslt file locations? (ie, the MMD library location and inside the scrivener bundle)

I forget the precise order, but I believe Scrivener looks for an MMD directory in ~/Application Support/MultiMarkdown, and if it does not find one there, it looks in the system Library; failing that it drops to the built-in version. I’m using a custom MMD installation myself, as I find it much easier to edit the scripts outside of a bundle.

Oh, and you do not need to supply the full path. As long as you put your custom XSLT file in the correct directory of the MMD installation, it will pick it up by filename alone. And that works in same cascading manner described above. User/System/Scrivener built-in.

Clarification: Because Scrivener is actually the one doing the choosing, not MMD. It picks the user installed version first, and since that version is not aware of any other installations outside of it, picks from its own XSLT directory.

Does that mean that in order to use an XSLT file outside the Scrivener bundle, I have to have MMD installed separately? Because I want to use the MMD scripts that come with Scrivener, and just use a custom XSLT file, preferably without sticking it in the application bundle.

[double post - got a 500 error the first time, but it actually did post despite that]

To my knowledge, yes you need the full MMD installation for this method to work. But – that is a simple matter. I’m pretty sure you could just drag a copy out of the Scrivener bundle, into Application Support and that would be all you have to do. The copy of MMD in the Scrivener bundle is stock at this point (it was bleeding edge for a while). They set it up that way so you can manually upgrade that part of Scrivener is you so pleased. Then the idea of having a separate location came up, so that is the preferred way to upgrade MMD now.

Thanks AmberV for answering this one. Yes, Scrivener looks first for the MMD installation in ~/Library/Application Support/MultiMarkdown and then in /Library/Application Support MultiMarkdown, and if neither is present it uses the one inside its own bundle. And yes, you will need a full MMD installation in one of these locations for it to work. I believe Fletcher made an installer that would place everything you need in the correct place, but I don’t know whether it’s on his site or not.

Also, if you have made a custom XSLT file, remember to send it to Fletcher, as he is keen to collect as many that users make as possible so that he can include them with his MMD package. And of course, when he updates MMD, it will end up going into an update of Scrivener, which means that eventually your XSLT would then end up as part of the Scrivener package.