Pandoc, when it parses a document, includes a metadata block. The Title part of the metadata block is of type [Inline], a markup data type specific to Pandoc. I am trying to find a way to convert that to Html so that I can embed that text directly into the Header element of an outgoing Html document.
What function, or combination of functions, is necessary to do this conversion?
[Inline] -> Html
[Str "My", Space, Str "Title"] -> ("My Title" :: Html)
- Inline is a data type for inline markup provided in Pandoc
- Html is the generic Html data type provided by Blaze Html
For the interim, I’m going to hack a function that handles Str and Space, but I know that I’m eventually going to need the way to do it that handles all of the Inline constructors.
There are only a few helper functions that I’ve found that come along Pandoc (Data.Text.Pandoc.Shared and by your example the
stringifyfunction would be all you need (this functions do note that it removes any formatting, which I guess is not important for text that goes into the header element).