Skip to content

Commit 9b0aa22

Browse files
donaldhkuba-moo
authored andcommitted
tools/net/ynl-gen-rst: Remove extra indentation from generated docs
The output from ynl-gen-rst.py has extra indentation that causes extra <blockquote> elements to be generated in the HTML output. Reduce the indentation so that sphinx doesn't generate unnecessary <blockquote> elements. Reviewed-by: Breno Leitao <leitao@debian.org> Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20231215093720.18774-14-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e9d7c59 commit 9b0aa22

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/net/ynl/ynl-gen-rst.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def rst_paragraph(paragraph: str, level: int = 0) -> str:
6969

7070
def rst_bullet(item: str, level: int = 0) -> str:
7171
"""Return a formatted a bullet"""
72-
return headroom(level) + f" - {item}"
72+
return headroom(level) + f"- {item}"
7373

7474

7575
def rst_subsection(title: str) -> str:
@@ -250,7 +250,7 @@ def parse_attr_sets(entries: List[Dict[str, Any]]) -> str:
250250
for k in attr.keys():
251251
if k in preprocessed + ignored:
252252
continue
253-
lines.append(rst_fields(k, sanitize(attr[k]), 2))
253+
lines.append(rst_fields(k, sanitize(attr[k]), 0))
254254
lines.append("\n")
255255

256256
return "\n".join(lines)
@@ -268,7 +268,7 @@ def parse_sub_messages(entries: List[Dict[str, Any]]) -> str:
268268
lines.append(rst_bullet(bold(value)))
269269
for attr in ['fixed-header', 'attribute-set']:
270270
if attr in fmt:
271-
lines.append(rst_fields(attr, fmt[attr], 2))
271+
lines.append(rst_fields(attr, fmt[attr], 1))
272272
lines.append("\n")
273273

274274
return "\n".join(lines)

0 commit comments

Comments
 (0)