Skip to content

Commit

Permalink
Limit warnings. README format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mtirionMSFT committed Nov 9, 2023
1 parent 217f56c commit 16e9eb7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
8 changes: 0 additions & 8 deletions src/DocFxTocGenerator/Properties/launchSettings.json

This file was deleted.

20 changes: 10 additions & 10 deletions src/DocFxTocGenerator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ This tool allow to generate a yaml compatible `toc.yml` file for DocFX.
```text
TocGenerator -d <docs folder> [-o <output folder>] [-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 <depth> 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 <depth> 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.
Expand Down
6 changes: 5 additions & 1 deletion src/DocFxTocGenerator/TocGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ private static void GetDirectories(DirectoryInfo folder, List<string> 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;
Expand Down

0 comments on commit 16e9eb7

Please sign in to comment.