From 9db62e4fac834a075be9980df40f72aa8a55147a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 28 Jan 2018 22:45:02 +0100 Subject: [PATCH] doxygen: don't include function parameter names in search results. Too damn long. --- doc/doxygen.rst | 4 +++- doxygen/dox2html5.py | 11 +++++++---- doxygen/templates/details-func.html | 2 +- doxygen/templates/entry-func.html | 2 +- doxygen/test/search/Dir/File.h | 2 +- doxygen/test/test_search.py | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/doxygen.rst b/doc/doxygen.rst index 7f90b90a..5f7dbff1 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -1254,7 +1254,9 @@ Each item has the following properties: Property Description =========================== =================================================== :py:`param.name` Parameter name (if not anonymous) -:py:`param.type` Parameter type, together with name and array +:py:`param.type` Parameter type, together with array specification + [6]_ +:py:`param.type_name` Parameter type, together with name and array specification [6]_ :py:`param.default` Default parameter value, if any [6]_ :py:`param.description` Optional parameter description. If set, diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 64ef448a..7fde75d7 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1272,13 +1272,16 @@ def parse_func(state: State, element: ET.Element): if array is not None: if name is not None: if param.type.endswith(')'): - param.type = param.type[:-1] + name.text + ')' + array.text + param.type_name = param.type[:-1] + name.text + ')' + array.text else: - param.type = param.type + ' ' + name.text + array.text + param.type_name = param.type + ' ' + name.text + array.text else: - param.type += array.text + param.type_name = param.type + array.text + param.type += array.text elif name is not None: - param.type += ' ' + name.text + param.type_name = param.type + ' ' + name.text + else: + param.type_name = param.type param.default = parse_type(state, p.find('defval')) if param.name in params: diff --git a/doxygen/templates/details-func.html b/doxygen/templates/details-func.html index 58b63965..5543fc1c 100644 --- a/doxygen/templates/details-func.html +++ b/doxygen/templates/details-func.html @@ -13,7 +13,7 @@ {% endif %} {% set j = joiner(',\n ') %} - {{ func.prefix }}{{ func.type }} {{ prefix }}{{ func.name }}({% for param in func.params %}{{ j() }}{{ param.type }}{% if param.default %} = {{ param.default }}{% endif %}{% endfor %}){{ func.suffix }}{% if func.is_explicit %} explicit {% endif %}{% if func.is_pure_virtual %} pure virtual{% elif func.is_virtual %} virtual{% endif %}{% if func.is_protected %} protected{% elif func.is_private %} private{% endif %}{% if func.is_defaulted %} defaulted{% endif %}{% if func.is_deleted %} deleted{% endif %}{% if func.is_constexpr %} constexpr{% endif %}{% if func.is_noexcept %} noexcept{% endif %} + {{ func.prefix }}{{ func.type }} {{ prefix }}{{ func.name }}({% for param in func.params %}{{ j() }}{{ param.type_name }}{% if param.default %} = {{ param.default }}{% endif %}{% endfor %}){{ func.suffix }}{% if func.is_explicit %} explicit {% endif %}{% if func.is_pure_virtual %} pure virtual{% elif func.is_virtual %} virtual{% endif %}{% if func.is_protected %} protected{% elif func.is_private %} private{% endif %}{% if func.is_defaulted %} defaulted{% endif %}{% if func.is_deleted %} deleted{% endif %}{% if func.is_constexpr %} constexpr{% endif %}{% if func.is_noexcept %} noexcept{% endif %} {% if func.brief %}

{{ func.brief }}

diff --git a/doxygen/templates/entry-func.html b/doxygen/templates/entry-func.html index a7e09123..39c6b351 100644 --- a/doxygen/templates/entry-func.html +++ b/doxygen/templates/entry-func.html @@ -4,6 +4,6 @@
template<{% for t in func.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif%}{% endfor %}>
{% endif %} {% set j = joiner(',\n ') %} - {{ func.prefix }}{% if func.type == 'void' %}void {% elif func.type %}auto {% endif %}{{ func.name }}({% for param in func.params %}{{ j() }}{{ param.type }}{% if param.default %} = {{ param.default }}{% endif %}{% endfor %}){{ func.suffix }}{% if func.type and func.type != 'void' %} -> {{ func.type }}{% endif %}{% if not func.type or mark_nonpublic %}{% if func.is_protected %} protected{% elif func.is_private %} private{% endif %}{% endif %}{% if func.is_defaulted %} defaulted{% endif %}{% if func.is_deleted %} deleted{% endif %}{% if func.is_explicit %} explicit {% endif %}{% if func.is_pure_virtual %} pure virtual{% elif func.is_virtual %} virtual{% endif %}{% if func.is_constexpr %} constexpr{% endif %}{% if func.is_noexcept %} noexcept{% endif %} + {{ func.prefix }}{% if func.type == 'void' %}void {% elif func.type %}auto {% endif %}{{ func.name }}({% for param in func.params %}{{ j() }}{{ param.type_name }}{% if param.default %} = {{ param.default }}{% endif %}{% endfor %}){{ func.suffix }}{% if func.type and func.type != 'void' %} -> {{ func.type }}{% endif %}{% if not func.type or mark_nonpublic %}{% if func.is_protected %} protected{% elif func.is_private %} private{% endif %}{% endif %}{% if func.is_defaulted %} defaulted{% endif %}{% if func.is_deleted %} deleted{% endif %}{% if func.is_explicit %} explicit {% endif %}{% if func.is_pure_virtual %} pure virtual{% elif func.is_virtual %} virtual{% endif %}{% if func.is_constexpr %} constexpr{% endif %}{% if func.is_noexcept %} noexcept{% endif %}
{{ func.brief }}
diff --git a/doxygen/test/search/Dir/File.h b/doxygen/test/search/Dir/File.h index 72819d5b..459d447e 100644 --- a/doxygen/test/search/Dir/File.h +++ b/doxygen/test/search/Dir/File.h @@ -20,7 +20,7 @@ class Class { void foo() &&; /**< @overload */ /** @brief Function with arguments */ - void foo(const Enum&, Typedef); + void foo(const Enum& first, Typedef second); }; /** @brief A variable */ diff --git a/doxygen/test/test_search.py b/doxygen/test/test_search.py index 1e1251a4..82252aae 100755 --- a/doxygen/test/test_search.py +++ b/doxygen/test/test_search.py @@ -339,7 +339,7 @@ macro [14] 6: Namespace::Class::foo() [0] -> classNamespace_1_1Class.html#aaeba4096356215868370d6ea476bf5d9 7: Namespace::Class::foo() const [1, suffix_length=6] -> classNamespace_1_1Class.html#ac03c5b93907dda16763eabd26b25500a 8: Namespace::Class::foo() && [1, suffix_length=3] -> classNamespace_1_1Class.html#ac9e7e80d06281e30cfcc13171d117ade -9: Namespace::Class::foo(const Enum&, Typedef) [1, suffix_length=20] -> classNamespace_1_1Class.html#abd560769b0863ca5d64905e8e0fc231b +9: Namespace::Class::foo(const Enum&, Typedef) [1, suffix_length=20] -> classNamespace_1_1Class.html#aba8d57a830d4d79f86d58d92298677fa 10: Namespace::Enum::Value [0] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfeaa689202409e48743b914713f96d93947c 11: Namespace::Enum [0] -> namespaceNamespace.html#add172b93283b1ab7612c3ca6cc5dcfea 12: Namespace::Typedef [0] -> namespaceNamespace.html#abe2a245304bc2234927ef33175646e08 -- 2.30.2