Closed gongzhitaao closed 7 years ago
Hi, thanks for reporting!
I'm going to give a similar answer to #17. This problem also occurs in the standard markdown exporter. Becuase ox-gfm
is derived from that it would be preferable to fix the problem there, killing two birds with one stone.
Could you perhaps report the problem on the Org mailing list?
Sure. I will report this issue when gmane is back online LOL.
Should the title really be handled as a first-level heading? It might be an option exposed to the user.
I'd actually like to see the org metadata to be translated to YAML front-matter per https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents. This wouldn't really be suitable for general markdown, as I believe YAML front-matter is a GFM feature.
Firstly, sorry for overloading this issue, it dosen't relate to ox-gfm too much, but since it's here I thought I would make a few comments.
I'm trying to work on fixing this in ox-md.el
, but I wanted some feedback (as said earlier) on the method of implementing this.
Right now, I'm thinking of just using the html header (since all html is valid markdown) which would bring in both the title and subtitle properties into the md exporter. It looks something like this:
<h1 class="title">TITLE
<br />
<span class="subtitle">SUBTITLE</span>
</h1>
I do agree that there should be an option exposed for the type of export, so that users can use a # TITLE
export if they wish that, but does the above sound like a good option for now? It seems to render fine in the github editor fwiw. I probably would submit two patches, one to establish a basic method (that I decide on) and one later to expose an option and add the other title exports)
I don't like the option of yaml front matter in the md exporter, since the md editor can't depend on gfm features (so it's compatible with all the implementations).
So In summary, the options I see as availble are:
# title
and ## subtitle
Title
====
Let me know what you think!
I lean towards a non-html solution where possible for a nicer looking source. The second option would cause #+TITLE: title
and * title
to export to the same which seems non-ideal. The third option looks nice, but it leaves the #+SUBTITLE subtitle
unaccounted for. This can be solved by letting subtitles be exported to:
subtitle
--------
which is the h2-equivalent of
Title
====
It's worth noting that the underline variants don't render different from # title
and ## subtitle
, but the difference is clear in the markup.
What I do like with the html-variant you propose is that there won't be a thin line between the title and subtitle in the rendered version, but I'm not sure this outweighs the benefit of a nice looking source.
Definetly agree with you about the readability, I hadn't considered that. I'll make the alternate title format the default, assuming the org maintainer is :+1: on it. Thanks for the feedback! :smile:
Glad I could help, and thanks for your contributions!
It actually appears that org-md has a configurable headline style (So you can choose which one to use). I would rather honor that setting, but I do agree with you about how html is less readable, so I'm going to stick with just standard headlines for now (So title won't be different from a H1 level). I'm going to ask for feedback on the org mailing list as well, they probably will have good ideas on how to solve this problem too :).
Seeing as this issue is an ox-md.el
issue, I'll close it.
The outcome on the emacs-orgmode list appears to have leaned toward pushing features like this one out to ox-gfm and ox-hugo: https://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00628.html
Would you be open to adding support to ox-gfm at some point?
The title is not exported.
will be exported to
The expected result should be