You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to parse some Markdown, convert it to HTML, embed that in some other HTML and render it all to an HTML string.
Something like this:
// Not real codeletmarkdown= Markdown.Parse(content)letmarkdownHtml= Markdown.toHtmlElement markdown
letpage=
html
[][
div [][ str "This is my header"]
markdownHtml
div [][ str "This is my footer"]]
printfn "%s"(Html.toString html)
From the docs, I can see that FSharp.Formatting supports the markdown parsing bit, and can convert to an HTML string, but does it allow one to work with the HTML AST?
No, not the HTML model. But you can use FSharp.Formatting's internal representation, the literate document type. Once you have the literate document you can manipulate it as you see fit (as you could with an HTML AST).
F# has other purpose-built HTML libraries and my recollection from old issues about it is that dsyme wanted this library to have an HTML model that a) didn't depend on anybody else and b) didn't have anybody else depending on it. That's why it's internal.
I would like to parse some Markdown, convert it to HTML, embed that in some other HTML and render it all to an HTML string.
Something like this:
From the docs, I can see that
FSharp.Formatting
supports the markdown parsing bit, and can convert to an HTML string, but does it allow one to work with the HTML AST?The HTML model appears to be
internal
.The text was updated successfully, but these errors were encountered: