Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add package.xml to standard documents #115

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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