Multimarkdown export header id's

Hi, I had a quick search for an answer to this and did find a partial solution through the use of the humane text service (very handy, thanks) but…

Is it possible to output via the multimarkdown --> html export, code without any id’s. At the moment the output includes header id’s named after the header itself, which given some of the long headers I have gets a bit silly :slight_smile: and any way I’d rather choose my own when needed.

By the way I am loving scrivener, and using it to write the content of my website.

cheers

Mark

You could edit the included MultiMarkdown bundle to run regular Markdown, rather than MultiMarkdown, which does not add the id tags, but you would lose a lot of other features.

You can always include manual id tags, using MMD, for any ambiguous cases.

You could create your own XSLT file that strips out all id atttributes from the header tags.

So that’s three ways to get rid of them, but since they don’t hurt anything by being there, and you can override them manually, I will probably not be spending any time myself to change this behavior in the MMD program.

Thanks for the quick response. If I use the Humane text service to convert to html and then back again it strips the id’s. So that is an easy way to deal with it for the moment.

cheers

Mark

I also dislike this particular feature of MMD. I am a compulsivley clean-code person, so disturbs me even if I try to look the other way.

So, thanks for the hints here about how I might suppress these tags. (Hope I can figure 'em out!)

Best,
Greg

P.S. Dear fletcher, my two cents: As it seems to me these long tags are likely to be very little used for reference precisely because most of them are so long and ungainly. So, while, as you say, they don’t hurt anything in there exactly, this might be a reason to reflect on the value of generating them.

The reason they are generated this way is that the user doesn’t have to think about what the id is - one simply references the [Introduction] in order to link straight to the section called “Introduction.”

If you have a suggestion about something easier to figure out for users, I am happy to consider it. Otherwise, if the labels are long and ungainly, keep in mind they came straight from your section titles, which by extension would be long and ungainly?.. :wink: And, as always, you can substitute whatever you like if shorter labels are preferred.

Thanks, fletcher. I understand the impulse to have the function in MMD, but also see it as difficult to get something clean-working out of it–so long as it is wholly auto-generated.

To continue the conversation:

I think, in fact, that ungainly link does not imply ungainly heading.

For example,

is a perfectly good heading, but cobbles into a terrible tag.

Or how about a heading which contains some links in it like this

This is happy and sensible enough as a heading, but really does not compress into a useable tag.

My experience is that almost all my headers are this way, and not one-word beauties like [Introduction]–which, besides being short, has the never-in-reality feature that the tag and the header are the same. If we add to this the fact that most headers are never referred to anyway, I end up feeling this uncontrollable function of MMD is mostly just making chaff in my code.

Don’t get me wrong, I am thankful for MMD and it is making my life better. Just have that nagging feeling about this particular feature.

–Greg

P.S. To demonstrate my abiding affection for MMD, I note here that I have written an outline conversion script that, among other things, transforms MS Word outlines to MMD. This would assist those folks who (think they) want to generate binder structures that reflect their MS outlines–something people periodically show up and wish for in these forums. Plan to post the thing to the forum one day soon.

Just to clarify, you are aware that you can use:

1. The Nature and Uses of MultiMarkdown [Nature]

in order to reference this section as [Nature].

So, I guess I don’t really see what the problem is. If you use short headers, and like being able to reference a section without remembering which shortcut you used — use the built in method. If you want shorter labels, supply your own. Seems like everybody wins.

No, I had not remembered this. This sent me running back to your user’s guide. :oops:

So, I can almost switch the function off with ‘[]’, as in:

Overview []

That’ll do me.

Thanks,
Greg

Kind of, but doing so currently causes invalid XHTML for two reasons:

  1. Having an empty id attribute ([code]

[/code]) is not valid.
  1. For some reason, MMD adds [code]

[/code] tags around the header when an empty [code] [] [/code] is detected.

So - #2 above is a bug that I need to fix, and it would be possible to rework MMD so that it doesn’t add an id attribute that is empty. Which would allow you to more properly turn off the feature without invalidating your XHTML.

Making ‘’ suppress the id tagging altogether would give me control – which I like, of course, – but thinking about the integrity of your MMD system, I wonder if it is really suitably conformal with the way the rest of MMD works.

Here is what I am thinking:

Elsewhere in MMD/MD, ‘’ has a certain kind of role already. So that, if I put something like

The ‘’ specifies that the preceding bracketted text be made into the text of a link.

Somehow it seems to me that the change you are contemplating runs a bit contrary to this, because the empty ‘’ in the header would be untagging something–rather than tagging something (which you get if you put no brackets at all).

[[Aside: The conformal thing would be to make ‘’ in the header switch ON the automatic id tagging, but, of course, this would only make sense if such tagging was switched off by default–a real change from the way you are doing (though I personally think it one with definite virtues!).]]

So, anyway, making the change you generously suggested might make for some disturbance in the consistency feel of the way MMD/MD works. Might be a small thing and it’s your baby, but I thought you might want to reflect on that before making the change you so kindly suggested.

Best,
Greg