Skip to content

Commit

Permalink
doxygen: fix a CASE_SENSE_NAMES omission.
Browse files Browse the repository at this point in the history
In 1d7c689 I fixed one broken part but
forgot about this one. This one affects the Pages tree and the test of
course didn't check it. Now it does.
  • Loading branch information
mosra committed Sep 13, 2018
1 parent 2eb544c commit 03b69fd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
8 changes: 6 additions & 2 deletions doxygen/dox2html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -1788,8 +1788,11 @@ def extract_metadata(state: State, xml):
# Compound name is page filename, so we have to use title there. The same
# is for groups.
compound.name = html.escape(compounddef.find('title').text if compound.kind in ['page', 'group'] and compounddef.findtext('title') else compounddef.find('compoundname').text)
# Compound URL is ID, except for index page
compound.url = (compounddef.find('compoundname').text if compound.kind == 'page' else compound.id) + '.html'
# Compound URL is ID, except for index page, where it is named "indexpage"
# and so I have to override it back to "index". Can't use <compoundname>
# for pages because that doesn't reflect CASE_SENSE_NAMES. THANKS DOXYGEN.
# This is similar to compound.url_base handling in parse_xml() below.
compound.url = 'index.html' if compound.kind == 'page' and compound.id == 'indexpage' else compound.id + '.html'
compound.brief = parse_desc(state, compounddef.find('briefdescription'))
# Groups and pages are explicitly created so they *have details*, other
# things need to have at least some documentation
Expand Down Expand Up @@ -2045,6 +2048,7 @@ def parse_xml(state: State, xml: str):
# Compound URL is ID, except for index page, where it is named "indexpage"
# and so I have to override it back to "index". Can't use <compoundname>
# for pages because that doesn't reflect CASE_SENSE_NAMES. THANKS DOXYGEN.
# This is similar to compound.url handling in extract_metadata() above.
compound.url_base = ('index' if compound.id == 'indexpage' else compound.id)
compound.url = compound.url_base + '.html'
# Save current compound URL for search data building and ID extraction,
Expand Down
51 changes: 51 additions & 0 deletions doxygen/test/compound_filename_case/pages.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion doxygen/test/test_compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ def test(self):
self.run_dox2html5(wildcard='*.xml')

# Verify that all filenames are "converted" to lowercase and the links
# work properly as well
# and page tree work properly as well
self.assertEqual(*self.actual_expected_contents('index.html'))
self.assertEqual(*self.actual_expected_contents('pages.html'))
self.assertEqual(*self.actual_expected_contents('_u_p_p_e_r_c_a_s_e.html'))
self.assertEqual(*self.actual_expected_contents('class_u_p_p_e_r_c_l_a_s_s.html'))

0 comments on commit 03b69fd

Please sign in to comment.