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) = [] member val noapidocs = false with get, set + [] + member val ignoreuncategorized = false with get, set + [] member val ignoreprojects = false with get, set @@ -1797,7 +1807,7 @@ type CoreBuildOptions(watch) = let docModels = docContent.Convert(this.input, defaultTemplate, extraInputs) let actualDocModels = docModels |> List.map fst |> List.choose id let extrasForSearchIndex = docContent.GetSearchIndexEntries(actualDocModels) - let navEntriesWithoutActivePage = docContent.GetNavigationEntries(this.input, actualDocModels, None) + let navEntriesWithoutActivePage = docContent.GetNavigationEntries(this.input, actualDocModels, None, ignoreUncategorized = this.ignoreuncategorized) let headTemplateContent = let headTemplatePath = Path.Combine(this.input, "_head.html") @@ -1847,7 +1857,8 @@ type CoreBuildOptions(watch) = docContent.GetNavigationEntries( this.input, actualDocModels, - Some currentPagePath + Some currentPagePath, + ignoreUncategorized = this.ignoreuncategorized ) globals From 8946c0050d720c0bd7e90f6a0ac92750868c57f6 Mon Sep 17 00:00:00 2001 From: Simon Treanor <4550815+simontreanor@users.noreply.github.com> Date: Tue, 22 Apr 2025 14:28:26 +0100 Subject: [PATCH 2/5] fantomas formatting + typo --- src/fsdocs-tool/BuildCommand.fs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/fsdocs-tool/BuildCommand.fs b/src/fsdocs-tool/BuildCommand.fs index 81a140e8..457c0530 100644 --- a/src/fsdocs-tool/BuildCommand.fs +++ b/src/fsdocs-tool/BuildCommand.fs @@ -687,8 +687,12 @@ type internal DocContent | _ -> () |] member _.GetNavigationEntries - (input, docModels: (string * bool * LiterateDocModel) list, currentPagePath: string option, ignoreUncategorized: bool) - = + ( + input, + docModels: (string * bool * LiterateDocModel) list, + currentPagePath: string option, + ignoreUncategorized: bool + ) = let modelsForList = [ for thing in docModels do match thing with @@ -1303,7 +1307,10 @@ type CoreBuildOptions(watch) = [] member val noapidocs = false with get, set - [] + [] member val ignoreuncategorized = false with get, set [] @@ -1807,7 +1814,14 @@ type CoreBuildOptions(watch) = let docModels = docContent.Convert(this.input, defaultTemplate, extraInputs) let actualDocModels = docModels |> List.map fst |> List.choose id let extrasForSearchIndex = docContent.GetSearchIndexEntries(actualDocModels) - let navEntriesWithoutActivePage = docContent.GetNavigationEntries(this.input, actualDocModels, None, ignoreUncategorized = this.ignoreuncategorized) + + let navEntriesWithoutActivePage = + docContent.GetNavigationEntries( + this.input, + actualDocModels, + None, + ignoreUncategorized = this.ignoreuncategorized + ) let headTemplateContent = let headTemplatePath = Path.Combine(this.input, "_head.html") From c027f992db8e9e02cb262e319a891b01ebb8abd2 Mon Sep 17 00:00:00 2001 From: Simon Treanor <4550815+simontreanor@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:38:35 +0100 Subject: [PATCH 3/5] add documentation --- docs/commandline.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/commandline.md b/docs/commandline.md index 3f460cb9..fd9f617b 100644 --- a/docs/commandline.md +++ b/docs/commandline.md @@ -26,6 +26,7 @@ The command line options accepted are: | `--input` | Input directory of content (default: `docs`) | | `--projects` | Project files to build API docs for outputs, defaults to all packable projects | | `--output` | Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch') | +| `--ignoreuncategorized` | Disable generation of the 'Other' category in the navigation bar for uncategorized docs | | `--noapidocs` | Disable generation of API docs | | `--ignoreprojects` | Disable project cracking | | `--eval` | Evaluate F# fragments in scripts | From 86eb81f4138c764d0ab70fdf4dcc30d0e1153994 Mon Sep 17 00:00:00 2001 From: Simon Treanor <4550815+simontreanor@users.noreply.github.com> Date: Tue, 22 Apr 2025 17:48:46 +0100 Subject: [PATCH 4/5] remove nowrap span --- docs/commandline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/commandline.md b/docs/commandline.md index fd9f617b..0abff1ae 100644 --- a/docs/commandline.md +++ b/docs/commandline.md @@ -26,7 +26,7 @@ The command line options accepted are: | `--input` | Input directory of content (default: `docs`) | | `--projects` | Project files to build API docs for outputs, defaults to all packable projects | | `--output` | Output Directory (default 'output' for 'build' and 'tmp/watch' for 'watch') | -| `--ignoreuncategorized` | Disable generation of the 'Other' category in the navigation bar for uncategorized docs | +| `--ignoreuncategorized` | Disable generation of the 'Other' category in the navigation bar for uncategorized docs | | `--noapidocs` | Disable generation of API docs | | `--ignoreprojects` | Disable project cracking | | `--eval` | Evaluate F# fragments in scripts | From ffddde714ada6352d4c1ae293ec7a33672bcc4e8 Mon Sep 17 00:00:00 2001 From: Simon Treanor <4550815+simontreanor@users.noreply.github.com> Date: Wed, 23 Apr 2025 13:35:18 +0100 Subject: [PATCH 5/5] update release notes --- RELEASE_NOTES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4c13f0b8..4e11e755 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,10 @@ # Changelog +## 21.0.0-beta-005 - 2025-04-23 + +### Added +* Add --ignoreuncategorized flag. [#953](https://github.com/fsprojects/FSharp.Formatting/pull/953) + ## 21.0.0-beta-004 - 2024-11-20 ### Changed