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
@@ -0,0 +1,6 @@
[source,cpp,subs="verbatim,macros,-callouts"]
----
{{> @partial-block }}

----

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_{{> @partial-block }}_
20 changes: 2 additions & 18 deletions share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,12 @@

{{/if}}
{{! Synopsis }}
{{#unless (contains (arr "namespace") symbol.kind)}}
{{#unless (eq symbol.kind "namespace")}}
{{#> markup/dynamic-level-h }}Synopsis{{/markup/dynamic-level-h}}

{{>location/source dcl=(primary_location symbol)}}

{{#if (ne symbol.kind "overloads")}}
[source,cpp,subs="verbatim,macros,-callouts"]
----
{{> symbol/signature symbol }}

----

{{else}}
{{#each symbol.members as | member |}}
[source,cpp,subs="verbatim,macros,-callouts"]
----
{{> symbol/signature member link=member}}

----

{{/each}}
{{/if}}
{{> symbol/signatures symbol }}
{{/unless}}
{{! Tranches }}
{{#if symbol.interface}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{!--
Renders code blocks with signatures related to a symbol

For most symbols, this will render a single code block with the symbol's signature.

For function overloads, this will render a code block for each overload.

Expected Context: {Symbol Object}

Example:
{{> symbol/signatures symbol }}

See: https://mrdocs.com/docs/mrdocs/develop/generators.html#dom_reference
--}}
{{#if (ne kind "overloads")}}
{{#> markup/code-block }}
{{> symbol/signature }}
{{/markup/code-block}}

{{else}}
{{#each members as | member |}}
{{#> markup/code-block }}
{{> symbol/signature member link=member}}
{{/markup/code-block}}

{{#> markup/span class="small" }}{{#> markup/a href=(relativize member.url) }}{{#>markup/em }}» more...{{/markup/em}}{{/markup/a}}{{/markup/span}}

{{/each}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<pre>
<code class="source-code cpp">
{{> @partial-block }}

</code>
</pre>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<em>{{> @partial-block }}</em>
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
<span{{#if class}} class="{{class}}"{{/if}}>
{{> @partial-block }}

</span>
<span{{#if class}} class="{{class}}"{{/if}}>{{> @partial-block }}</span>
20 changes: 2 additions & 18 deletions share/mrdocs/addons/generator/html/partials/symbol.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,14 @@
</div>
{{/unless}}
{{! Synopsis }}
{{#unless (contains (arr "namespace") symbol.kind)}}
{{#unless (eq symbol.kind "namespace")}}
<div>
{{#> markup/dynamic-level-h level=2 }}Synopsis{{/markup/dynamic-level-h}}
<div>
{{>location/source dcl=(primary_location symbol)}}
</div>
{{#if (ne symbol.kind "overloads")}}
<pre>
<code class="source-code cpp">
{{> symbol/signature symbol }}

</code>
</pre>
{{else}}
{{#each symbol.members as | member |}}
<pre>
<code class="language-cpp">
{{> symbol/signature member }}
{{> symbol/signatures symbol }}

</code>
</pre>
<a href="{{{relativize member.url}}}"><em>» more...</em></a>
{{/each}}
{{/if}}
</div>
{{/unless}}
{{! Tranches }}
Expand Down
32 changes: 32 additions & 0 deletions test-files/golden-tests/explicit-ctor.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,24 @@ explicit
<<#Explicit-2constructor-02,Explicit>>();
----

[.small]#<<#Explicit-2constructor-02,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
explicit
<<#Explicit-2constructor-00,Explicit>>(<<#Explicit,Explicit>> const&);
----

[.small]#<<#Explicit-2constructor-00,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
explicit
<<#Explicit-2constructor-0b,Explicit>>(<<#Explicit,Explicit>>&&) noexcept;
----

[.small]#<<#Explicit-2constructor-0b,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
explicit
Expand All @@ -77,6 +83,8 @@ explicit
int);
----

[.small]#<<#Explicit-2constructor-03,_» more..._>>#

[#Explicit-2constructor-02]
== <<#Explicit,Explicit>>::Explicit

Expand Down Expand Up @@ -161,18 +169,24 @@ pass:[explicit(true)]
<<#ExplicitTrue-2constructor-0d,ExplicitTrue>>();
----

[.small]#<<#ExplicitTrue-2constructor-0d,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(true)]
<<#ExplicitTrue-2constructor-04,ExplicitTrue>>(<<#ExplicitTrue,ExplicitTrue>> const&);
----

[.small]#<<#ExplicitTrue-2constructor-04,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(true)]
<<#ExplicitTrue-2constructor-08,ExplicitTrue>>(<<#ExplicitTrue,ExplicitTrue>>&&) noexcept;
----

[.small]#<<#ExplicitTrue-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(true)]
Expand All @@ -181,6 +195,8 @@ pass:[explicit(true)]
int);
----

[.small]#<<#ExplicitTrue-2constructor-05,_» more..._>>#

[#ExplicitTrue-2constructor-0d]
== <<#ExplicitTrue,ExplicitTrue>>::ExplicitTrue

Expand Down Expand Up @@ -265,18 +281,24 @@ pass:[explicit(false)]
<<#ExplicitFalse-2constructor-01,ExplicitFalse>>();
----

[.small]#<<#ExplicitFalse-2constructor-01,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(false)]
<<#ExplicitFalse-2constructor-08,ExplicitFalse>>(<<#ExplicitFalse,ExplicitFalse>> const&);
----

[.small]#<<#ExplicitFalse-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(false)]
<<#ExplicitFalse-2constructor-0a,ExplicitFalse>>(<<#ExplicitFalse,ExplicitFalse>>&&) noexcept;
----

[.small]#<<#ExplicitFalse-2constructor-0a,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(false)]
Expand All @@ -285,6 +307,8 @@ pass:[explicit(false)]
int);
----

[.small]#<<#ExplicitFalse-2constructor-04,_» more..._>>#

[#ExplicitFalse-2constructor-01]
== <<#ExplicitFalse,ExplicitFalse>>::ExplicitFalse

Expand Down Expand Up @@ -370,18 +394,24 @@ pass:[explicit(B)]
<<#ExplicitExpression-2constructor-0b,ExplicitExpression>>();
----

[.small]#<<#ExplicitExpression-2constructor-0b,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(B)]
<<#ExplicitExpression-2constructor-04,ExplicitExpression>>(<<#ExplicitExpression,ExplicitExpression>> const&);
----

[.small]#<<#ExplicitExpression-2constructor-04,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(B)]
<<#ExplicitExpression-2constructor-08,ExplicitExpression>>(<<#ExplicitExpression,ExplicitExpression>>&&) noexcept;
----

[.small]#<<#ExplicitExpression-2constructor-08,_» more..._>>#

[source,cpp,subs="verbatim,macros,-callouts"]
----
pass:[explicit(B)]
Expand All @@ -390,6 +420,8 @@ pass:[explicit(B)]
int);
----

[.small]#<<#ExplicitExpression-2constructor-02,_» more..._>>#

[#ExplicitExpression-2constructor-0b]
== <<#ExplicitExpression,ExplicitExpression>>::ExplicitExpression

Expand Down
Loading
Loading