From: Vladimír Vondruš Date: Thu, 13 Sep 2018 11:27:14 +0000 (+0200) Subject: doxygen: fix a CASE_SENSE_NAMES omission. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=03b69fd4f0e084f6ff9f0bfc51188e7e4ff5070d;p=blog.git doxygen: fix a CASE_SENSE_NAMES omission. In 1d7c689fd36b6952c0f6877ad9af562e3e10433a 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. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 4a6456a6..d79b8e36 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -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 + # 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 @@ -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 # 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, diff --git a/doxygen/test/compound_filename_case/pages.html b/doxygen/test/compound_filename_case/pages.html new file mode 100644 index 00000000..97ce1230 --- /dev/null +++ b/doxygen/test/compound_filename_case/pages.html @@ -0,0 +1,51 @@ + + + + + My Project + + + + + +
+
+
+
+
+

Pages

+ + +
+
+
+
+ + diff --git a/doxygen/test/test_compound.py b/doxygen/test/test_compound.py index 826c6de7..69221b8c 100644 --- a/doxygen/test/test_compound.py +++ b/doxygen/test/test_compound.py @@ -230,7 +230,8 @@ class FilenameCase(IntegrationTestCase): 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'))