I write my blog posts in Scrivener and then copy them to my WordPress blog. I had to do a lot of reformatting and deletion with various export options. Now I’ve discovered writing the posts using MMD and exporting to html. It’s almost perfect. There are three things I’d like to change.
The compiler adds an id to each header (e.g., h1, h2) that is the title itself. I could leave these as they most likely won’t interfere with my CSS, but I may run into a match one day. Is there was way to turn the generation off?
Full page formatting is also generated (i.e., html, head, /head, body, /body, /html). It’s easy to delete this from the output, but it wound be nice to not have to. When I did paste special prior to using MMD, I did get rid of the extra formatting. Can this be turned off?
Can compiler output be written to the clipboard? Again, it’s not much effort open the output file and copy and paste from it, but it would be easier to just paste from the clipboard.
For the first two, would altering the XSLT do the trick? I saw mention of it in the manual, but haven’t looked into it yet.
You can supply a custom ID to a title by adding the ID you wish in square brackets after the title. So:
## The Reader Sees This [htmlSeesThis] ##
Generates:
<h2 id="htmlseesthis">The Reader Sees This</h2>
So that is handy to know if you use titles that are identically worded, or if you are concerned about the titles clashing with CSS selectors.
Whether MMD produces a complete document, or only a “snippet” of formatted text that can be easily pasted into a boilerplate or publishing system is determined by whether or not the document has principle meta-data defined for it. For instance, if something as a Title, then it is presumed to be worthy of a title—hence, a full document. If the piece does not have a title or author designated, then it just formats the text.
No, it is designed to write files. If you are familiar with AppleScript and folder actions, however, this shouldn’t be too much of a problem to program your system to do for you.
[quote]
For the first two, would altering the XSLT do the trick? I saw mention of it in the manual, but haven’t looked into it yet.
[quote]
Well, you could, but that may be overkill unless you are quite proficient in XSL and can throw together a transform script quickly. This would be better to learn if you wish to generate entirely new outputs, like wiki syntax, or wished to fundamentally alter the vanilla output—maybe you want code to actually use a custom verse DIV, for instance, or need to use a particular class for your H1—then post-processing the XML would be useful.
I couldn’t delete the meta data as it contained the defaults. When I replaced each with a space, the compiler generated this output:
<p>Title:<br/>
Author:<br/>
Base Header Level: 1</p>
It’s slightly easier to clean up. Anyway to have it not generate anything?
I also tried entering a null id override (i.e., []). It didn’t work. Putting something in the square brackets worked as you described.
Once converted, I always work in the html view and like to see it clean. If I did want to modify a header, I would do it with a class so I’ll look into the altering the XSLT. I’ve learned over 20 computer languages. What’s one more.
Are you saying the - button doesn’t work? I can’t reproduce that. If I select a meta-data row and click the - button to delete it, it successfully deletes. Let me know if that is what you are seeing. Setting your title to a space isn’t going to work, all document level meta-data keys have to be removed for it to work in snippet mode. You can use “Base Header Level” since that is a setting not a document info key and you might want to start with H2 depending on your site.
Those are more for anchor positions than CSS. It’s considered good practice to label your page’s structural elements so that people can link into the page in a contextually relevant fashion, rather than always having links land at the top of the page. It also aids your own internal cross-referencing. I would imagine this is why there is no option to turn them off—not to mention it would break MMD’s internal cross-referencing system.
But if you very specifically do not want people to contextually link into your page for some reason, I suppose removing these would be a way of achieving that.
The ‘-’ button merely puts a ‘-’ in the field. I’m doing this in the Meta-Data Settings Project Property tab. If I delete everything from the field it returns to the a gray default value. Do I need to get rid of my defaults?
Good point on the id’s. I had forgotten about that aspect. I use them a lot for that purpose on another website I built.
Sorry I wasn’t clear, when I said ‘button’ I meant the user interface button on the screen, not the ‘-’ key on your keyboard. If you select the “Title” row in the meta-data table and then click the ‘-’ button at the bottom of the pane, it should remove the key entirely from the list. Do that for both Title and Author.
Got it on the interface button. I’m not seeing any such button where I’m looking. The dialog I’m using is in figure 10.1 in the user manual. I got to it by selecting Project/Meta Data Settings … and then clicking the Project Properties tab. I’m running Scrivener 2.31 on OS X 10.8.1.
Oh! We’re talking about two different things then. I wondered what you meant by greyed out text. Okay that’s the wrong place to be changing MMD meta-data. It is true that the default MMD title and author can be set from this location, because a new project will use <$title> and <$author> in the meta-data fields, which are pulled from this spot. But these only set the fallback values—not whether or not the key is present. If they are emptied out, then the system will use the project file name, and your Mac’s address book entry for the author. Where you need to be is in the Compile option pane that is labelled meta-data. You should find a list of MMD meta-data keys in a table at the top, and an editing area below where you can type in the value. It is those you want to completely remove. Sorry for the confusion!
And I looked through all the compile options and managed to miss it! I made the change and I’m down to the bare bones html I need. Thanks for the help.