logseq / mldoc

Another Emacs Org-mode and Markdown parser.
GNU Affero General Public License v3.0
236 stars 21 forks source link

Markdown public #47

Closed jjlee closed 3 years ago

jjlee commented 3 years ago

Seems there's a markdown parser in here too, is that intended to be public too? Sorry if this should be obvious, I'm new to OCaml (have written one OCaml program so far!).

I ask because I'd like to try experimenting with defining a subset of org that I could roundtrip through markdown using some sort of tacked-on custom extra annotations (in both the markdown and the org formats) to indicate e.g. when org headings should be markdown bullets and when they should be markdown headings. Thought maybe this might be suitable for that?

tiensonqin commented 3 years ago

yes, the markdown parser is intended to be public too, mldoc adds some org mode features into markdown :)

let config = Mldoc.Conf.{toc = false; heading_number = false; keep_line_break = true; format = Conf.Markdown; heading_to_list = false};;

I ask because I'd like to try experimenting with defining a subset of org that I could roundtrip through markdown using some sort of tacked-on custom extra annotations (in both the markdown and the org formats) to indicate e.g. when org headings should be markdown bullets and when they should be markdown headings.

One way is to use the block properties, logseq adds a heading property to mark a block as a markdown heading.