Skip to content

Commit eaa6390

Browse files
committed
add tests
1 parent fcb6ce3 commit eaa6390

File tree

7 files changed

+284
-22
lines changed

7 files changed

+284
-22
lines changed

mrdocs.rnc

+2-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ grammar
416416
Postcondition = element post { TextNode * }
417417
Details = element details { TextNode * }
418418

419-
TextNode = ( Link | Styled | Text | Reference | Copied )
419+
TextNode = ( Link | Styled | Text | Reference | Related | Copied )
420420

421421
Link = element link { attribute href { text }, text }
422422
Styled = (
@@ -426,6 +426,7 @@ grammar
426426
element italic { text } )
427427
Text = element text { text }
428428
Reference = element reference { ID ?, text }
429+
Related = element relates { ID ?, text }
429430
Copied =
430431
element (
431432
copydoc |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
= Reference
2+
:mrdocs:
3+
4+
[#index]
5+
== Global namespace
6+
7+
8+
=== Types
9+
10+
[cols=2]
11+
|===
12+
| Name | Description
13+
14+
| <<A,`A`>>
15+
| A brief for A&period;
16+
17+
| <<B,`B`>>
18+
| A brief for B
19+
20+
|===
21+
=== Functions
22+
23+
[cols=2]
24+
|===
25+
| Name | Description
26+
27+
| <<f,`f`>>
28+
| A brief for f&period;
29+
30+
|===
31+
32+
[#A]
33+
== A
34+
35+
36+
A brief for A&period;
37+
38+
=== Synopsis
39+
40+
41+
Declared in `&lt;relates&period;cpp&gt;`
42+
43+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
44+
----
45+
struct A;
46+
----
47+
48+
49+
50+
51+
=== Related functions
52+
53+
[cols=2]
54+
|===
55+
| Name | Description
56+
57+
| <<f,`f`>>
58+
| A brief for f&period;
59+
60+
|===
61+
62+
[#B]
63+
== B
64+
65+
66+
A brief for B
67+
68+
=== Synopsis
69+
70+
71+
Declared in `&lt;relates&period;cpp&gt;`
72+
73+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
74+
----
75+
struct B;
76+
----
77+
78+
79+
80+
81+
[#f]
82+
== f
83+
84+
85+
A brief for f&period;
86+
87+
=== Synopsis
88+
89+
90+
Declared in `&lt;relates&period;cpp&gt;`
91+
92+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
93+
----
94+
void
95+
f();
96+
----
97+
98+
=== Description
99+
100+
101+
102+
103+
104+
105+
106+
107+
[.small]#Created with https://www.mrdocs.com[MrDocs]#
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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">Global namespace</h2>
11+
</div>
12+
<h2>Types</h2>
13+
<table style="table-layout: fixed; width: 100%;">
14+
<thead>
15+
<tr>
16+
<th>Name</th><th>Description</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
<tr>
21+
<td><a href="#A"><code>A</code></a> </td><td><span><span>A brief for A.</span></span>
22+
23+
</td></tr><tr>
24+
<td><a href="#B"><code>B</code></a> </td><td><span><span>A brief for B</span></span>
25+
26+
</td></tr>
27+
</tbody>
28+
</table>
29+
<h2>Functions</h2>
30+
<table style="table-layout: fixed; width: 100%;">
31+
<thead>
32+
<tr>
33+
<th>Name</th><th>Description</th>
34+
</tr>
35+
</thead>
36+
<tbody>
37+
<tr>
38+
<td><a href="#f"><code>f</code></a> </td><td><span><span>A brief for f.</span></span>
39+
40+
</td></tr>
41+
</tbody>
42+
</table>
43+
</div>
44+
<div>
45+
<div>
46+
<h2 id="A">A</h2>
47+
<div>
48+
<span><span>A brief for A.</span></span>
49+
50+
51+
</div>
52+
</div>
53+
<div>
54+
<h3>Synopsis</h3>
55+
<div>
56+
Declared in <code>&lt;relates.cpp&gt;</code></div>
57+
<pre>
58+
<code class="source-code cpp">
59+
struct A;
60+
</code>
61+
</pre>
62+
</div>
63+
64+
65+
</div>
66+
<div>
67+
<div>
68+
<h2 id="B">B</h2>
69+
<div>
70+
<span><span>A brief for B</span></span>
71+
72+
73+
</div>
74+
</div>
75+
<div>
76+
<h3>Synopsis</h3>
77+
<div>
78+
Declared in <code>&lt;relates.cpp&gt;</code></div>
79+
<pre>
80+
<code class="source-code cpp">
81+
struct B;
82+
</code>
83+
</pre>
84+
</div>
85+
86+
87+
</div>
88+
<div>
89+
<div>
90+
<h2 id="f">f</h2>
91+
<div>
92+
<span><span>A brief for f.</span></span>
93+
94+
95+
</div>
96+
</div>
97+
<div>
98+
<h3>Synopsis</h3>
99+
<div>
100+
Declared in <code>&lt;relates.cpp&gt;</code></div>
101+
<pre>
102+
<code class="source-code cpp">
103+
void
104+
f();
105+
</code>
106+
</pre>
107+
</div>
108+
<div>
109+
<h3>Description</h3>
110+
<p></p>
111+
112+
113+
</div>
114+
</div>
115+
116+
</div>
117+
<div>
118+
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
119+
</div>
120+
</body>
121+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
<struct name="A" id="YrPSaKAbmXgzCAX5WByx4eVoqBM=">
6+
<file short-path="relates.cpp" source-path="relates.cpp" line="3" class="def"/>
7+
<doc>
8+
<brief>
9+
<text>A brief for A.</text>
10+
</brief>
11+
</doc>
12+
</struct>
13+
<struct name="B" id="3JsK1DO0O+wZhv+0meptQrbs3fY=">
14+
<file short-path="relates.cpp" source-path="relates.cpp" line="7" class="def"/>
15+
<doc>
16+
<brief>
17+
<text>A brief for B</text>
18+
</brief>
19+
</doc>
20+
</struct>
21+
<function name="f" id="s6nsa+zVhpzzrN+yUVPP5rvdXqs=">
22+
<file short-path="relates.cpp" source-path="relates.cpp" line="13"/>
23+
<doc>
24+
<brief>
25+
<text>A brief for f.</text>
26+
</brief>
27+
<para>
28+
<relates id="YrPSaKAbmXgzCAX5WByx4eVoqBM=">A</relates>
29+
</para>
30+
</doc>
31+
</function>
32+
</namespace>
33+
</mrdocs>

test-files/golden-tests/symbols/concept/requires-clause.adoc

+9-9
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ Declared in `&lt;requires&hyphen;clause&period;cpp&gt;`
9999
template&lt;typename T&gt;
100100
requires (sizeof(T) &equals;&equals; 2)
101101
void
102-
<<g-04,g>>();
102+
<<g-02,g>>();
103103
----
104104

105-
[.small]#<<g-04,_» more&period;&period;&period;_>>#
105+
[.small]#<<g-02,_» more&period;&period;&period;_>>#
106106

107107

108108

@@ -111,10 +111,10 @@ void
111111
template&lt;typename T&gt;
112112
requires (sizeof(T) &equals;&equals; 4)
113113
void
114-
<<g-00,g>>();
114+
<<g-04,g>>();
115115
----
116116

117-
[.small]#<<g-00,_» more&period;&period;&period;_>>#
117+
[.small]#<<g-04,_» more&period;&period;&period;_>>#
118118

119119

120120

@@ -123,12 +123,12 @@ void
123123
template&lt;typename U&gt;
124124
requires (sizeof(U) &equals;&equals; 2)
125125
void
126-
<<g-03,g>>();
126+
<<g-0b,g>>();
127127
----
128128

129-
[.small]#<<g-03,_» more&period;&period;&period;_>>#
129+
[.small]#<<g-0b,_» more&period;&period;&period;_>>#
130130

131-
[#g-04]
131+
[#g-02]
132132
== g
133133

134134

@@ -145,7 +145,7 @@ void
145145
g();
146146
----
147147

148-
[#g-00]
148+
[#g-04]
149149
== g
150150

151151

@@ -162,7 +162,7 @@ void
162162
g();
163163
----
164164

165-
[#g-03]
165+
[#g-0b]
166166
== g
167167

168168

0 commit comments

Comments
 (0)