Option to Make Parser Respect Standard Markdown

Hi,

as far as I’ve seen, logseq saves its files with extension .md but the content of the files, even though being human-readable text, does not really respect the markdown conventions in its formatting.

E.g., each start of a “bullet” seems to be indicated by the string "## ", but standard markdown already has a way to indicate these bullets: Interpreting them as paragraphs, a blank line indicates their start. As per John Gruber’s markdown syntax documentation:

A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.

(I.e. a double press of return creates a new block/paragraph)

I’ve seen that the #'s make higher levels of indentation work nicely, but I think maybe using a number of dashes “-” to indicate the indentation level would not deviate as much from other flavors of markdown. (This would also free up #'s to indicate headers that separate bullet points which could be nice to have.)

I get that logseq will likely need its own flavor of markdown but as of right now I don’t really think the files it saves should end in .md, as bullets aren’t even just markdown headers if they contain more than a single line of text.

2 Likes

Hi, ramen!Thanks for your advice!
we’re currently working on the exporting-markdown feature, which exports heading(’##’) as bullet list(’-’) and ignore properties in output. It’ll respect markdown conventions much better. And we’re also considering bullet lists(’-’) as acceptable headings.

Would the markdown only be generated during a manual export or also used for the content of the files?
The latter would be preferable as it means we can work with the same directory from multiple applications without the need to export manually.

@Zhiyuan_Chen Hi, thanks for your reply! The export feature sounds very nice to have! Still, I think that @andrea is right. It would be great to have true markdown for the underlying data, as one would then be able to make use of the vast library of already available markdown parsers and processors (e.g. pandoc for converting markdown to beamer presentations).

Maybe one could modularize the logseq parser? I.e. allow the option to use any token to indicate new bullet points. I’d strongly favor blank lines to indicate new bullet points because for my workflow it is key to interpret bullet points as paragraphs of continuous text. Anyway, I’m very impressed by logseq so far and I’m hopeful for its future!

2 Likes

For now, the underlying data is still the heading(’##’) format with some PROPERTIES syntax(from org-mode). We have plans to have a true markdown for underlying data. so currently, only manual export files are true-markdown(this feature will be released soon)

1 Like

good idea! Customizable parser sounds great, we’ll do some research on this!

Makes sense, in the future it would be nice that the underlying data was in markdown and the properties as comments e.g.

<!--- comment -->

Having the underlying data not reflecting the exported data reduces the benefits of having the data as actual files and it’s instead more similar to an internal database that needs to be manually exported.
Anyway, I’m still excited about this feature and happy that it will be released soon. Great work!

4 Likes

What is the state of this now? Context is in trying to import a few thousand markdown documents and would like to have them mostly as one giant block (not attempt to be interpreted using logseq’s custom markdown format).