FSharp.Formatting
23.0.0-alpha.8
dotnet add package FSharp.Formatting --version 23.0.0-alpha.8
NuGet\Install-Package FSharp.Formatting -Version 23.0.0-alpha.8
<PackageReference Include="FSharp.Formatting" Version="23.0.0-alpha.8" />
<PackageVersion Include="FSharp.Formatting" Version="23.0.0-alpha.8" />
<PackageReference Include="FSharp.Formatting" />
paket add FSharp.Formatting --version 23.0.0-alpha.8
#r "nuget: FSharp.Formatting, 23.0.0-alpha.8"
#:package FSharp.Formatting@23.0.0-alpha.8
#addin nuget:?package=FSharp.Formatting&version=23.0.0-alpha.8&prerelease
#tool nuget:?package=FSharp.Formatting&version=23.0.0-alpha.8&prerelease
fsdocs and FSharp.Formatting

FSharp.Formatting is a set of libraries and tools for processing F# script files and markdown, and for
generating API documentation from XML doc comments. The primary tool is fsdocs.
Full documentation: https://fsprojects.github.io/FSharp.Formatting/
The fsdocs tool
fsdocs builds a static documentation site from the markdown files and F# scripts in your docs
folder, plus API reference pages for the projects in your solution.
dotnet tool install fsdocs-tool
dotnet fsdocs build
dotnet fsdocs watch
initcreates adocsfolder with a defaultindex.md.buildprocesses thedocsfolder and writes the site tooutput.watchbuilds the site, serves it locally and rebuilds on every change.convertconverts individual markdown and script files.
Run dotnet fsdocs <command> --help to see the options of a command, or read the
command line guide.
The libraries
The same functionality is available as NuGet packages for use from your own code:
- FSharp.Formatting bundles the markdown parser, F# code formatter, literate programming support and API doc generator.
- FSharp.Formatting.Literate only contains the literate programming support and its dependencies.
See Markdown parser, F# code formatting and literate programming for examples.
Contributing
See CONTRIBUTING.md for how to build the repository and run the tool locally.
Maintainer(s)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- FSharp.Compiler.Service (= 43.12.401)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on FSharp.Formatting:
| Package | Downloads |
|---|---|
|
FsReveal
FsReveal parses markdown or F# script files and generates reveal.js slides. |
|
|
Yaaf.AdvancedBuilding
Yaaf.AdvancedBuilding is a loose collection of build scripts. The benefit is that you can automatically update your build by updating this package, when you don't need your own crazy build script. But even than it is possible that you could re-use some scripts within this package. |
|
|
FsLab.Runner
This package contains a library for turning FsLab experiments written as script files into HTML and LaTeX reports. The easiest way to use the library is to use the 'FsLab Journal' Visual Studio template. |
|
|
FSharp.Markdown.Pdf
A F# implementation that uses the Markdown parser from FSharp.Formatting and formats the output into PDF using PdfSharp-MigraDoc. |
|
|
Farango
Farango is a client for ArangoDB written in F#. |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on FSharp.Formatting:
| Repository | Stars |
|---|---|
|
commandlineparser/commandline
The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support
|
|
|
dotnet/csharpstandard
Working space for ECMA-TC49-TG2, the C# standard committee.
|
|
|
exercism/v3
The work-in-progress project for developing v3 tracks
|
| Version | Downloads | Last Updated |
|---|---|---|
| 23.0.0-alpha.8 | 35 | 9/18/2026 |
| 23.0.0-alpha.7 | 42 | 9/15/2026 |
| 23.0.0-alpha.6 | 38 | 9/15/2026 |
| 23.0.0-alpha.5 | 40 | 9/15/2026 |
| 23.0.0-alpha.4 | 49 | 9/13/2026 |
| 23.0.0-alpha.3 | 49 | 9/13/2026 |
| 23.0.0-alpha.2 | 62 | 9/10/2026 |
| 23.0.0-alpha.1 | 73 | 9/8/2026 |
| 22.2.0 | 296 | 8/31/2026 |
| 22.1.0 | 1,350 | 5/27/2026 |
| 22.0.1 | 575 | 5/9/2026 |
| 22.0.0 | 1,758 | 4/4/2026 |
| 22.0.0-alpha.3 | 119 | 4/2/2026 |
| 22.0.0-alpha.2 | 100 | 3/13/2026 |
| 22.0.0-alpha.1 | 90 | 3/5/2026 |
| 21.0.0 | 1,857 | 11/12/2025 |
| 21.0.0-beta-005 | 948 | 4/23/2025 |
| 21.0.0-beta-004 | 2,030 | 11/20/2024 |
| 21.0.0-beta-003 | 1,878 | 8/16/2024 |
| 21.0.0-beta-002 | 258 | 6/19/2024 |
### Added
- Tool tips on F# snippets are syntax highlighted. The compiler hands a signature over as runs it has already classified, and `ToolTipReader` was flattening them into one string, so `val printfn: format: Printf.TextWriterFormat<'T> -> 'T` rendered as undifferentiated text. The runs keep their classification now and a tip is colored by the same `--code-*` rules as the snippet it describes, so a keyword, a type, a function and a type parameter look the same whether you read them in the code or in the tip. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- A signature too wide for its tool tip is laid out over several lines instead of wrapping wherever the line runs out. It breaks after the name, after each parameter and before the result, the parameters indented under the name and the result under them, the way a formatter would write it. The compiler's own parser decides where those points are, so the breaks land on syntax rather than a guess, and a line that fits, or that is not a signature, is left as it was. Nearly every line this touched was a member of a type: one with six optional parameters ran to 600 characters. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
### Changed
- A tool tip opens with the doc comment and the signature follows it, where the signature used to come first. The doc text is shown in the color a comment has in a snippet. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- Code snippets are no longer laid out with a table. A snippet is a `<div class="fsdocs-snippet">` holding one `<pre class="fsdocs-snippet-lines">` for the line numbers and one `<pre class="fssnip">` for the code, placed side by side with CSS grid. Markdown code blocks, notebook output and non-F# snippets use the same wrapper, so one selector covers every code block on the page. A stylesheet that targets `table.pre`, `td.lines`, `td.snippet`, or the `.code-block-wrapper` the copy button used to insert, needs updating, and a script that looks for a snippet, such as the Mermaid recipe in the documentation, should look for `.fsdocs-snippet` instead of `table.pre`. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- Line numbers lost the `: ` suffix and sit in a column marked `aria-hidden`, so a screen reader reads the code and not the numbering. The code column scrolls on its own, so the line numbers stay in view while a wide snippet scrolls. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- The default stylesheet ships a new syntax palette built from GitHub's light and dark hues. The previous one had grown a separate hue per token kind, eight of them teal or purple, on top of a dark green default text color in light mode. Tokens are grouped into roles instead: keywords, types, the modules and namespaces that hold them, callables, values, strings, and one mute for comments, fsi output, inactive code and line numbers. Modules take the green GitHub reserves for tags, so `List.map String.trim` reads as container then function rather than one orange run. Identifiers, operators and punctuation read as plain text. Every color is a `--code-*` custom property, so a site can restyle the whole scheme without touching a selector. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- `ToolTipSpan` gained a `Token of kind: TokenKind * body: string` case for a classified run of tool tip text, and `ToolTipReader.stripParameterAttributes` now takes and returns those runs instead of a string. Code that matches on `ToolTipSpan` has to handle the new case. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
### Fixed
- A type abbreviation in a tool tip was colored as an identifier rather than as a type, so `int` and `bool` were orange while `string`, `option`, `list`, `array` and `unit` were plain, in the same position of the same signature. The compiler tags an abbreviation apart from the type it stands for, and the tag was being grouped with parameters and locals. The `System.` qualifier of a fully written name takes the module color instead of plain for the same reason. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- A tool tip lost every line break in the signature it was showing. The compiler does not hand the break over in a tag of its own, it arrives inside a `Text` or `Space` run with the indentation of the next line attached, and only the `Space` case was split on. A tip is flowing text, so the browser collapsed the rest and `type List<'T>` ran its cases, interfaces and members together on one line. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- A doc comment reached the tool tip as the raw XML it was written as, so `<summary>` and `<param>` tags showed up in the tip. The comment is read as XML now and a `<see cref="..."/>` keeps the name it points at, rather than leaving a hole in the sentence it sits in. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- Several syntax token classes had no matching rule in the default stylesheet and were rendered in the plain code color: union cases (`uc`), F# preprocessor directives (`pp`), escaped characters (`esc`), enumeration cases (`en`), mutable bindings (`mv`), and identifiers in every non-F# language (`i`), which is the bulk of a C#, JavaScript, TypeScript or HTML snippet. The stylesheet was matching `u`, `prep`, `e` and `v`, names the formatters stopped emitting. Compiler errors (`cerr`) and omitted code (`omitted`) are styled for the first time. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)
- A code block rendered from an `OtherBlock` opened its wrapper element without ever closing it, leaving unbalanced HTML on the page whenever code snippet wrapping was on. [#1336](https://github.com/fsprojects/FSharp.Formatting/pull/1336)