@@ -687,8 +687,12 @@ type internal DocContent
687687 | _ -> () |]
688688
689689 member _.GetNavigationEntries
690- ( input , docModels : ( string * bool * LiterateDocModel ) list , currentPagePath : string option )
691- =
690+ (
691+ input ,
692+ docModels : ( string * bool * LiterateDocModel ) list ,
693+ currentPagePath : string option ,
694+ ignoreUncategorized : bool
695+ ) =
692696 let modelsForList =
693697 [ for thing in docModels do
694698 match thing with
@@ -704,8 +708,15 @@ type internal DocContent
704708 | Some currentPagePath -> currentPagePath = inputFileFullPath }
705709 | _ -> () ]
706710
711+ let excludeUncategorized =
712+ if ignoreUncategorized then
713+ List.filter ( fun ( model : LiterateDocModel ) -> model.Category.IsSome)
714+ else
715+ id
716+
707717 let modelsByCategory =
708718 modelsForList
719+ |> excludeUncategorized
709720 |> List.groupBy ( fun ( model ) -> model.Category)
710721 |> List.sortBy ( fun ( _ , ms ) ->
711722 match ms.[ 0 ]. CategoryIndex with
@@ -1296,6 +1307,12 @@ type CoreBuildOptions(watch) =
12961307 [<Option( " noapidocs" , Default = false , Required = false , HelpText = " Disable generation of API docs." ) >]
12971308 member val noapidocs = false with get, set
12981309
1310+ [<Option( " ignoreuncategorized" ,
1311+ Default = false ,
1312+ Required = false ,
1313+ HelpText = " Disable generation of 'Other' category for uncategorized docs." ) >]
1314+ member val ignoreuncategorized = false with get, set
1315+
12991316 [<Option( " ignoreprojects" , Default = false , Required = false , HelpText = " Disable project cracking." ) >]
13001317 member val ignoreprojects = false with get, set
13011318
@@ -1797,7 +1814,14 @@ type CoreBuildOptions(watch) =
17971814 let docModels = docContent.Convert( this.input, defaultTemplate, extraInputs)
17981815 let actualDocModels = docModels |> List.map fst |> List.choose id
17991816 let extrasForSearchIndex = docContent.GetSearchIndexEntries( actualDocModels)
1800- let navEntriesWithoutActivePage = docContent.GetNavigationEntries( this.input, actualDocModels, None)
1817+
1818+ let navEntriesWithoutActivePage =
1819+ docContent.GetNavigationEntries(
1820+ this.input,
1821+ actualDocModels,
1822+ None,
1823+ ignoreUncategorized = this.ignoreuncategorized
1824+ )
18011825
18021826 let headTemplateContent =
18031827 let headTemplatePath = Path.Combine( this.input, " _head.html" )
@@ -1847,7 +1871,8 @@ type CoreBuildOptions(watch) =
18471871 docContent.GetNavigationEntries(
18481872 this.input,
18491873 actualDocModels,
1850- Some currentPagePath
1874+ Some currentPagePath,
1875+ ignoreUncategorized = this.ignoreuncategorized
18511876 )
18521877
18531878 globals
0 commit comments