Skip to content

Commit acb54dd

Browse files
committed
Adds RST labels to important messages
Adds RST labels to important messages in the generated protobuf documentation. This allows for cross-referencing these messages within the documentation, improving navigation and linking between different parts of the API reference.
1 parent d216970 commit acb54dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/source/generate_protobuf_docs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,13 @@ def _format_message(self, msg: ProtoMessage, file_key: str, is_important: bool)
404404
"""Format a message as RST."""
405405
# Use proper RST heading levels
406406
# Level 3 (~~~) for important messages, Level 4 (""") for others in Complete Reference
407+
content = ""
408+
409+
# Add RST label for important messages to enable cross-references
407410
if is_important:
408-
content = f"\n{msg.name}\n"
411+
# Create lowercase label for referencing (e.g., SimulatorTableData -> simulatortabledata)
412+
label = msg.name.lower()
413+
content = f"\n.. _{label}:\n\n{msg.name}\n"
409414
content += "~" * len(msg.name) + "\n\n"
410415
else:
411416
content = f"\n{msg.name}\n"

0 commit comments

Comments
 (0)