Fix indentation for multiline values

- multiline "default values" section: add 2 spaces on the first line
- use `.strip()` to remove unneeded initial spaces from TOML example tab
- adjust the indentation size for TOML and YAML example tabs
- remove trailing spaces

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2025-07-07 18:43:38 -03:00
committed by Adam Warner
parent 31102139ec
commit c076b1bb39

View File

@@ -133,7 +133,7 @@ sudo pihole-FTL --config dns.dnssec=true
documentation.append("**Default value:**")
documentation.append("")
documentation.append("```toml")
documentation.append(f"{value}")
documentation.append(f" {value}")
documentation.append("```")
documentation.append("")
else:
@@ -149,7 +149,7 @@ sudo pihole-FTL --config dns.dnssec=true
documentation.append(f" [{'.'.join(section_stack)}]")
# Indent multi-line values for TOML block
if "\n" in value:
indented_value = "\n".join(" " + v for v in value.splitlines())
indented_value = "\n".join(" " + v for v in value.splitlines()).strip()
documentation.append(f" {key} = {indented_value}")
else:
documentation.append(f" {key} = {value}")
@@ -282,4 +282,3 @@ if __name__ == "__main__":
output_path = sys.argv[2]
write_markdown_doc(input_path, output_path)