From: Vladimír Vondruš Date: Sat, 3 Feb 2018 09:48:49 +0000 (+0100) Subject: doxygen: don't show dirs with / at the end in search. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=0b71b894066450369e96d363f6311b0e1c1e8840;p=blog.git doxygen: don't show dirs with / at the end in search. Not needed since we have the type labels now. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 5e3ef581..d86ae66f 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1547,8 +1547,6 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap # Add current item name to prefix list prefixed_name = prefix + [compound.leaf_name] - prefixed_result_name = prefix + [compound.leaf_name] - suffix_length = 0 if compound.kind == 'namespace': kind = ResultFlag.NAMESPACE @@ -1578,14 +1576,9 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap result_joiner = ' » ' else: assert False # pragma: no cover - # Show dirs with / at the end - if compound.kind == 'dir': - prefixed_result_name += [''] - suffix_length = 1 - # If just a leaf name, add it once if not joiner: - result_name = result_joiner.join(prefixed_result_name) + result_name = result_joiner.join(prefixed_name) # TODO: escape elsewhere so i don't have to unescape here index = map.add(html.unescape(result_name), compound.url, flags=kind) @@ -1594,7 +1587,7 @@ def _build_search_data(state: State, prefix, id: str, trie: Trie, map: ResultMap # Otherwise add it multiple times with all possible prefixes else: # TODO: escape elsewhere so i don't have to unescape here - index = map.add(html.unescape(result_joiner.join(prefixed_result_name)), compound.url, suffix_length=suffix_length, flags=kind) + index = map.add(html.unescape(result_joiner.join(prefixed_name)), compound.url, flags=kind) for i in range(len(prefixed_name)): lookahead_barriers = [] name = '' diff --git a/doxygen/test/test_search.py b/doxygen/test/test_search.py index ad83dde3..2441ab23 100755 --- a/doxygen/test/test_search.py +++ b/doxygen/test/test_search.py @@ -407,7 +407,7 @@ macro [17] 4: Namespace::Union [type=UNION] -> unionNamespace_1_1Union.html 5: A page [type=PAGE] -> page.html 6: A page » Subpage [type=PAGE] -> subpage.html -7: Dir/ [suffix_length=1, type=DIR] -> dir_da5033def2d0db76e9883b31b76b3d0c.html +7: Dir [type=DIR] -> dir_da5033def2d0db76e9883b31b76b3d0c.html 8: Dir/File.h [type=FILE] -> File_8h.html 9: Namespace::Class::foo() [type=FUNC] -> classNamespace_1_1Class.html#aaeba4096356215868370d6ea476bf5d9 10: Namespace::Class::foo() const [suffix_length=6, type=FUNC] -> classNamespace_1_1Class.html#ac03c5b93907dda16763eabd26b25500a