Repository navigation
3di | Related articles (backport #7239) - #7312
Merged
Merged
Conversation
* Add related articles solution * Update to align with most recent requirements * Add readme * Promote Related articles intro to a heading * Fix contentType meta matching and refresh related articles docs * Register ros_related_articles in the extensions list --------- Signed-off-by: Tully Foote <tullyfoote@intrinsic.ai> Co-authored-by: Tully Foote <tullyfoote@intrinsic.ai> (cherry picked from commit d685add)
Merged
ahcorde
approved these changes
Oct 16, 2026
|
HTML artifacts: https://github.com/ros2/ros2_documentation/actions/runs/38870231427/artifacts/12032888199. To view the resulting site:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a Sphinx extension with a
.. ros-related-articles::directive that, at build time, replaces itself with links to other pages in the set, matched onareafrom.. meta::(from the Enhance metadata work #6981).Matching
areavalue. Another page is related when that value appears anywhere in itsarealist, sonodes, frameworkdoes not pull in every page that only sharesframework.areais required on the page with the directive. Missing or empty fails the build. Pages withoutareaare never listed.:contentType:and:content-type:are the same).Ordering and layouts
content-type(About, Process overview, Learning path, How-to, Tutorial, Example, Reference, Release note), then title. Unknown or missing types sort last.tutorial: other tutorials first, then remaining related articles (no duplicates).navigation, or:layout: by-area: one list perareavalue on the page.:max:caps items per list (default: no cap).Output
If the author writes
Related articles:as a normal paragraph above the list, page load turns that paragraph into anh3and strips the colon. An existing heading, different wording, or a missing intro is left alone. The generated lists still appear either way.In case someone wanted to add an extra link manually, any list immediately before or after the directive is kept as hand-written. Generated links are appended. A list below is merged into the one above. Hand-linked pages are dropped from the generated set so nothing appears twice.
Lists over 10 items collapse behind a control that toggles between
Show N more articlesandShow fewer. Links are plain HTML from the build. Nothing is fetched on page load.Dependencies
Mechanism only. No articles change in this PR. Lists show up once pages have
areain.. meta::(Enhance metadata PR #6981) and.. ros-related-articles::is added where needed.Testing
Add
areato a page, add.. ros-related-articles::(and optionallyRelated articles:above it), thenmake htmland check the output.Changes
plugins/ros_related_articles.py(env-updatedindex,doctree-resolvedresolution,parallel_read_safeandparallel_write_safe).source/_static/related_articles.js(intro to heading, expand control).plugins/ros_related_articles.md(user guide and developer notes).source/_static/custom.cssfor heading, lists, expand button.conf.pyto register the extension and script.Did you use Generative AI?
Yes - Cursor IDE, using models Composer 2.5, Gemini Pro 3.1, Flash 3.6, and Anthropic Sonnet 5 / Opus 5.
Additional Information
Issue: #6991
This is an automatic backport of pull request #7239 done by [Mergify](https://mergify.com).