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 267d1b2cb..f40ca685d 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}} 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 000000000..71ee8718d --- /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 000000000..5577ed5e2 --- /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 000000000..91b681dc6 --- /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
+ + + +
+
+
+

A<int>::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 000000000..30bb807a2 --- /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 000000000..776d6aec3 --- /dev/null +++ b/test-files/golden-tests/templates/ct_expl_dependency.yml @@ -0,0 +1,2 @@ +exclude-symbols: + - 'A'