Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"aspnetcore",
"assertoor",
"autofac",
"autogen",
"auxdata",
"badreq",
"barebone",
Expand Down
13 changes: 8 additions & 5 deletions tools/DocGen/ConfigGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ private static void WriteMarkdown(StreamWriter file, Type configType)

foreach (var prop in props)
{
var itemAttr = prop.GetCustomAttribute<ConfigItemAttribute>();
var configAttr = prop.GetCustomAttribute<ConfigItemAttribute>();

if (itemAttr?.HiddenFromDocs ?? true)
if (configAttr?.HiddenFromDocs ?? true)
continue;

var description = itemAttr.Description.Replace("\n", "\n ").TrimEnd(' ');
var description = configAttr.Description.Replace("\n", "\n ").TrimEnd(' ');
var cliAlias = string.IsNullOrWhiteSpace(configAttr.CliOptionAlias)
? $"{moduleName}-{prop.Name}"
: configAttr.CliOptionAlias;
(string value, string cliValue) = GetValue(prop);

file.Write($$"""
Expand All @@ -110,7 +113,7 @@ private static void WriteMarkdown(StreamWriter file, Type configType)
<Tabs groupId="usage">
<TabItem value="cli" label="CLI">
```
--{{moduleName.ToLowerInvariant()}}-{{prop.Name.ToLowerInvariant()}} {{cliValue}}
--{{cliAlias.ToLowerInvariant()}} {{cliValue}}
--{{moduleName}}.{{prop.Name}} {{cliValue}}
```
</TabItem>
Expand All @@ -135,7 +138,7 @@ private static void WriteMarkdown(StreamWriter file, Type configType)

var startsFromNewLine = WriteAllowedValues(file, prop.PropertyType) || description.EndsWith('\n');

WriteDefaultValue(file, itemAttr, startsFromNewLine);
WriteDefaultValue(file, configAttr, startsFromNewLine);

file.WriteLine();
file.WriteLine();
Expand Down