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
8 changes: 7 additions & 1 deletion share/mrdocs/addons/generator/adoc/layouts/wrapper.adoc.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
{{#if @root.config.multipage }}
{{! Multipage documentation: symbol is available to the wrapper }}
[#{{{symbol.anchor}}}]
= {{> symbol/qualified-name symbol }}
{{!
This title qualified name does not include links as the Antora
UI is not able to render these links in the title.

Breadcrumbs are included in the symbol template as an alternative.
}}
= {{> symbol/qualified-name symbol nolink=true }}
{{else}}
{{! Single page documentation: symbol is not available to the wrapper }}
= Reference
Expand Down
15 changes: 14 additions & 1 deletion share/mrdocs/addons/generator/adoc/partials/markup/a.adoc.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{{#if (starts_with href "#")}}<<{{{href}}},{{> @partial-block }}>>{{else}}xref:{{{href}}}[{{> @partial-block }}]{{/if}}
{{!
Do not relativize links as asciidoc does not support it.

https://gitlab.com/antora/antora/-/issues/428
}}
{{#if (starts_with href "#")~}}
<<{{{href}}},{{> @partial-block }}>>
{{~else if (starts_with href "/")~}}
xref:{{{remove_prefix href "/"}}}[{{> @partial-block }}]
{{~else if (starts_with href ".")~}}
xref:{{{href}}}[{{> @partial-block }}]
{{~else~}}
{{{href}}}[{{> @partial-block }}]
{{~/if~}}
14 changes: 13 additions & 1 deletion share/mrdocs/addons/generator/adoc/partials/symbol.adoc.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
{{#if symbol.doc.brief}}
{{{symbol.doc.brief}}}

{{/if}}
{{! Breadcrumbs

The antora breadcrumbs do not work with the multipage documentation.

This includes symbol/qualified-name here as an alternative for users
to visit parent scopes.
}}
{{#if @root.config.multipage }}
{{#> markup/code-block }}
{{> symbol/qualified-name symbol }}
{{/markup/code-block}}
{{/if}}
{{! Synopsis }}
{{#unless (eq symbol.kind "namespace")}}
Expand Down Expand Up @@ -69,7 +81,7 @@
{{#if symbol.doc.description}}
{{#> markup/dynamic-level-h }}Description{{/markup/dynamic-level-h}}

{{symbol.doc.description}}
{{{symbol.doc.description}}}

{{/if}}
{{! Using symbols }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{#>markup/tr~}}
{{#>markup/td}}
{{! Member name, linked to its documentation }}
{{#>markup/a href=(relativize url)}}{{#>markup/code}}{{>symbol/name . nolink=true}}{{/markup/code}}{{/markup/a}} {{>symbol/special-function-suffix .}}
{{#>markup/a href=url}}{{#>markup/code}}{{>symbol/name . nolink=true}}{{/markup/code}}{{/markup/a}} {{>symbol/special-function-suffix .}}
{{~/markup/td}}
{{#>markup/td}}
{{#if (ne kind "overloads")~}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{! Render the name of the symbol. ~}}
{{#if (and symbol.url (not nolink))~}}
{{! Link to the symbol's documentation. ~}}
{{#>markup/a href=(relativize symbol.url)}}{{name}}{{/markup/a~}}
{{#>markup/a href=symbol.url}}{{name}}{{/markup/a~}}
{{else~}}
{{! No link, just the name. ~}}
{{name~}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{else~}}
{{#if (and link.url (not nolink))~}}
{{! Symbol with URL: link to the symbol documentation ~}}
{{#>markup/a href=(relativize link.url)}}{{name}}{{/markup/a~}}
{{#>markup/a href=link.url}}{{name}}{{/markup/a~}}
{{else~}}
{{! Symbol without URL: plain text ~}}
{{name~}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{! General case: linked namespaces followed by the symbol name ~}}
{{#each (reverse namespace)~}}
{{#if name~}}
{{>symbol/name . link=.}}::
{{>symbol/name . link=. nolink=../nolink}}::
{{~/if}}
{{~/each}}{{>symbol/name .}}
{{~else~}}
Expand All @@ -39,7 +39,7 @@
{{~else~}}
{{~#if symbol~}}
{{! Friend symbol: use the befriended symbol ~}}
{{>symbol/qualified-name symbol~}}
{{>symbol/qualified-name symbol nolink=nolink ~}}
{{~else~}}
{{! Friend type: use the type name ~}}
{{~type.name~}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{> 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}}
{{#> markup/span class="small" }}{{#> markup/a href=member.url }}{{#>markup/em }}» more...{{/markup/em}}{{/markup/a}}{{/markup/span}}

{{/each}}
{{/if}}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{~value~}}
{{else if (eq kind "template")~}}
{{! TArg is another template: render the template head ~}}
{{#if (and template (not nolink))}}{{#>markup/a href=(relativize template.url)}}{{name}}{{/markup/a}}{{else~}}{{name~}}{{/if~}}
{{#if (and template (not nolink))}}{{#>markup/a href=template.url}}{{name}}{{/markup/a}}{{else~}}{{name~}}{{/if~}}
{{/if~}}
{{~#if is-pack~}}
...
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{{href}}}">{{> @partial-block }}</a>
<a href="{{{relativize href}}}">{{> @partial-block }}</a>
4 changes: 2 additions & 2 deletions test-files/golden-tests/brief-1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ f6();

=== Description

pass:[

many lined
*bold*
what will
happen?
]




Expand Down
24 changes: 12 additions & 12 deletions test-files/golden-tests/enum.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ e1 brief.

=== Description

pass:[

E0 description.
]


[#E0-e0]
== <<#E0,E0>>::e0
Expand All @@ -78,9 +78,9 @@ e0 = 1

=== Description

pass:[

e0 description.
]


[#E0-e1]
== <<#E0,E0>>::e1
Expand All @@ -99,9 +99,9 @@ e1

=== Description

pass:[

e1 description.
]


[#E1]
== E1
Expand Down Expand Up @@ -175,9 +175,9 @@ e5 brief.

=== Description

pass:[

E2 description.
]


[#E2-e4]
== <<#E2,E2>>::e4
Expand All @@ -196,9 +196,9 @@ e4

=== Description

pass:[

e4 description.
]


[#E2-e5]
== <<#E2,E2>>::e5
Expand All @@ -217,9 +217,9 @@ e5

=== Description

pass:[

e5 description.
]


[#E3]
== E3
Expand Down
20 changes: 10 additions & 10 deletions test-files/golden-tests/ref.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ f1();

=== Description

pass:[

See
xref:#f0[::f0]
]


[#A-B]
== <<#A,A>>::B
Expand Down Expand Up @@ -145,13 +145,13 @@ struct B;

=== Description

pass:[

See
xref:#A-f1[A::f1]

See
xref:#A-f1[::A::f1]
]


[#A-B-f2]
== <<#A,A>>::<<#A-B,B>>::f2
Expand Down Expand Up @@ -286,13 +286,13 @@ struct E;

=== Description

pass:[

See
xref:#A-D-f4[f4]

See
xref:#A-C-f4[C::f4]
]


[#f5]
== f5
Expand All @@ -313,10 +313,10 @@ f5();

=== Description

pass:[

See
xref:#A-f1[::A::f1]
]


[#F]
== F
Expand Down Expand Up @@ -942,7 +942,7 @@ f6();

=== Description

pass:[

See
xref:#F-operator_comma[F::operator,]

Expand Down Expand Up @@ -1056,7 +1056,7 @@ xref:#F-operator_not[F::operator!]

See
xref:#F-operator_not_eq[F::operator!&equals;]
]




Expand Down
Loading