Skip to content

Commit c194416

Browse files
docs(generators): template partials
1 parent af97cfe commit c194416

File tree

104 files changed

+734
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+734
-411
lines changed

docs/modules/ROOT/pages/generators.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,17 @@ Each symbol goes through a main layout template in the `<addons>/generator/<gene
8989
This template is a simple entry point that renders the partial relative to the symbol kind.
9090

9191
The partials are located in the `<addons>/generator/<generator>/partials` directory.
92-
It contains the following subdirectories:
92+
It typically contains the following files and subdirectories:
9393

94-
* `symbols`: Contains one partial for each symbol kind.
95-
The fields of each symbol object are described in the <<symbol-fields,Symbol Object>> section.
96-
* `signature`: Contains one partial for each symbol kind that renders the signature of the symbol as if declared in {cpp}.
97-
* `types`: partials for rendering other types of objects in a canonical form.
98-
Please refer to the <<dom_reference,Document Object Model Reference>> for more information on each type of object.
94+
* `symbol`: A generic partial for rendering symbols.
95+
* `location`: Partials for rendering <<location-fields,location objects>>.
96+
* `symbol`: Partials for rendering <<symbol-fields,Symbol Objects>>.
97+
* `template`: Partials for rendering <<template-info-fields,Template Info Objects>>.
98+
* `type`: Partials for rendering <<type-info-fields,Type Info Objects>>.
9999
* `markup`: partials for rendering markup elements such as lists, tables, and code blocks, in the output format.
100100

101+
Please refer to the <<dom_reference,Document Object Model Reference>> for more information on each type of object.
102+
101103
Partials common to all generators are available in the `<addons>/generator/common/partials` directory.
102104
The common partials are loaded before the generator-specific partials, which can override any common partials.
103105

share/mrdocs/addons/generator/adoc/layouts/wrapper.adoc.hbs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{{! The wrapper for single page documentation or symbols in a multipage documentation }}
2-
{{#unless @root.config.multipage }}
2+
{{! Title }}
3+
{{#if @root.config.multipage }}
4+
{{! Multipage documentation: symbol is available to the wrapper }}
5+
[#{{{symbol.anchor}}}]
6+
= {{> symbol/qualified-name symbol }}
7+
{{else}}
8+
{{! Single page documentation: symbol is not available to the wrapper }}
39
= Reference
10+
{{/if}}
411
:mrdocs:
5-
{{/unless}}
612

713
{{! Content generated with index.hbs }}
814
{{{contents}}}

share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
{{#unless @root.config.multipage }}
2+
{{! Single page documentation: symbol is not available to the wrapper but it's available here }}
3+
{{! Include the symbol title at a higher level }}
14
[#{{{symbol.anchor}}}]
2-
={{#unless @root.config.multipage}}={{/unless}} {{#unless (eq symbol.kind "friend")}}{{#if symbol.name}}{{>types/nested-name-specifier symbol=symbol.parent includeNamespace=true}}{{symbol.name}}{{else}}{{#if symbol.parent}}Unnamed{{else}}Global{{/if}} {{or symbol.tag symbol.kind}}{{/if}}{{else}}{{#if symbol.symbol.name}}{{>types/nested-name-specifier symbol=symbol.symbol.parent includeNamespace=true}}{{symbol.symbol.name}}{{else}}{{symbol.type.name}}{{/if}}{{/unless}}
5+
== {{> symbol/qualified-name symbol }}
6+
{{/unless}}
37

48
{{! Brief }}
59
{{#if symbol.doc.brief}}
@@ -10,20 +14,20 @@
1014
{{#unless (contains (arr "namespace") symbol.kind)}}
1115
=={{#unless @root.config.multipage}}={{/unless}} Synopsis
1216

13-
{{>types/source dcl=(primary_location symbol)}}
17+
{{>location/source dcl=(primary_location symbol)}}
1418

1519
{{#if (ne symbol.kind "overloads")}}
1620
[source,cpp,subs="verbatim,macros,-callouts"]
1721
----
18-
{{> signature }}
22+
{{> symbol/signature symbol }}
1923
2024
----
2125
2226
{{else}}
2327
{{#each symbol.members as | member |}}
2428
[source,cpp,subs="verbatim,macros,-callouts"]
2529
----
26-
{{> signature symbol=member link=member}}
30+
{{> symbol/signature member link=member}}
2731
2832
----
2933
@@ -34,15 +38,15 @@
3438
{{#if symbol.interface}}
3539
{{#if (eq symbol.kind "record")}}
3640
{{#with symbol.interface}}
37-
{{>types/tranche tranche=public label="" is-namespace=false}}
41+
{{>symbol/tranche tranche=public label="" is-namespace=false}}
3842
39-
{{>types/tranche tranche=protected label="Protected" is-namespace=false}}
43+
{{>symbol/tranche tranche=protected label="Protected" is-namespace=false}}
4044
41-
{{>types/tranche tranche=private label="Private" is-namespace=false}}
45+
{{>symbol/tranche tranche=private label="Private" is-namespace=false}}
4246
4347
{{/with}}
4448
{{else}}
45-
{{>types/tranche tranche=symbol.interface label="" is-namespace=true}}
49+
{{>symbol/tranche tranche=symbol.interface label="" is-namespace=true}}
4650
4751
{{/if}}
4852
{{else if symbol.members}}
@@ -54,15 +58,15 @@
5458
|===
5559
|Name |Description
5660
{{#each symbol.members}}
57-
|xref:{{{anchor}}}[`pass:v[{{>types/declarator-id . nolink=true}}]`] | {{~doc.brief}}
61+
|xref:{{{anchor}}}[`pass:v[{{>symbol/name . nolink=true}}]`] | {{~doc.brief}}
5862
{{/each}}
5963
|===
6064
6165
{{/if}}
6266
{{/if}}
6367
{{! Using directives }}
6468
{{#if symbol.usingDirectives}}
65-
{{>types/info-list members=symbol.usingDirectives title="Using Directives"}}
69+
{{>symbol/members-table members=symbol.usingDirectives title="Using Directives"}}
6670
6771
{{/if}}
6872
{{! Description }}
@@ -161,7 +165,7 @@
161165
=={{#unless @root.config.multipage}}={{/unless}} Parameters
162166
163167
|===
164-
| Name | Description {{! TODO: | Type? }}
168+
| Name | Description
165169
166170
{{#each symbol.doc.params}}
167171
| *{{name}}*
@@ -176,7 +180,7 @@
176180
=={{#unless @root.config.multipage}}={{/unless}} Parameters
177181
178182
|===
179-
| Name | Description {{! TODO: | Type? }}
183+
| Name | Description
180184
181185
{{#each allParams as |param|}}
182186
| *{{param.name}}*
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{!--
2+
Renders where the symbol is declared with a link
3+
4+
If the `base-url` config option is defined, the file name will be
5+
linked to the source file.
6+
7+
Expected Context: {Location Object}
8+
9+
Example:
10+
{{> location/source symbol.loc.def }}
11+
12+
--}}
13+
Declared in {{#>markup/code~}}
14+
{{ str "<" }}{{#unless (and @root.config.base-url (eq dcl.kind "source"))~}}
15+
{{dcl.file}}
16+
{{~else~}}
17+
{{#>markup/a href=(concat @root.config.base-url dcl.file '#L' dcl.line)}}{{dcl.file}}{{/markup/a}}
18+
{{~/unless~}}{{ str ">" }}
19+
{{~/markup/code}}

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

Lines changed: 0 additions & 1 deletion
This file was deleted.

share/mrdocs/addons/generator/common/partials/signature/alias.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

share/mrdocs/addons/generator/common/partials/signature/concept.hbs

Lines changed: 0 additions & 3 deletions
This file was deleted.

share/mrdocs/addons/generator/common/partials/signature/enum.hbs

Lines changed: 0 additions & 2 deletions
This file was deleted.

share/mrdocs/addons/generator/common/partials/signature/enumerator.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

share/mrdocs/addons/generator/common/partials/signature/field.hbs

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)