From a99ebbf0c9781cfa6b1aabe668d9f56bcd04e987 Mon Sep 17 00:00:00 2001 From: Yazeed Obaid Date: Tue, 25 Oct 2022 15:03:30 +0300 Subject: [PATCH 1/2] Add node_modules directory to ignored list of files and directories. --- docs/content.fsx | 2 +- src/fsdocs-tool/BuildCommand.fs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/content.fsx b/docs/content.fsx index 37e5ff6f0..7730c77ed 100644 --- a/docs/content.fsx +++ b/docs/content.fsx @@ -66,7 +66,7 @@ copy of this content in your `content` directory. ## Ignored Content -Any file or directory beginning with `.` is ignored. +Any file or directory beginning with `.` is ignored. Also `node_modules` directory is ignored. ## Front matter diff --git a/src/fsdocs-tool/BuildCommand.fs b/src/fsdocs-tool/BuildCommand.fs index 2cd1b096b..63ccb469b 100644 --- a/src/fsdocs-tool/BuildCommand.fs +++ b/src/fsdocs-tool/BuildCommand.fs @@ -94,6 +94,10 @@ type internal DocContent |> Array.filter (fun x -> x.Length = 2) |> Array.distinct + let sourceFileOrFolderIsSkipped (input: string) = + input.StartsWith "." || + input = "node_modules" + let makeMarkdownLinkResolver (inputFolderAsGiven, outputFolderRelativeToRoot, fullPathFileMap: Map<(string * OutputKind), string>, outputKind) (markdownReference: string) @@ -155,7 +159,7 @@ type internal DocContent for subInputFolderFullPath in Directory.EnumerateDirectories(inputFolderAsGiven) do let subInputFolderName = Path.GetFileName(subInputFolderFullPath) - let subFolderIsSkipped = subInputFolderName.StartsWith "." + let subFolderIsSkipped = sourceFileOrFolderIsSkipped subInputFolderName let subFolderIsOutput = subFolderIsOutput subInputFolderFullPath if not subFolderIsOutput && not subFolderIsSkipped then @@ -485,7 +489,7 @@ type internal DocContent for subInputFolderFullPath in Directory.EnumerateDirectories(inputFolderAsGiven) do let subInputFolderName = Path.GetFileName(subInputFolderFullPath) - let subFolderIsSkipped = subInputFolderName.StartsWith "." + let subFolderIsSkipped = sourceFileOrFolderIsSkipped subInputFolderName let subFolderIsOutput = subFolderIsOutput subInputFolderFullPath if subFolderIsOutput || subFolderIsSkipped then From 0c090e95f98ab4407b7b844284e9c449e74d617d Mon Sep 17 00:00:00 2001 From: Yazeed Obaid Date: Tue, 25 Oct 2022 16:15:07 +0300 Subject: [PATCH 2/2] run fantomas. --- src/fsdocs-tool/BuildCommand.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fsdocs-tool/BuildCommand.fs b/src/fsdocs-tool/BuildCommand.fs index 63ccb469b..745765c16 100644 --- a/src/fsdocs-tool/BuildCommand.fs +++ b/src/fsdocs-tool/BuildCommand.fs @@ -95,8 +95,7 @@ type internal DocContent |> Array.distinct let sourceFileOrFolderIsSkipped (input: string) = - input.StartsWith "." || - input = "node_modules" + input.StartsWith "." || input = "node_modules" let makeMarkdownLinkResolver (inputFolderAsGiven, outputFolderRelativeToRoot, fullPathFileMap: Map<(string * OutputKind), string>, outputKind)