Skip to content

Commit

Permalink
Move multiple filtering of EntityInfos to definition of EntityInfos
Browse files Browse the repository at this point in the history
Remove unnecessary comments as discussed in PR review
  • Loading branch information
davedawkins committed Jan 11, 2023
1 parent 5ea89b7 commit f6caad4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/FSharp.Formatting.ApiDocs/GenerateHtml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ type HtmlRender(model: ApiDocModel, ?menuTemplateFolder: string) =
printfn " Generating %s" outFile
SimpleTemplating.UseFileAsSimpleTemplate(substitutions, templateOpt, outFile)

for info in model.EntityInfos |> List.filter (fun info -> not info.Entity.Exclude) do
for info in model.EntityInfos do
let content = div [] (entityContent info)

let pageTitle = sprintf "%s (%s)" info.Entity.Name collectionName
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Formatting.ApiDocs/GenerateMarkdown.fs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ type MarkdownRender(model: ApiDocModel, ?menuTemplateFolder: string) =
printfn " Generating %s" outFile
SimpleTemplating.UseFileAsSimpleTemplate(substitutions, templateOpt, outFile)

for info in model.EntityInfos |> List.filter (fun info -> not info.Entity.Exclude) do
for info in model.EntityInfos do
let content = MarkdownDocument(entityContent info, Map.empty)

let pageTitle = sprintf "%s (%s)" info.Entity.Name collectionName
Expand Down
11 changes: 1 addition & 10 deletions src/FSharp.Formatting.ApiDocs/GenerateModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2272,19 +2272,10 @@ module internal SymbolReader =
// 2.
// /// <exclude/>
//
// So, we need to let the 'null' case handle this to extract the <exclude> if it's there
//
// | null when String.IsNullOrEmpty el.Value ->
// cmds, ApiDocComment.Empty, None

| null ->
// We let through XML comments without a summary tag. It's not clear
// why as all XML coming through here should be from F# .XML files
// and should have the tag. It may be legacy of previously processing un-processed
// XML in raw F# source.
//
// 9-Jan-23: See comment above for at least one reason why we pass through here now

let doc, nsels = readXmlCommentAsHtmlAux false ctx.UrlMap el cmds

let nsdocs = readNamespaceDocs ctx.UrlMap nsels
Expand Down Expand Up @@ -2865,7 +2856,7 @@ type ApiDocModel internal (substitutions, collection, entityInfos, root, qualify
member _.Collection: ApiDocCollection = collection

/// The full list of all entities
member _.EntityInfos: ApiDocEntityInfo list = entityInfos
member _.EntityInfos: ApiDocEntityInfo list = entityInfos |> List.filter (fun info -> not info.Entity.Exclude)

/// The root URL for the entire generation, normally '/'
member _.Root: string = root
Expand Down

0 comments on commit f6caad4

Please sign in to comment.