Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
50 changes: 50 additions & 0 deletions test-files/golden-tests/templates/ct_expl_dependency.adoc
Original file line number Diff line number Diff line change
@@ -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]#
5 changes: 5 additions & 0 deletions test-files/golden-tests/templates/ct_expl_dependency.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
template<typename T>
struct A { void f() { } };

template<>
struct A<int> { void g() { } };
79 changes: 79 additions & 0 deletions test-files/golden-tests/templates/ct_expl_dependency.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<html lang="en">
<head>
<title>Reference</title>
</head>
<body>
<div>
<h1>Reference</h1>
<div>
<div>
<h2 id="index"><a href="#index"></a></h2>
</div>
<h2>Types</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#A"><code>A&lt;int&gt;</code></a> </td></tr>
</tbody>
</table>

</div>
<div>
<div>
<h2 id="A"><a href="#A">A&lt;int&gt;</a></h2>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;ct_expl_dependency.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">template&lt;&gt;
struct A&lt;int&gt;;

</code>
</pre>
</div>
<h2>Member Functions</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#A-g"><code>g</code></a> </td></tr>
</tbody>
</table>



</div>
<div>
<div>
<h2 id="A-g"><a href="#A-g">A&lt;int&gt;::g</a></h2>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;ct_expl_dependency.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">void
g();

</code>
</pre>
</div>
</div>

</div>
<div>
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
</div>
</body>
</html>
15 changes: 15 additions & 0 deletions test-files/golden-tests/templates/ct_expl_dependency.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<mrdocs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
<namespace id="//////////////////////////8=">
<template class="explicit">
<targ class="type" type="int"/>
<struct name="A" id="AKwlChAOi+0ttIAPsD7uitS+gk0=">
<file short-path="ct_expl_dependency.cpp" source-path="ct_expl_dependency.cpp" line="5" class="def"/>
<function name="g" id="NCn1LYKSU8X/x/ejZTTGKsJQLug=">
<file short-path="ct_expl_dependency.cpp" source-path="ct_expl_dependency.cpp" line="5" class="def"/>
</function>
</struct>
</template>
</namespace>
</mrdocs>
2 changes: 2 additions & 0 deletions test-files/golden-tests/templates/ct_expl_dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude-symbols:
- 'A'
Loading