From 6db57d574e6fd4d6e3eb907369ea84440902d8eb Mon Sep 17 00:00:00 2001
From: Simon Treanor <4550815+simontreanor@users.noreply.github.com>
Date: Tue, 22 Apr 2025 12:33:09 +0100
Subject: [PATCH 1/5] add ignoreUncategorized build option
---
src/fsdocs-tool/BuildCommand.fs | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/fsdocs-tool/BuildCommand.fs b/src/fsdocs-tool/BuildCommand.fs
index d10d24d1..81a140e8 100644
--- a/src/fsdocs-tool/BuildCommand.fs
+++ b/src/fsdocs-tool/BuildCommand.fs
@@ -687,7 +687,7 @@ type internal DocContent
| _ -> () |]
member _.GetNavigationEntries
- (input, docModels: (string * bool * LiterateDocModel) list, currentPagePath: string option)
+ (input, docModels: (string * bool * LiterateDocModel) list, currentPagePath: string option, ignoreUncategorized: bool)
=
let modelsForList =
[ for thing in docModels do
@@ -704,8 +704,15 @@ type internal DocContent
| Some currentPagePath -> currentPagePath = inputFileFullPath }
| _ -> () ]
+ let excludeUncategorized =
+ if ignoreUncategorized then
+ List.filter (fun (model: LiterateDocModel) -> model.Category.IsSome)
+ else
+ id
+
let modelsByCategory =
modelsForList
+ |> excludeUncategorized
|> List.groupBy (fun (model) -> model.Category)
|> List.sortBy (fun (_, ms) ->
match ms.[0].CategoryIndex with
@@ -1296,6 +1303,9 @@ type CoreBuildOptions(watch) =
[