emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Elegant way to export org to Markdown ?


From: Tim Cross
Subject: Re: Elegant way to export org to Markdown ?
Date: Sat, 02 Oct 2021 17:44:06 +1000
User-agent: mu4e 1.7.0; emacs 28.0.60

Jean-Christophe Helary <lists@traduction-libre.org> writes:

> I'm trying to work with SourceHut (sr.ht) and right now they only accept 
> Markdown syntax for their readme/wiki files.
>
> Since I work in Emacs/org-mode to write my documents (and try to stick to 
> that),
> I'd like to know if there is an elegant way to export org syntax to MarkDown.
>
> I was thinking that the export-dispatch had an option for Plain Text / 
> Markdown, but that doesn't seem to be the case.
>
> As a workaround, I thought I'd work on a README.org file that I export to 
> HTML,
> change the name to .md and edit the contents to reduce the markup to the 
> strict
> minimum... But when I saw the contents of the HTML, I thought that would be 
> way
> too much work.
>
> *BUT* MarkDown bien basically HTML *without* the head/body tags, it seems to 
> me
> that the HTML export-dispatch thing could have a "super simplified MD
> compatible" HTML option...
>
> Either way, I need a method to export to something that sr.ht will recognize 
> and process as MD so:
>
> 1) is there an external "approved" process to convert org-mode syntaxt to an 
> MD-compatible format ?
> 2) if no, what is the not too hard way to hack the HTML output to produce 
> what I need with export-dispatch ?
>

Org does have an exporter for markdown. You need to enable it (see the
manual).

Note that 'markdown' is a somewhat generic term - there is no 'standard'
for markdown. This means that the markdown generated by org may not be
the same syntax as the markdown supported by sourceHut. A similar issue
exists with github and as a result, there is also an external package
which can add github flavoured markdown to org.

If sourceHut markdown is not the same as org's markdown or the github
flavored markdown, it may be necessary to write a sourceHut flavored
markdown exporter (probably fairly easy to do using the existing ox-md
as a starting point). 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]