FSharp.Formatting
FSharp.Formatting copied to clipboard
#if HTML does not work.
I was trying to add content to HTML output that I do not want in IPYNB and FSX output. #if HTML is not working. See example below. I might be able to fix this with a pull request, but for now I am posting references to the code that probably needs changing.
The problem seems to be that
#ifis handled in this function https://github.com/fsprojects/FSharp.Formatting/blob/49ee266b0d5c2cb3baa468add69b4439a39dea6f/src/FSharp.Formatting.Markdown/MarkdownUtils.fs#L155- This function is then used to generate ipynb and fsx output in their respective
formatParagraphssuch as here https://github.com/fsprojects/FSharp.Formatting/blob/49ee266b0d5c2cb3baa468add69b4439a39dea6f/src/FSharp.Formatting.Markdown/FsxFormatting.fs#L20 - However, the HTML and Latex formatters do not use this function in their
formatParagraphs.
Example illustrating failure:
#if HTML
printfn "Hello world"
#endif // HTML
(*** include-fsi-output ***)

This one is annoyingly hard to fix because code sections are formatted to HTML earlier than for other outputs, I'm not sure why