Skip to content

Commit

Permalink
docs: split msgs as un/versioned
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeLaine authored and bkueng committed Dec 13, 2024
1 parent 4d62522 commit 2e16637
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
30 changes: 24 additions & 6 deletions Tools/msg/generate_msg_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def get_msgs_list(msgdir):
msg_files = get_msgs_list(msg_path)
msg_files.sort()

filelist_in_markdown=''
versioned_msgs_list = ''
unversioned_msgs_list = ''

for msg_file in msg_files:
msg_name = os.path.splitext(os.path.basename(msg_file))[0]
Expand Down Expand Up @@ -94,10 +95,17 @@ def get_msgs_list(msgdir):
with open(output_file, 'w') as content_file:
content_file.write(markdown_output)

index_markdown_file_link='- [%s](%s.md)' % (msg_name,msg_name)
if summary_description:
index_markdown_file_link+=" — %s" % summary_description
filelist_in_markdown+=index_markdown_file_link+"\n"
# Categorize as versioned or unversioned
if "versioned" in msg_file:
versioned_msgs_list += '- [%s](%s.md)' % (msg_name, msg_name)
if summary_description:
versioned_msgs_list += " — %s" % summary_description
versioned_msgs_list += "\n"
else:
unversioned_msgs_list += '- [%s](%s.md)' % (msg_name, msg_name)
if summary_description:
unversioned_msgs_list += " — %s" % summary_description
unversioned_msgs_list += "\n"

# Write out the index.md file
index_text="""# uORB Message Reference
Expand All @@ -107,10 +115,20 @@ def get_msgs_list(msgdir):
:::
This topic lists the UORB messages available in PX4 (some of which may be may be shared by the [PX4-ROS 2 Bridge](../ros/ros2_comm.md)).
[Versioned messages](../middleware/uorb.md#message-versioning) track changes to their definitions, with each modification resulting in a version increment.
These messages are most likely shared through the PX4-ROS 2 Bridge.
Graphs showing how these are used [can be found here](../middleware/uorb_graph.md).
## Versioned Messages
%s
## Unversioned Messages
%s
""" % (filelist_in_markdown)
""" % (versioned_msgs_list, unversioned_msgs_list)
index_file = os.path.join(output_dir, 'index.md')
with open(index_file, 'w') as content_file:
content_file.write(index_text)
1 change: 0 additions & 1 deletion msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ set(msg_files
CanInterfaceStatus.msg
CellularStatus.msg
CollisionConstraints.msg
CollisionReport.msg
ControlAllocatorStatus.msg
Cpuload.msg
DatamanRequest.msg
Expand Down

0 comments on commit 2e16637

Please sign in to comment.