fantomas icon indicating copy to clipboard operation
fantomas copied to clipboard

formatting code samples in markdown files (fsharp blocks) and <code> elements in xml comments?

Open smoothdeveloper opened this issue 1 year ago • 1 comments

I propose fantomas goes where code formatters rarely go, for code that is most displayed to large audience: code documentation.

  • F# codeblocks in markdown files
  • code elements (identified as being F#) in xml comments of .net projects
  • maybe F# code samples in sandcastle doc

Pros

  • consistent formatting in F# code shown in documentation

Cons

  • may require third party deps, or work on writing parsers/printers for formats that are alien to fantomas

Extra information

Estimated cost (XS, S, M, L, XL, XXL): M or L

Related suggestions: (put links to related suggestions here)

Affidavit (please submit!)

smoothdeveloper avatar Nov 14 '23 00:11 smoothdeveloper

This seems like something some tool or script could do outside of Fantomas using Fantomas.Core.

Side note, FSharp.Formatting scripts can be formatted because they are just scripts.

nojaf avatar Nov 14 '23 07:11 nojaf