The fslab documentation template
This template scaffolds the necessary folder structure for documentation with FSharp.Formatting and it's fsdocs
tool,
and adds custom styles in the fslab theme.
Table of contents
Installation
This template is available as a dotnet new template (from nuget):
|
Usage
If not already present, create a local tool manifest in the root of your project that you want to write documentation for:
|
Then, still in the root of your project, run:
|
Quick content rundown:
The default template initializes the following folder structure when you initialize it in the root of your project.
See further below for command line customization options of the template.
|
-
index.fsx
is the file you are reading just now. It contains the very content you are reading at the moment in a markdown block indicated by(** *)
guards. It will be rendered as the rootindex.html
file of your documentation. _template.html
is the root html scaffold (sidebar to the left, script and style loading) where all of the individual docs will be injected into0_Markdown-Cheatsheet.md
is a adaption of this markdown cheat sheet that shows how to write markdown and showcases the rendered equivalents. It can also be viewed in all its glory here.1_fsharp-code-example.fsx
is a script file that showcases the syntax highlighting style for F# snippets. It can also be viewed in all its glory here.2_inline-references.fsx
is a script file that explains how to use inline references and use Plotly.NET for charting. It can also be viewed in all its glory here.3_notebooks.fsx
is a script file that showcases conditional content in documentation and how to use that to create dotnet interactive notebooks besides your html documentation. It can also be viewed in all its glory here.-
fsdocs-custom.css
contains the custom styling that applies the fslab styles.the
img
folder contains the fslab logo and favicon. replace these files (with the same names) to youse soursreference/_template.html
is a slightly adapted version of the template above for the API documentation
Creating new content
run
dotnet fsdocs watch --eval
to spawn a watcher and dev server that hosts your docs on http://localhost:8901/ (You currently will still have to refresh the page when you make changes to files)add a new .md or .fsx file to the
content
directory (or into a new subdirectory there)- the sidebar title for the document will be either the file name or, if existent, the first level 1 header in the file
- when writing a .fsx file, code will automatically become syntax-highlighted code snippets.
use
(** <markdown here> *)
to guard markdown sections in .fsx filesuse
(*** include-value:<val name> ***)
to include the value of a bindinguse
(*** include-it ***)
to include the evaluation of the previous snippet block
For more info please refer to the FSharp.Formatting documentation.
Customization options
Style sheet options
|
Inclusion of sample content
|
Create notebooks
|