Skip to content

Commit

Permalink
add package.xml to standard documents (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkent authored Apr 19, 2024
1 parent 3e03a08 commit bc9e56a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rosdoc2/verbs/build/standard_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

def locate_standard_documents(package_xml_directory):
"""Locate standard documents."""
names = ['readme', 'license', 'contributing', 'changelog', 'quality_declaration']
names = ['readme', 'license', 'contributing', 'changelog', 'quality_declaration', 'package']
found_paths = {}
package_directory_items = os.scandir(package_xml_directory)
for item in package_directory_items:
Expand All @@ -53,6 +53,10 @@ def locate_standard_documents(package_xml_directory):
filetype = 'md'
elif ext.lower() == '.rst':
filetype = 'rst'
elif ext.lower() == '.xml':
if item.name != 'package.xml':
continue
filetype = 'xml'
else:
filetype = 'other'
found_paths[name] = {
Expand Down Expand Up @@ -91,6 +95,9 @@ def generate_standard_document_files(standard_docs, wrapped_sphinx_directory):
elif file_type == 'md':
file_contents += f'.. include:: {file_path}\n'
file_contents += ' :parser: myst_parser.sphinx_\n'
elif file_type == 'xml':
file_contents += f'.. literalinclude:: {file_path}\n'
file_contents += ' :language: xml\n'
else:
file_contents += f'.. literalinclude:: {file_path}\n'
file_contents += ' :language: none\n'
Expand Down
1 change: 1 addition & 0 deletions test/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ def test_full_package(session_dir):
'user_docs/morestuff/more_of_more/subsub.html', # a deep documentation file
'standards.html',
'https://example.com/repo',
'standard_docs/PACKAGE.html', # package.xml
]
excludes = [
'dontshowme'
Expand Down

0 comments on commit bc9e56a

Please sign in to comment.