Skip to content

Commit

Permalink
Add url links in home page (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkent authored Apr 18, 2024
1 parent bd2b7d7 commit 864b07f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions rosdoc2/verbs/build/builders/index.rst.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Welcome to the documentation for {{ package.name }}

{{ package.description }}

{% if package.urls -%}
* Links
{% for link in package.urls %}
* `{{ link.type.capitalize() }} <{{ link.url }}>`_
{% endfor -%}
{% endif -%}

.. toctree::
:maxdepth: 2

Expand Down
8 changes: 6 additions & 2 deletions test/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ def do_test_package(
f'a link should exist containing the string <{item}>'
link_object = urlparse(found_item)
link_path = output_dir / name / link_object.path
assert link_path.is_file(), \
f'file represented by <{found_item}> should exist at <{link_path}>'
if not item.startswith('http'):
assert link_path.is_file(), \
f'file represented by <{found_item}> should exist at <{link_path}>'

# look for fragments of text
for item in fragments:
Expand All @@ -182,6 +183,7 @@ def test_minimum_package(session_dir):
]
excludes = [
'classes and structs', # only found in C++ projects
'links', # only found if urls defined
]
file_includes = [
'search.html',
Expand Down Expand Up @@ -215,6 +217,7 @@ def test_full_package(session_dir):
'instructions', # has documentation
'changelog',
'full ros2 test package', # the package description
'links',
]
file_includes = [
'generated/index.html'
Expand All @@ -224,6 +227,7 @@ def test_full_package(session_dir):
'modules.html',
'user_docs/morestuff/more_of_more/subsub.html', # a deep documentation file
'standards.html',
'https://example.com/repo',
]
excludes = [
'dontshowme'
Expand Down

0 comments on commit 864b07f

Please sign in to comment.