Skip to content

Commit

Permalink
doc: netlink: Fix generated .rst for multi-line docs
Browse files Browse the repository at this point in the history
Fix the newline replacement in ynl-gen-rst.py to put spaces between
concatenated lines. This fixes the broken doc string formatting.

See the dpll docs for an example of broken concatenation:

https://docs.kernel.org/6.9/networking/netlink_spec/dpll.html#lock-status

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20240528140652.9445-2-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Donald Hunter authored and Jakub Kicinski committed May 30, 2024
1 parent 1e37449 commit c697f51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/net/ynl/ynl-gen-rst.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def inline(text: str) -> str:
def sanitize(text: str) -> str:
"""Remove newlines and multiple spaces"""
# This is useful for some fields that are spread across multiple lines
return str(text).replace("\n", "").strip()
return str(text).replace("\n", " ").strip()


def rst_fields(key: str, value: str, level: int = 0) -> str:

0 comments on commit c697f51

Please sign in to comment.