fletcher / MultiMarkdown-5

Reference implementation of MultiMarkdown; replaces MultiMarkdown v4 (deprecated -- see MMD-6 instead)
https://github.com/fletcher/MultiMarkdown-6
Other
294 stars 46 forks source link

ODF Header - not implemented? #34

Closed KammutierSpule closed 8 years ago

KammutierSpule commented 8 years ago

This feature is documented but as far as I understand is not implemented. Could you implement it?

I was also looking for a possibility to include inside the document text a link to an external file with raw ODF. It could be used for adding things such as first / last page.

fletcher commented 8 years ago

ODF Header metadata is already implemented. The data is inserted after </office:meta>. Doing something useful with that metadata is entirely up to you. ;)

As for external files, see transclusion:

http://fletcher.github.io/MultiMarkdown-5/transclusion.html

Hope that helps.

KammutierSpule commented 8 years ago

I may did some confusion but, from the documentation:

"ODF Header

You can include raw XML to be included in the header of a file output in OpenDocument format. It's up to you to properly format your XML and get it working --- MultiMarkdown just copies it verbatim to the output."

From the source code, I can see it is outputting a hardcoded header: print_odf_header(out); https://github.com/fletcher/MultiMarkdown-5/blob/master/src/odf.c#L25

I was expecting that I could replace all the hardcoded header that you are adding in the fodt with my own file header, so I can apply my own styles instead of using your hardcoded ones.

I experiment it today and it works as your describe, it added a file between /office:meta and office:body I have no knowledge about odf, but you describe it as metadata, isn't that work as whatever raw data it is? but in any case that is not an header for me as it something in the middle of the document (but I may be wrong how it is defined on odt)

So from my original request I was expecting to replace your hardcoded header. I don't know if odt allow us to redefine the styles, but I would prefer that I could add my own RAW header with the already pre-formated data (with my styles).

fletcher commented 8 years ago

Most people aren't going to want to manage the entire header on their own, so it doesn't make sense to strip it all out by default. (Also, you'll notice that none of the other header metadata keys override the entire default either.)

But if you want to do that, the easiest thing is to set the default information in the source code to an empty string, and compile a custom version of MMD. Then you can include the entire header in your own custom file. But that is going to be ugly to manage, and you have to be sure that it doesn't include any blank lines, as that would trigger an end to the metadata section of the document.

KammutierSpule commented 8 years ago

I'm new to this kind of tools. What I was looking was for a way to write uniform documentation for different documents (eg: product documentation). So I found so far the fodt the easiest way to go. My plan was to have a common source with the styles to be global applied, and if I want to change that style (kind of template) I can rebuild all documents again. I am not sure if that is possible on other formats (or other tools), but so far, this MultiMarkdown and fodt was the one that is more close to my needs.

I could reconsider to change the source code and build it myself, but in that case, I would be more happy if I could contribute something to the project .. and in that way, that change would need to be something that you need to approve ;)

fletcher commented 8 years ago

Maybe we should use a different metadata key name, and then I would be willing to merge this into the main project. The functionality you desire is already possible with LaTeX, but not with ODF.