diff --git a/README.md b/README.md index 6d4652b..95a9f68 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This repository contains a series of tools, templates, tips and tricks to make y * [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 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;