Commit cb7351ac authored by Donald Hunter's avatar Donald Hunter Committed by Jakub Kicinski

doc: netlink: Fix formatting of op flags in generated .rst

Generate op flags as an inline list instead of a stringified python
value.
Signed-off-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20240528140652.9445-4-donald.hunter@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ebf90041
...@@ -172,7 +172,7 @@ def parse_do_attributes(attrs: Dict[str, Any], level: int = 0) -> str: ...@@ -172,7 +172,7 @@ def parse_do_attributes(attrs: Dict[str, Any], level: int = 0) -> str:
def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str: def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str:
"""Parse operations block""" """Parse operations block"""
preprocessed = ["name", "doc", "title", "do", "dump"] preprocessed = ["name", "doc", "title", "do", "dump", "flags"]
linkable = ["fixed-header", "attribute-set"] linkable = ["fixed-header", "attribute-set"]
lines = [] lines = []
...@@ -188,6 +188,8 @@ def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str: ...@@ -188,6 +188,8 @@ def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str:
if key in linkable: if key in linkable:
value = rst_ref(namespace, key, value) value = rst_ref(namespace, key, value)
lines.append(rst_fields(key, value, 0)) lines.append(rst_fields(key, value, 0))
if 'flags' in operation:
lines.append(rst_fields('flags', rst_list_inline(operation['flags'])))
if "do" in operation: if "do" in operation:
lines.append(rst_paragraph(":do:", 0)) lines.append(rst_paragraph(":do:", 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment