Skip to content

Conversation

InvincibleRMC
Copy link
Contributor

Description

Download requested files then use literalinclude to have better parity and reduce maintenance. This adds code to support download and updates the python minimal pub/sub example to use it. If this method is approved it can be used for the rest of the examples.

Fixes #5839

Did you use Generative AI?

Additional Information

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Comment on lines +459 to +470
files_to_download = {
"publisher_member_function.py": (
f"https://raw.githubusercontent.com/ros2/examples/{distro}/"
"rclpy/topics/minimal_publisher/examples_rclpy_minimal_publisher/"
"publisher_member_function.py"
),
"subscriber_member_function.py": (
f"https://raw.githubusercontent.com/ros2/examples/{distro}/"
"rclpy/topics/minimal_subscriber/examples_rclpy_minimal_subscriber/"
"subscriber_member_function.py"
),
}
Copy link
Member

@christophebedard christophebedard Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be hard to maintain. Ideally, we would create a custom directive (..) that takes in the URL to be downloaded and only manage the file/URL/etc. from where it is included in the documentation.

@InvincibleRMC InvincibleRMC marked this pull request as draft September 30, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline Code Examples / Tutorials discussion
3 participants