Skip to content

Commit 37b782e

Browse files
committed
no unused template linebreaks
#improvement
1 parent 2e64221 commit 37b782e

File tree

330 files changed

+4232
-13552
lines changed

Some content is hidden

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

330 files changed

+4232
-13552
lines changed

include/mrdocs/Metadata/Javadoc.hpp

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,70 +1205,14 @@ tag_invoke(
12051205
v = dom::LazyObject(I, domCorpus);
12061206
}
12071207

1208-
/** A @details paragraph
1209-
*/
1210-
struct Details final : Paragraph
1211-
{
1212-
static constexpr auto static_kind = NodeKind::details;
1213-
1214-
Details()
1215-
: Paragraph(NodeKind::details)
1216-
{}
1217-
1218-
auto operator<=>(Details const&) const = default;
1219-
1220-
bool
1221-
operator==(Details const&) const noexcept = default;
1222-
1223-
bool equals(Node const& other) const noexcept override
1224-
{
1225-
auto* p = dynamic_cast<Details const*>(&other);
1226-
if (!p)
1227-
{
1228-
return false;
1229-
}
1230-
if (this == &other)
1231-
{
1232-
return true;
1233-
}
1234-
return *this == *p;
1235-
}
1236-
};
1237-
1238-
/** Map the @ref Details to a @ref dom::Object.
1239-
*/
1240-
template <class IO>
1241-
void
1242-
tag_invoke(
1243-
dom::LazyObjectMapTag t,
1244-
IO& io,
1245-
Details const& I,
1246-
DomCorpus const* domCorpus)
1247-
{
1248-
tag_invoke(t, io, dynamic_cast<Paragraph const&>(I), domCorpus);
1249-
}
1250-
1251-
/** Return the @ref Details as a @ref dom::Value object.
1252-
*/
1253-
inline
1254-
void
1255-
tag_invoke(
1256-
dom::ValueFromTag,
1257-
dom::Value& v,
1258-
Details const& I,
1259-
DomCorpus const* domCorpus)
1260-
{
1261-
v = dom::LazyObject(I, domCorpus);
1262-
}
1263-
12641208
/** A @see paragraph
12651209
*/
12661210
struct See final : Paragraph
12671211
{
12681212
static constexpr auto static_kind = NodeKind::see;
12691213

12701214
See()
1271-
: Paragraph(NodeKind::see)
1215+
: Paragraph(static_kind)
12721216
{
12731217
}
12741218

@@ -1682,8 +1626,6 @@ visit(
16821626
return visitor.template visit<TParam>();
16831627
case NodeKind::throws:
16841628
return visitor.template visit<Throws>();
1685-
case NodeKind::details:
1686-
return visitor.template visit<Details>();
16871629
case NodeKind::see:
16881630
return visitor.template visit<See>();
16891631
case NodeKind::precondition:
@@ -1901,7 +1843,7 @@ tag_invoke(
19011843
Javadoc const& I,
19021844
DomCorpus const* domCorpus)
19031845
{
1904-
io.defer("details", [&I, domCorpus] {
1846+
io.defer("description", [&I, domCorpus] {
19051847
return dom::LazyArray(I.blocks, domCorpus);
19061848
});
19071849
if (I.brief)
Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,27 @@
1-
{{! The wrapper for single page documentation or symbols in a multipage documentation }}
2-
{{! Title }}
3-
{{#if @root.config.multipage }}
4-
{{! Multipage documentation: symbol is available to the wrapper }}
5-
[#{{{symbol.anchor}}}]
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 }}
13-
{{!
14-
Antora does not support relative links to pages in
15-
parent directories. Therefore, unlike in HTML templates,
16-
links are not relativized.
17-
18-
However, while Antora interprets xref as relative
19-
to the root of the module, these xref are
20-
interpreted as relative to the current directory
21-
because it has no concept of modules. This means
22-
links would be broken with either Antora or Asciidoc.
1+
{{!--
2+
Wraps the documentation for a symbol (multipage) or all symbols (single page).
233
24-
Even more, Antora uses the same rule as Asciidoc
25-
for breadcrumbs and the page title, where links
26-
would also be broken.
4+
The {{{contents}}} tag can be used to include the content of the symbol or symbols
5+
to be wrapped by this template.
276
28-
The solution is to set the relfileprefix attribute,
29-
which includes the relative location of the root
30-
directory and makes all links relative to it.
7+
The multipage mode, the wrapper also receives the symbol object to render the title
8+
and the breadcrumbs.
319
32-
This relfileprefix affects Asciidoc links, the
33-
Antora title, and the Antora breadcrumbs.
10+
In the single page mode, the symbol object is not available to the wrapper, but it
11+
is available to the symbol template. In this case, the title is simply "Reference".
3412
35-
See https://docs.asciidoctor.org/asciidoc/latest/macros/inter-document-xref/#mapping-references-to-a-different-structure
36-
}}
13+
As Antora does not support relative links to pages in parent directories, the
14+
relfileprefix attribute is set to make all links relative to the root directory.
15+
This is only necessary in multipage mode.
16+
--}}
17+
{{#if @root.config.multipage }}
18+
[#{{{symbol.anchor}}}]
19+
= {{> symbol/qualified-name symbol }}
3720
:relfileprefix: {{{ repeat "../" (count (remove_prefix symbol.url '/') '/') }}}
3821
{{else}}
39-
{{! Single page documentation: symbol is not available to the wrapper }}
4022
= Reference
4123
{{/if}}
4224
:mrdocs:
4325

44-
{{! Content generated with index.hbs }}
4526
{{{contents}}}
46-
47-
[.small]#Created with https://www.mrdocs.com[MrDocs]#
27+
{{#>markup/span class="small"}}Created with https://www.mrdocs.com[MrDocs]{{/markup/span}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{>javadoc/inline-brief}}
2+
3+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#each .}}{{>javadoc/any-block .}}{{/each}}

share/mrdocs/addons/generator/adoc/partials/javadoc/detail-blocks.adoc.hbs

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
2-
=== {{string}}
3-
1+
{{#> markup/dynamic-level-h level=1 }}{{string}}{{/markup/dynamic-level-h}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
{{!--
2+
Renders a heading element with an optional ID attribute.
3+
4+
This partial generates a heading element (`h1`, `h2`, etc.) based on the provided level.
5+
If an ID is provided, it will be included as an anchor for the heading.
6+
7+
Parameters:
8+
- partial block: The content to be rendered inside the heading element.
9+
- level: The level of the heading element (1, 2, etc.).
10+
- id: An optional ID attribute for the heading element.
11+
12+
Example:
13+
{{> markup/h level=2 id="section-id" }}Section Title{{/markup/h}}
14+
15+
See: https://mrdocs.com/docs/mrdocs/develop/generators.html#dom_reference
16+
--}}
117
{{#if id}}[#{{{id}}}]
218
{{/if}}
319
={{{select level (repeat "=" level) (select @root.config.multipage "==" "=")}}} {{> @partial-block }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| {{> @partial-block }}
1+
| {{> @partial-block }}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
{{> @partial-block }}
2-
1+
{{> @partial-block }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{> @partial-block }}
1+
{{> @partial-block }}

0 commit comments

Comments
 (0)