Skip to content

Commit 8693504

Browse files
committed
fix: no relative asciidoc links
see https://gitlab.com/antora/antora/-/issues/428
1 parent 833dee2 commit 8693504

File tree

13 files changed

+66
-35
lines changed

13 files changed

+66
-35
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
{{#if @root.config.multipage }}
44
{{! Multipage documentation: symbol is available to the wrapper }}
55
[#{{{symbol.anchor}}}]
6-
= {{> symbol/qualified-name symbol }}
6+
{{!
7+
This title qualified name does not include links as the Antora
8+
UI is not able to render these links in the title.
9+
10+
Breadcrumbs are included in the symbol template as an alternative.
11+
}}
12+
= {{> symbol/qualified-name symbol nolink=true }}
713
{{else}}
814
{{! Single page documentation: symbol is not available to the wrapper }}
915
= Reference
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
{{#if (starts_with href "#")}}<<{{{href}}},{{> @partial-block }}>>{{else}}xref:{{{href}}}[{{> @partial-block }}]{{/if}}
1+
{{!
2+
Do not relativize links as asciidoc does not support it.
3+
4+
https://gitlab.com/antora/antora/-/issues/428
5+
}}
6+
{{#if (starts_with href "#")~}}
7+
<<{{{href}}},{{> @partial-block }}>>
8+
{{~else if (starts_with href "/")~}}
9+
xref:{{{remove_prefix href "/"}}}[{{> @partial-block }}]
10+
{{~else if (starts_with href ".")~}}
11+
xref:{{{href}}}[{{> @partial-block }}]
12+
{{~else~}}
13+
{{{href}}}[{{> @partial-block }}]
14+
{{~/if~}}

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
{{#if symbol.doc.brief}}
2222
{{{symbol.doc.brief}}}
2323

24+
{{/if}}
25+
{{! Breadcrumbs
26+
27+
The antora breadcrumbs do not work with the multipage documentation.
28+
29+
This includes symbol/qualified-name here as an alternative for users
30+
to visit parent scopes.
31+
}}
32+
{{#if @root.config.multipage }}
33+
{{#> markup/code-block }}
34+
{{> symbol/qualified-name symbol }}
35+
{{/markup/code-block}}
2436
{{/if}}
2537
{{! Synopsis }}
2638
{{#unless (eq symbol.kind "namespace")}}
@@ -69,7 +81,7 @@
6981
{{#if symbol.doc.description}}
7082
{{#> markup/dynamic-level-h }}Description{{/markup/dynamic-level-h}}
7183

72-
{{symbol.doc.description}}
84+
{{{symbol.doc.description}}}
7385

7486
{{/if}}
7587
{{! Using symbols }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{#>markup/tr~}}
33
{{#>markup/td}}
44
{{! Member name, linked to its documentation }}
5-
{{#>markup/a href=(relativize url)}}{{#>markup/code}}{{>symbol/name . nolink=true}}{{/markup/code}}{{/markup/a}} {{>symbol/special-function-suffix .}}
5+
{{#>markup/a href=url}}{{#>markup/code}}{{>symbol/name . nolink=true}}{{/markup/code}}{{/markup/a}} {{>symbol/special-function-suffix .}}
66
{{~/markup/td}}
77
{{#>markup/td}}
88
{{#if (ne kind "overloads")~}}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{{! Render the name of the symbol. ~}}
2222
{{#if (and symbol.url (not nolink))~}}
2323
{{! Link to the symbol's documentation. ~}}
24-
{{#>markup/a href=(relativize symbol.url)}}{{name}}{{/markup/a~}}
24+
{{#>markup/a href=symbol.url}}{{name}}{{/markup/a~}}
2525
{{else~}}
2626
{{! No link, just the name. ~}}
2727
{{name~}}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{{else~}}
2525
{{#if (and link.url (not nolink))~}}
2626
{{! Symbol with URL: link to the symbol documentation ~}}
27-
{{#>markup/a href=(relativize link.url)}}{{name}}{{/markup/a~}}
27+
{{#>markup/a href=link.url}}{{name}}{{/markup/a~}}
2828
{{else~}}
2929
{{! Symbol without URL: plain text ~}}
3030
{{name~}}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{! General case: linked namespaces followed by the symbol name ~}}
2424
{{#each (reverse namespace)~}}
2525
{{#if name~}}
26-
{{>symbol/name . link=.}}::
26+
{{>symbol/name . link=. nolink=../nolink}}::
2727
{{~/if}}
2828
{{~/each}}{{>symbol/name .}}
2929
{{~else~}}
@@ -39,7 +39,7 @@
3939
{{~else~}}
4040
{{~#if symbol~}}
4141
{{! Friend symbol: use the befriended symbol ~}}
42-
{{>symbol/qualified-name symbol~}}
42+
{{>symbol/qualified-name symbol nolink=nolink ~}}
4343
{{~else~}}
4444
{{! Friend type: use the type name ~}}
4545
{{~type.name~}}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{> symbol/signature member link=member}}
2424
{{/markup/code-block}}
2525

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

2828
{{/each}}
2929
{{/if}}

share/mrdocs/addons/generator/common/partials/template/arg.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{~value~}}
2020
{{else if (eq kind "template")~}}
2121
{{! TArg is another template: render the template head ~}}
22-
{{#if (and template (not nolink))}}{{#>markup/a href=(relativize template.url)}}{{name}}{{/markup/a}}{{else~}}{{name~}}{{/if~}}
22+
{{#if (and template (not nolink))}}{{#>markup/a href=template.url}}{{name}}{{/markup/a}}{{else~}}{{name~}}{{/if~}}
2323
{{/if~}}
2424
{{~#if is-pack~}}
2525
...
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a href="{{{href}}}">{{> @partial-block }}</a>
1+
<a href="{{{relativize href}}}">{{> @partial-block }}</a>

0 commit comments

Comments
 (0)