Upgrading to fsdocs
Here are the typical steps to upgrade a repo based on ProjectScaffold to use fsdocs
-
Run
dotnet new tool dotnet tool install fsdocs-tool Delete all of
docs\toolsparticularlydocs\tool\generate.fsx. Keep a copy of any templates for reference as you'll have to copy some bits across to the new template.Put your docs directory so it reflects the final shape of the site. For example move the content of
docs\input\*anddocs\files\*directly todocs\*Follow the notes in styling to start to style your site.
-
Run
dotnet fsdocs watchand edit and test your docs.
-
If using FAKE adjust
build.fsxe.g.Target.create "GenerateDocs" (fun _ -> Shell.cleanDir ".fsdocs" DotNet.exec id "fsdocs" "build --clean" |> ignore ) Target.create "ReleaseDocs" (fun _ -> Git.Repository.clone "" projectRepo "temp/gh-pages" Git.Branches.checkoutBranch "temp/gh-pages" "gh-pages" Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A" Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s" let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" release.NugetVersion Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s" Git.Branches.push "temp/gh-pages" ) -
Consider creating
docs\_template.fsxanddocs\_template.ipynbto enable co-generation of F# scripts and F# notebooks.If you add support for notebooks and scripts, consider adding mybinder links to each of your literate executable content pages. For example like this.
Also add load sections to make sure your notebooks and scripts contain the right content to load packages out of repo. For example like this.
Sample commands:
|
Here is an example PR: https://github.com/fsprojects/FSharp.Control.AsyncSeq/pull/116
FSharp.Formatting