From 16e9eb7773fe36b0b372ab5eced7b1efda3f0970 Mon Sep 17 00:00:00 2001 From: Martin Tirion Date: Thu, 9 Nov 2023 15:12:28 +0100 Subject: [PATCH 1/3] Limit warnings. README format fix --- .../Properties/launchSettings.json | 8 -------- src/DocFxTocGenerator/README.md | 20 +++++++++---------- src/DocFxTocGenerator/TocGenerator.cs | 6 +++++- 3 files changed, 15 insertions(+), 19 deletions(-) delete mode 100644 src/DocFxTocGenerator/Properties/launchSettings.json diff --git a/src/DocFxTocGenerator/Properties/launchSettings.json b/src/DocFxTocGenerator/Properties/launchSettings.json deleted file mode 100644 index cd790cd..0000000 --- a/src/DocFxTocGenerator/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "DocFxTocGenerator": { - "commandName": "Project", - "commandLineArgs": "-d .\\docs -o .\\docs -v -s -i" - } - } -} \ No newline at end of file diff --git a/src/DocFxTocGenerator/README.md b/src/DocFxTocGenerator/README.md index d3a95a8..1a31145 100644 --- a/src/DocFxTocGenerator/README.md +++ b/src/DocFxTocGenerator/README.md @@ -7,16 +7,16 @@ This tool allow to generate a yaml compatible `toc.yml` file for DocFX. ```text TocGenerator -d [-o ] [-vsi] --d, --docfolder Required. Folder containing the documents. --o, --outputfolder Folder to write the resulting toc.yml in. --v, --verbose Show verbose messages. --s, --sequence Use the .order files for TOC sequence. Format are raws of: filename-without-extension --r, --override Use the .override files for TOC file name override. Format are raws of: filename-without-extension;Title you want --i, --index Auto-generate a file index in each folder. --g, --ignore Use the .ignore files for TOC directory ignore. Format are raws of directory names: directory-to-ignore --m, --multitoc Generate multiple toc files for child folders down to a certain child depth, default is 0 (root only generation). ---help Display this help screen. ---version Display version information. +-d, --docfolder Required. Folder containing the documents. +-o, --outputfolder Folder to write the resulting toc.yml in. +-v, --verbose Show verbose messages. +-s, --sequence Use the .order files for TOC sequence. Format are raws of: filename-without-extension +-r, --override Use the .override files for TOC file name override. Format are raws of: filename-without-extension;Title you want +-i, --index Auto-generate a file index in each folder. +-g, --ignore Use the .ignore files for TOC directory ignore. Format are raws of directory names: directory-to-ignore +-m, --multitoc Generate multiple toc files for child folders down to a certain child depth, default is 0 (root only generation). +--help Display this help screen. +--version Display version information. ``` If the `-o or --outputfolder` is not provided, the output folder is set to the docfolder. diff --git a/src/DocFxTocGenerator/TocGenerator.cs b/src/DocFxTocGenerator/TocGenerator.cs index 84e7336..fc56fe6 100644 --- a/src/DocFxTocGenerator/TocGenerator.cs +++ b/src/DocFxTocGenerator/TocGenerator.cs @@ -361,7 +361,11 @@ private static void GetDirectories(DirectoryInfo folder, List order, Toc FileInfo[] subFiles = _filePatternsForToc .SelectMany(pattern => dirInfo.GetFiles(pattern, _caseSetting)) .ToArray(); - if (subFiles.Any() == false) + + // Given warning we will stop in this folder when + // 1) we don't have any markdown or API specs in this folder + // 2) there are subfolders + if (subFiles.Any() == false && Directory.GetDirectories(dirInfo.FullName).Length > 0) { _message.Warning($"WARNING: Folder {dirInfo.FullName} skipped as it doesn't contain {_filePatternsForTocJoined} files. This might skip further sub-folders. Solve this by adding a README.md or INDEX.md in the folder."); continue; From 6556278dacd6d544178142fc7bf2b657818a5240 Mon Sep 17 00:00:00 2001 From: Martin Tirion Date: Thu, 9 Nov 2023 15:17:00 +0100 Subject: [PATCH 2/3] Changed main README to reflect recent changed tools --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6d4652b..8432e99 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ This repository contains a series of tools, templates, tips and tricks to make y ## Tools -* [DocFxTocGenerator](./src/DocFxTocGenerator): generate a Table of Contents (TOC) in YAML format for DocFX. It has features like the ability to configure the order of files and the names of documents and folders. -* [DocLinkChecker](./src/DocLinkChecker): validate links in documents and check for orphaned attachments in the `.attachments` folder. The tool indicates whether there are errors or warnings, so it can be used in a CI pipeline. It can also clean up orphaned attachments automatically. And it can validate table syntax. +* 🆕[DocFxTocGenerator](./src/DocFxTocGenerator): generate a Table of Contents (TOC) in YAML format for DocFX. It has features like the ability to configure the order of files and the names of documents and folders. +* 🆕[DocLinkChecker](./src/DocLinkChecker): validate links in documents and check for orphaned attachments in the `.attachments` folder. The tool indicates whether there are errors or warnings, so it can be used in a CI pipeline. It can also clean up orphaned attachments automatically. And it can validate table syntax. * [DocLanguageTranslator](./src/DocLanguageTranslator): allows to generate and translate automatically missing files or identify missing files in multi language pattern directories. -* 🆕 [DocFxOpenApi](./src/DocFxOpenApi): converts existing [OpenAPI](https://www.openapis.org/) specification files into the format compatible with DocFX (OpenAPI v2 JSON files). It allows DocFX to generate HTML pages from the OpenAPI specification. OpenAPI is also known as [Swagger](https://swagger.io/). +* [DocFxOpenApi](./src/DocFxOpenApi): converts existing [OpenAPI](https://www.openapis.org/) specification files into the format compatible with DocFX (OpenAPI v2 JSON files). It allows DocFX to generate HTML pages from the OpenAPI specification. OpenAPI is also known as [Swagger](https://swagger.io/). ## Creating PR's From b5cd027bd67510f832aa1d99ff481b80f155b954 Mon Sep 17 00:00:00 2001 From: Martin Tirion Date: Thu, 9 Nov 2023 15:17:43 +0100 Subject: [PATCH 3/3] Removed new tags - confusing --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8432e99..95a9f68 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ This repository contains a series of tools, templates, tips and tricks to make y ## Tools -* 🆕[DocFxTocGenerator](./src/DocFxTocGenerator): generate a Table of Contents (TOC) in YAML format for DocFX. It has features like the ability to configure the order of files and the names of documents and folders. -* 🆕[DocLinkChecker](./src/DocLinkChecker): validate links in documents and check for orphaned attachments in the `.attachments` folder. The tool indicates whether there are errors or warnings, so it can be used in a CI pipeline. It can also clean up orphaned attachments automatically. And it can validate table syntax. +* [DocFxTocGenerator](./src/DocFxTocGenerator): generate a Table of Contents (TOC) in YAML format for DocFX. It has features like the ability to configure the order of files and the names of documents and folders. +* [DocLinkChecker](./src/DocLinkChecker): validate links in documents and check for orphaned attachments in the `.attachments` folder. The tool indicates whether there are errors or warnings, so it can be used in a CI pipeline. It can also clean up orphaned attachments automatically. And it can validate table syntax. * [DocLanguageTranslator](./src/DocLanguageTranslator): allows to generate and translate automatically missing files or identify missing files in multi language pattern directories. * [DocFxOpenApi](./src/DocFxOpenApi): converts existing [OpenAPI](https://www.openapis.org/) specification files into the format compatible with DocFX (OpenAPI v2 JSON files). It allows DocFX to generate HTML pages from the OpenAPI specification. OpenAPI is also known as [Swagger](https://swagger.io/).