From e939265909e2d049c5b18d6e8f0b246d83dfe8c8 Mon Sep 17 00:00:00 2001 From: Agustin Berge Date: Wed, 17 Sep 2025 15:08:46 +0200 Subject: [PATCH 1/2] fix? --- .../generator/common/partials/symbol/signature/record.hbs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/mrdocs/addons/generator/common/partials/symbol/signature/record.hbs b/share/mrdocs/addons/generator/common/partials/symbol/signature/record.hbs index 267d1b2cbd..f40ca685df 100644 --- a/share/mrdocs/addons/generator/common/partials/symbol/signature/record.hbs +++ b/share/mrdocs/addons/generator/common/partials/symbol/signature/record.hbs @@ -2,7 +2,9 @@ {{/if~}} {{#if isFriend}}friend {{/if~}} {{~tag}} {{#if (contains (arr "explicit" "partial") template.kind)~}} - {{>symbol/name template.primary ~}}{{>template/args args=template.args ~}} + {{!~ If the last part is a template specialization, we include links to primary template and the arguments. ~}} + {{!~ If the primary template wasn't correctly extracted for some reason, we just print the name as usual. ~}} + {{#if template.primary }}{{~>symbol/name template.primary ~}}{{else}}{{ name }}{{/if}}{{>template/args args=template.args ~}} {{~else~}} {{>symbol/name-text symbol ~}} {{~/if}} From 4a916a9c8bd311782d793356ceb09eaa882db977 Mon Sep 17 00:00:00 2001 From: Agustin Berge Date: Wed, 17 Sep 2025 15:38:14 +0200 Subject: [PATCH 2/2] add test --- .../templates/ct_expl_dependency.adoc | 50 ++++++++++++ .../templates/ct_expl_dependency.cpp | 5 ++ .../templates/ct_expl_dependency.html | 79 +++++++++++++++++++ .../templates/ct_expl_dependency.xml | 15 ++++ .../templates/ct_expl_dependency.yml | 2 + 5 files changed, 151 insertions(+) create mode 100644 test-files/golden-tests/templates/ct_expl_dependency.adoc create mode 100644 test-files/golden-tests/templates/ct_expl_dependency.cpp create mode 100644 test-files/golden-tests/templates/ct_expl_dependency.html create mode 100644 test-files/golden-tests/templates/ct_expl_dependency.xml create mode 100644 test-files/golden-tests/templates/ct_expl_dependency.yml diff --git a/test-files/golden-tests/templates/ct_expl_dependency.adoc b/test-files/golden-tests/templates/ct_expl_dependency.adoc new file mode 100644 index 0000000000..71ee8718db --- /dev/null +++ b/test-files/golden-tests/templates/ct_expl_dependency.adoc @@ -0,0 +1,50 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + +=== Types + +[cols=1] +|=== +| Name +| link:#A[`A<int>`] +|=== + +[#A] +== A<int> + +=== Synopsis + +Declared in `<ct_expl_dependency.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<> +struct A<int>; +---- + +=== Member Functions + +[cols=1] +|=== +| Name +| link:#A-g[`g`] +|=== + +[#A-g] +== link:#A[A<int>]::g + +=== Synopsis + +Declared in `<ct_expl_dependency.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +void +g(); +---- + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/templates/ct_expl_dependency.cpp b/test-files/golden-tests/templates/ct_expl_dependency.cpp new file mode 100644 index 0000000000..5577ed5e27 --- /dev/null +++ b/test-files/golden-tests/templates/ct_expl_dependency.cpp @@ -0,0 +1,5 @@ +template +struct A { void f() { } }; + +template<> +struct A { void g() { } }; diff --git a/test-files/golden-tests/templates/ct_expl_dependency.html b/test-files/golden-tests/templates/ct_expl_dependency.html new file mode 100644 index 0000000000..91b681dc60 --- /dev/null +++ b/test-files/golden-tests/templates/ct_expl_dependency.html @@ -0,0 +1,79 @@ + + +Reference + + +
+

Reference

+
+
+

+
+

Types

+ + + + + + + + + + +
Name
A<int>
+ +
+
+
+

A<int>

+
+
+

Synopsis

+
+Declared in <ct_expl_dependency.cpp>
+
+template<>
+struct A<int>;
+
+
+
+
+

Member Functions

+ + + + + + + + + + +
Name
g
+ + + +
+
+ +
+

Synopsis

+
+Declared in <ct_expl_dependency.cpp>
+
+void
+g();
+
+
+
+
+
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/templates/ct_expl_dependency.xml b/test-files/golden-tests/templates/ct_expl_dependency.xml new file mode 100644 index 0000000000..30bb807a28 --- /dev/null +++ b/test-files/golden-tests/templates/ct_expl_dependency.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/test-files/golden-tests/templates/ct_expl_dependency.yml b/test-files/golden-tests/templates/ct_expl_dependency.yml new file mode 100644 index 0000000000..776d6aec3e --- /dev/null +++ b/test-files/golden-tests/templates/ct_expl_dependency.yml @@ -0,0 +1,2 @@ +exclude-symbols: + - 'A'