Skip to content

Commit 840537d

Browse files
committed
explicit partials for symbols as text
#perf
1 parent b8dacc3 commit 840537d

31 files changed

+239
-88
lines changed

include/mrdocs/Support/Handlebars.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,17 @@ MRDOCS_DECL
12211221
void
12221222
registerContainerHelpers(Handlebars& hbs);
12231223

1224+
/** Register type helpers into a Handlebars instance
1225+
1226+
This function registers a number of common helpers that operate on
1227+
types, such as identity, type checking, and type conversion.
1228+
1229+
@param hbs The Handlebars instance to register the helpers into
1230+
*/
1231+
MRDOCS_DECL
1232+
void
1233+
registerTypeHelpers(Handlebars& hbs);
1234+
12241235
/** "and" helper function
12251236
*
12261237
* The "and" helper returns true if all of the values are truthy.

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@
6363
| Name
6464
| Description
6565
{{#each (filter_by symbol.constants "isRegular" "isSeeBelow")}}
66-
{{#if (ne kind "enum-constant")}}
67-
|xref:{{{anchor}}}[`{{>symbol/name . nolink=true}}`]
68-
{{else}}
69-
|`{{>symbol/name . nolink=true}}`
70-
{{/if}}
66+
|`{{>symbol/name-text .}}`
7167
|{{> javadoc/inline-brief doc.brief }}
7268
{{/each}}
7369
|===
@@ -121,9 +117,9 @@
121117
| Description
122118
{{#each symbol.derived}}
123119
| {{#if url~}}
124-
{{#>markup/a href=url}}{{#>markup/code}}{{> symbol/name-info . nolink=true}}{{/markup/code}}{{/markup/a}}
120+
{{#>markup/a href=url}}{{#>markup/code}}{{> type/name-info-text . }}{{/markup/code}}{{/markup/a}}
125121
{{else~}}
126-
{{> symbol/name-info . nolink=true}}
122+
{{> type/name-info-text . }}
127123
{{/if}}
128124
| {{> javadoc/inline-brief doc.brief }}
129125
{{/each}}

share/mrdocs/addons/generator/common/partials/symbol/detail/members-table-row.hbs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
{{#>markup/tr}}
33
{{#>markup/td~}}
44
{{~#if isName~}}
5+
{{!~ The first row is a name-info ~}}
56
{{~#if symbol.url~}}
6-
{{~#>markup/a href=symbol.url}}{{#>markup/code}}{{> symbol/name-info . nolink=true}}{{/markup/code}}{{/markup/a~}}
7+
{{~#>markup/a href=symbol.url}}{{#>markup/code}}{{> type/name-info-text . }}{{/markup/code}}{{/markup/a~}}
78
{{~else~}}
8-
{{~> symbol/name-info . nolink=true~}}
9+
{{~> type/name-info-text . ~}}
910
{{~/if~}}
1011
{{~else~}}
12+
{{!~ The first row is a name-info ~}}
1113
{{~#>markup/a href=url}}{{#>markup/code}}{{>symbol/name-text .}}{{/markup/code}}{{/markup/a}} {{>symbol/special-function-suffix .~}}
1214
{{~/if~}}
1315
{{~/markup/td}}

share/mrdocs/addons/generator/common/partials/symbol/name-text.hbs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,17 @@
66
77
Expected Context: {Symbol Object}
88
9-
Optional parameters:
10-
nolink: If true, types and symbols will not be linked.
11-
link: Symbol that should be linked to, regardless of the original symbol.
12-
139
Example:
1410
{{> declarator symbol }}
1511
1612
See: https://mrdocs.com/docs/mrdocs/develop/generators.html#dom_reference
1713
--}}
1814
{{~#if (and (eq kind "function") (eq functionClass "conversion"))~}}
1915
{{! Conversion operator: "operator" and the type declarator ~}}
20-
operator {{>type/declarator return nolink=true~}}
16+
operator {{>type/declarator-text return ~}}
2117
{{~else if (eq kind "guide")~}}
2218
{{! Deduction guide: "deduced" type declarator ~}}
23-
{{>type/declarator deduced nolink=true~}}
19+
{{>type/declarator-text deduced ~}}
2420
{{~else~}}
2521
{{! Symbol with URL: link to the symbol documentation ~}}
2622
{{~#if name~}}
@@ -32,6 +28,6 @@
3228
{{~/if~}}
3329
{{~#if (contains (arr "explicit" "partial") template.kind)~}}
3430
{{! Explicit or partial template: render the template arguments ~}}
35-
{{>template/args args=template.args nolink=true~}}
31+
{{>template/args-text args=template.args ~}}
3632
{{~/if~}}
3733
{{~/if~}}

share/mrdocs/addons/generator/common/partials/symbol/name.hbs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@
66
77
Expected Context: {Symbol Object}
88
9-
Optional parameters:
10-
nolink: If true, types and symbols will not be linked.
11-
129
Example:
1310
{{> declarator symbol }}
1411
1512
See: https://mrdocs.com/docs/mrdocs/develop/generators.html#dom_reference
1613
--}}
1714
{{~#if (and (eq kind "function") (eq functionClass "conversion"))~}}
1815
{{! Conversion operator: "operator" and the type declarator ~}}
19-
operator {{>type/declarator return nolink=false~}}
16+
operator {{>type/declarator return ~}}
2017
{{~else if (eq kind "guide")~}}
2118
{{! Deduction guide: "deduced" type declarator ~}}
22-
{{>type/declarator deduced nolink=false~}}
23-
{{~else if (and url (not nolink))~}}
19+
{{>type/declarator deduced ~}}
20+
{{~else if url~}}
2421
{{#>markup/a href=url}}{{>symbol/name-text}}{{/markup/a~}}
2522
{{~else~}}
2623
{{~>symbol/name-text~}}

share/mrdocs/addons/generator/common/partials/symbol/qualified-name-title.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
{{~> symbol/name . ~}}
3232
{{~/if~}}
3333
{{~else if (eq kind "guide")~}}
34-
{{>type/declarator deduced nolink=false~}}
34+
{{>type/declarator deduced ~}}
3535
{{~else if (contains (arr "explicit" "partial") template.kind)~}}
3636
{{!~ If the last part is a template specialization, we include links to primary template and the arguments. ~}}
3737
{{!~ If the primary template wasn't correctly extracted for some reason, we just print the name as usual. ~}}
38-
{{#if template.primary }}{{~>symbol/name template.primary ~}}{{else}}{{ name }}{{/if}}{{>template/args args=template.args nolink=false~}}
38+
{{#if template.primary }}{{~>symbol/name template.primary ~}}{{else}}{{ name }}{{/if}}{{>template/args args=template.args ~}}
3939
{{~else~}}
4040
{{~> symbol/name-text . ~}}
4141
{{~/if~}}

share/mrdocs/addons/generator/common/partials/symbol/qualified-name.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
See: https://mrdocs.com/docs/mrdocs/develop/generators.html#dom_reference
1313
--}}
14-
{{~#if (and url (not nolink))~}}
14+
{{~#if url~}}
1515
{{#>markup/a href=url}}{{>symbol/qualified-name-text}}{{/markup/a~}}
1616
{{~else~}}
1717
{{~>symbol/qualified-name-text~}}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
1212
See: https://mrdocs.com/docs/mrdocs/develop/generators.html#dom_reference
1313
--}}
14-
{{> (concat 'symbol/signature/' kind) nolink=nolink }}
14+
{{> (concat 'symbol/signature/' kind) }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{~else if (eq functionClass "conversion")~}}
2020
{{>symbol/name symbol }}
2121
{{~else if (contains (arr "explicit" "partial") template.kind)~}}
22-
{{>symbol/name template.primary ~}}{{>template/args args=template.args nolink=true~}}
22+
{{>symbol/name template.primary ~}}{{>template/args-text args=template.args ~}}
2323
{{~else~}}
2424
{{>symbol/name-text symbol }}
2525
{{~/if~}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
namespace {{ name }} = {{> symbol/name-info aliasedSymbol }};
1+
namespace {{ name }} = {{> type/name-info aliasedSymbol }};

0 commit comments

Comments
 (0)