Skip to content

Commit

Permalink
fix: HTML matches Asciidoc templates
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni authored May 30, 2024
1 parent 590b317 commit 561f213
Show file tree
Hide file tree
Showing 60 changed files with 732 additions and 336 deletions.
17 changes: 17 additions & 0 deletions share/mrdocs/addons/generator/html/layouts/overload-set.html.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{#if relfileprefix}}<meta name="relfileprefix" content="{{relfileprefix}}">{{/if}}
<div id="{{#if (is_multipage)}}{{symbol.id}}{{else}}{{symbol.ref}}{{/if}}">

<h1>{{#if symbol.name}}Overload set {{>nested-name-specifier symbol=symbol.parent}}{{symbol.name}}{{else}}Unnamed overload set{{/if}}</h1>

<h2>Members</h2>

{{#each symbol.members as |member|}}

<p>{{member.doc.brief}}</p>

<pre><code class="language-cpp">{{> (concat 'signature' '/' (lookup member 'kind')) symbol=member}};</code></pre>
<a href="{{ref}}"><em>» more...</em></a>

{{/each}}

</div>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{#with symbol}}
{{> (lookup . 'kind') symbol=.}}
{{/with}}
{{#if relfileprefix}}:relfileprefix: {{relfileprefix}}{{/if}}
[#{{#if (is_multipage)}}{{symbol.id}}{{else}}{{symbol.ref}}{{/if}}]

{{> (concat 'symbols' '/' (lookup symbol 'kind')) symbol=symbol}}
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
{{#if (eq kind "lvalue-reference")~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
{{~>declarator-after pointee-type~}}
{{~else if (eq kind "rvalue-reference")~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
{{~>declarator-after pointee-type~}}
{{~else if (eq kind "pointer")~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
{{~>declarator-after pointee-type~}}
{{~else if (eq kind "member-pointer")~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}){{~/if~}}
{{~>declarator-after pointee-type~}}
{{~else if (eq kind "array")~}}
{{#if pointee-type~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))}}){{/if~}}
{{~>declarator-after pointee-type nolink=nolink~}}
{{else if (eq kind "array")~}}
[{{bounds-value}}]
{{~>declarator-after element-type~}}
{{~else if (eq kind "function")~}}
({{~#each param-types~}}
{{~>declarator decl-name="" decl-name-targs=""~}}{{~#unless @last}}, {{/unless~}}
{{~/each~}})
{{~>declarator-after element-type nolink=nolink~}}
{{else if (eq kind "function")~}}
({{#each param-types~}}
{{~>declarator nolink=../nolink~}}{{~#unless @last}}, {{/unless~}}
{{/each~}})
{{~#if cv-qualifiers}} {{cv-qualifiers}}{{/if~}}
{{~#if (eq ref-qualifier "lvalue")}} &{{else if (eq ref-qualifier "rvalue")}} &&{{/if~}}
{{~#if exception-spec}} {{exception-spec}}{{~/if~}}
{{~>declarator-after return-type~}}
{{/if}}
{{#if (eq ref-qualifier "lvalue")}} &{{else if (eq ref-qualifier "rvalue")}} &&{{/if~}}
{{#if exception-spec}} {{exception-spec}}{{/if~}}
{{~>declarator-after return-type nolink=nolink~}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -1,33 +1,16 @@
{{#if (eq kind "builtin")~}}
{{#if cv-qualifiers}}{{cv-qualifiers}} {{/if~}}
{{name~}}
{{~else if (eq kind "tag")~}}
{{#if cv-qualifiers}}{{cv-qualifiers}} {{/if~}}
{{#if parent-type~}}{{>declarator parent-type decl-name="" decl-name-targs=""}}::{{/if~}}
{{#if symbol}}{{>xref symbol content=name}}{{else}}{{name~}}{{/if}}
{{~else if (eq kind "specialization")~}}
{{#if cv-qualifiers}}{{cv-qualifiers}} {{/if~}}
{{#if parent-type~}}{{>declarator parent-type decl-name="" decl-name-targs=""}}::{{/if~}}
{{#if symbol}}{{>xref symbol content=name}}{{else}}{{name~}}{{/if}}
{{~>template-args args=args~}}
{{~else if (eq kind "lvalue-reference")~}}
{{~>declarator-before pointee-type~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}&
{{~else if (eq kind "rvalue-reference")~}}
{{~>declarator-before pointee-type~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}&&
{{~else if (eq kind "pointer")~}}
{{~>declarator-before pointee-type~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}*
{{~#if cv-qualifiers}} {{cv-qualifiers}}{{/if~}}
{{~else if (eq kind "member-pointer")~}}
{{~>declarator-before pointee-type~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))~}}({{~/if~}}
{{#if parent-type~}}{{>declarator parent-type decl-name="" decl-name-targs=""}}::*{{/if~}}
{{#if cv-qualifiers}} {{cv-qualifiers}}{{/if~}}
{{~else if (eq kind "array")~}}
{{~>declarator-before element-type~}}
{{~else if (eq kind "function")~}}
{{~>declarator-before return-type~}}
{{#if pointee-type~}}
{{~>declarator-before pointee-type nolink=nolink~}}
{{#if (or (eq pointee-type.kind "array") (eq pointee-type.kind "function"))}}({{/if~}}
{{~/if~}}
{{#if element-type~}}{{~>declarator-before element-type nolink=nolink~}}{{/if~}}
{{#if return-type~}}{{~>declarator-before return-type nolink=nolink~}}{{/if~}}
{{#if (eq kind "lvalue-reference")}}&{{/if~}}
{{#if (eq kind "rvalue-reference")}}&&{{/if~}}
{{#if (eq kind "pointer")}}*{{/if~}}
{{#if (eq kind "member-pointer")}}{{>declarator parent-type nolink=nolink}}::*{{/if~}}
{{#if cv-qualifiers~}}
{{#if pointee-type}} {{cv-qualifiers}}{{else}}{{cv-qualifiers}} {{/if~}}
{{/if~}}
{{~#if is-pack}}...{{/if~}}
{{#if (eq kind "decltype")}}decltype({{operand}}){{/if~}}
{{#if (eq kind "named")}}{{>name-info name nolink=nolink}}{{/if~}}
{{#if is-pack~}}...{{/if}}
10 changes: 10 additions & 0 deletions share/mrdocs/addons/generator/html/partials/declarator-id.html.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{#if (and (eq kind "function") (eq class "conversion"))~}}
operator {{>declarator return nolink=nolink~}}
{{else if (eq kind "guide")~}}
{{>declarator deduced nolink=nolink~}}
{{else~}}
{{#if (and link.ref (not nolink))}}xref:{{link.ref}}[{{name}}]{{else}}{{name}}{{/if~}}
{{#if (or (eq template.kind "explicit") (eq template.kind "partial"))~}}
{{>template-args args=template.args nolink=nolink~}}
{{/if~}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span class="declarator">{{>declarator-before~}}
{{~#if decl-name}} <span class="declarator-name">{{decl-name~}}</span>
{{~#if decl-name-targs~}}{{>template-args args=decl-name-targs}}{{~/if~}}
{{>declarator-before nolink=nolink~}}
{{~#if decl-name}} {{decl-name~}}
{{~#if decl-name-targs~}}{{>template-args args=decl-name-targs nolink=nolink}}{{~/if~}}
{{~/if~}}
{{~>declarator-after~}}</span>
{{~>declarator-after nolink=nolink}}
65 changes: 0 additions & 65 deletions share/mrdocs/addons/generator/html/partials/enum.html.hbs

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion share/mrdocs/addons/generator/html/partials/field.html.hbs

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions share/mrdocs/addons/generator/html/partials/function-sig.html.hbs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{#if members}}
<div>
<h3>{{title}}</h3>
<table>
<colgroup>
<col style="width: 50%;">
Expand All @@ -11,7 +13,7 @@
</tr>
</thead>
<tbody>
{{#each .}}
{{#each (sort_by members "name")}}
<tr>
<td>{{>xref id=id content=name}}</td>
<td>{{{doc.brief}}}</td>
Expand All @@ -20,3 +22,4 @@
</tbody>
</table>
</div>
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
¦xref:{{ref}}[`{{>declarator-id . nolink=true}}`] ¦
{{#if (ne kind "overload")~}}
{{~doc.brief}}
{{else~}}
{{#each (unique (pluck (pluck members "doc") "brief"))~}}
{{.}}
{{/each~}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{#if prefix~}}
{{#unless (or (contains @root.symbol.namespace prefix.symbol) (eq @root.symbol prefix.symbol))~}}
{{>name-info prefix nolink=nolink~}}::
{{~/unless~}}
{{/if~}}
{{#if (and symbol.ref (not nolink))}}xref:{{symbol.ref}}[{{name}}]{{else~}}
{{name}}{{/if}}{{#if args}}{{>template-args args=args nolink=nolink}}{{/if~}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{#if (and symbol (or includeNamespace (ne symbol.kind "namespace")))~}}
{{#if symbol.parent~}}
{{>nested-name-specifier symbol=symbol.parent~}}
{{else~}}
{{/if~}}
{{!--
{{#if symbol.name}}
xref:{{symbol.ref}}[{{symbol.name}}]::
{{/if~}}
--}}
{{#if symbol.name}}
<a href="#{{symbol.ref}}">{{symbol.name}}</a>::
{{/if~}}
{{/if}}
46 changes: 0 additions & 46 deletions share/mrdocs/addons/generator/html/partials/record.html.hbs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace {{symbol.name}} = {{>name-info symbol.aliasedSymbol}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enum {{>declarator-id symbol~}}
{{#if symbol.type}} : {{>declarator symbol.type}}{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{symbol.name}}{{#if symbol.initializer}} = {{symbol.initializer}}{{~/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{#if symbol.isMutable}}mutable
{{/if~}}
{{>declarator-before symbol.type}} {{>declarator-id symbol~}}
{{#if symbol.isBitfield}} : {{symbol.bitfieldWidth}}{{/if~}}
{{#if symbol.default}} = {{symbol.default}}{{/if~}}
{{>declarator-after symbol.type}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if symbol.type~}}
friend {{>declarator symbol.type~}}
{{else if symbol.symbol~}}
{{> (concat 'signature' '/' (lookup . 'symbol.symbol.kind')) symbol=symbol.symbol isFriend=true~}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{#if symbol.template}}{{>template-head symbol.template}}
{{/if~}}
{{#if isFriend}}friend
{{/if~}}
{{#if symbol.constexprKind}}{{symbol.constexprKind}}
{{/if~}}
{{#if symbol.storageClass}}{{symbol.storageClass}}
{{/if~}}
{{#if symbol.isVirtual}}virtual
{{/if~}}
{{#if (eq symbol.class "normal")}}{{>declarator-before symbol.return}}
{{/if~}}
{{>declarator-id symbol link=symbol.template.primary}}
({{#if symbol.isExplicitObjectMemberFunction}}this {{/if}}{{#each symbol.params}}{{#unless (and @first @last)}}
{{/unless}}{{>declarator type decl-name=name~}}
{{#if default}} = {{default}}{{/if~}}
{{#unless @last}},{{/unless~}}
{{/each~}})
{{~#if symbol.isConst}} const{{/if~}}
{{#if symbol.isVolatile}} volatile{{/if~}}
{{#if symbol.refQualifier}} {{symbol.refQualifier}}{{/if~}}
{{#if symbol.exceptionSpec}} {{symbol.exceptionSpec}}{{/if~}}
{{#if (eq symbol.class "normal")}}{{>declarator-after symbol.return}}{{/if~}}
{{#if symbol.hasOverrideAttr}} override{{/if~}}
{{#if symbol.isFinal}} final{{/if~}}
{{#if symbol.isPure}} = 0{{/if~}}
{{#if symbol.isDeleted}} = delete{{/if~}}
{{#if symbol.isDefaulted}} = default{{/if}}
Loading

0 comments on commit 561f213

Please sign in to comment.