Export Markdown.parse?

I’ve just discovered Markdown.parse, which allows to convert strings to Julia’s MarkDown type. I think this is a very useful functionality. Wouldn’t it make sense to export it or at least make it public?

EDIT: Well, exporting it would lead to conflicts with Base.parse. But documenting it and making it public still sounds like a good idea to me.

4 Likes

Replace Markdown stdlib with CommonMark.jl · Issue #37337 · JuliaLang/julia

So I would recommend using CommonMark.jl.

1 Like

Yes, this makes a lot of sense — it doesn’t make sense to expose md"...." (compile-time parsing) but not Markdown.parse("....") (runtime parsing). I’m guessing PR would probably be welcome. Just edit the file here.

1 Like

Markdown.parse has several methods, some of which appear to be internal. For public use could be parse(markdown::AbstractString) and parse(stream::IO). Both methods have a keyword argument flavor, which can be Markdown.julia (default), Markdown.common or Markdown.github. If we document the flavor keyword argument, then the three flavors also need to be documented and made public. Shall I do this, too?

Probably? Can be discussed on the PR.

A post was split to a new topic: Hiding internal methods from methods(f)?

I’ve created a PR:

1 Like