Skip to content

Commit ad1e7ba

Browse files
authored
Remove duplicate template argument list for excluded class template specialization
fix #983
1 parent a1f289d commit ad1e7ba

File tree

6 files changed

+154
-1
lines changed

6 files changed

+154
-1
lines changed

share/mrdocs/addons/generator/common/partials/symbol/signature/record.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
{{/if~}}
33
{{#if isFriend}}friend {{/if~}}
44
{{~tag}} {{#if (contains (arr "explicit" "partial") template.kind)~}}
5-
{{>symbol/name template.primary ~}}{{>template/args args=template.args ~}}
5+
{{!~ If the last part is a template specialization, we include links to primary template and the arguments. ~}}
6+
{{!~ If the primary template wasn't correctly extracted for some reason, we just print the name as usual. ~}}
7+
{{#if template.primary }}{{~>symbol/name template.primary ~}}{{else}}{{ name }}{{/if}}{{>template/args args=template.args ~}}
68
{{~else~}}
79
{{>symbol/name-text symbol ~}}
810
{{~/if}}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
= Reference
2+
:mrdocs:
3+
4+
[#index]
5+
== Global namespace
6+
7+
=== Types
8+
9+
[cols=1]
10+
|===
11+
| Name
12+
| link:#A[`A<int>`]
13+
|===
14+
15+
[#A]
16+
== A<int>
17+
18+
=== Synopsis
19+
20+
Declared in `<ct_expl_dependency.cpp>`
21+
22+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
23+
----
24+
template<>
25+
struct A<int>;
26+
----
27+
28+
=== Member Functions
29+
30+
[cols=1]
31+
|===
32+
| Name
33+
| link:#A-g[`g`]
34+
|===
35+
36+
[#A-g]
37+
== link:#A[A<int>]::g
38+
39+
=== Synopsis
40+
41+
Declared in `<ct_expl_dependency.cpp>`
42+
43+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
44+
----
45+
void
46+
g();
47+
----
48+
49+
50+
[.small]#Created with https://www.mrdocs.com[MrDocs]#
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
template<typename T>
2+
struct A { void f() { } };
3+
4+
template<>
5+
struct A<int> { void g() { } };
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<html lang="en">
2+
<head>
3+
<title>Reference</title>
4+
</head>
5+
<body>
6+
<div>
7+
<h1>Reference</h1>
8+
<div>
9+
<div>
10+
<h2 id="index"><a href="#index"></a></h2>
11+
</div>
12+
<h2>Types</h2>
13+
<table style="table-layout: fixed; width: 100%;">
14+
<thead>
15+
<tr>
16+
<th>Name</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
<tr>
21+
<td><a href="#A"><code>A&lt;int&gt;</code></a> </td></tr>
22+
</tbody>
23+
</table>
24+
25+
</div>
26+
<div>
27+
<div>
28+
<h2 id="A"><a href="#A">A&lt;int&gt;</a></h2>
29+
</div>
30+
<div>
31+
<h3>Synopsis</h3>
32+
<div>
33+
Declared in <code>&lt;ct_expl_dependency.cpp&gt;</code></div>
34+
<pre>
35+
<code class="source-code cpp">template&lt;&gt;
36+
struct A&lt;int&gt;;
37+
38+
</code>
39+
</pre>
40+
</div>
41+
<h2>Member Functions</h2>
42+
<table style="table-layout: fixed; width: 100%;">
43+
<thead>
44+
<tr>
45+
<th>Name</th>
46+
</tr>
47+
</thead>
48+
<tbody>
49+
<tr>
50+
<td><a href="#A-g"><code>g</code></a> </td></tr>
51+
</tbody>
52+
</table>
53+
54+
55+
56+
</div>
57+
<div>
58+
<div>
59+
<h2 id="A-g"><a href="#A-g">A&lt;int&gt;::g</a></h2>
60+
</div>
61+
<div>
62+
<h3>Synopsis</h3>
63+
<div>
64+
Declared in <code>&lt;ct_expl_dependency.cpp&gt;</code></div>
65+
<pre>
66+
<code class="source-code cpp">void
67+
g();
68+
69+
</code>
70+
</pre>
71+
</div>
72+
</div>
73+
74+
</div>
75+
<div>
76+
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
77+
</div>
78+
</body>
79+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mrdocs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
4+
<namespace id="//////////////////////////8=">
5+
<template class="explicit">
6+
<targ class="type" type="int"/>
7+
<struct name="A" id="AKwlChAOi+0ttIAPsD7uitS+gk0=">
8+
<file short-path="ct_expl_dependency.cpp" source-path="ct_expl_dependency.cpp" line="5" class="def"/>
9+
<function name="g" id="NCn1LYKSU8X/x/ejZTTGKsJQLug=">
10+
<file short-path="ct_expl_dependency.cpp" source-path="ct_expl_dependency.cpp" line="5" class="def"/>
11+
</function>
12+
</struct>
13+
</template>
14+
</namespace>
15+
</mrdocs>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude-symbols:
2+
- 'A'

0 commit comments

Comments
 (0)