Skip to content

Commit a622c3c

Browse files
committed
fix: HTML golden tests
1 parent 0cd3a50 commit a622c3c

File tree

22 files changed

+50
-54
lines changed

22 files changed

+50
-54
lines changed

include/mrdocs/Metadata/Symbol/Friend.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct FriendInfo final
4848
BOOST_DESCRIBE_STRUCT(
4949
FriendInfo,
5050
(),
51-
(id, Type)
51+
(Type) // `id` intentionally omitted
5252
)
5353

5454
MRDOCS_DECL
@@ -77,6 +77,7 @@ tag_invoke(
7777
io.defer("name", [&I, domCorpus]{
7878
return dom::ValueFrom(I.id, domCorpus).get("name");
7979
});
80+
io.map("symbol", I.id);
8081
}
8182
else if (I.Type)
8283
{

include/mrdocs/Metadata/Symbol/Function.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct FunctionSymbol final
5050
Optional<TemplateInfo> Template;
5151

5252
/// The class of function this is
53-
FunctionClass Class = FunctionClass::Normal;
53+
FunctionClass FuncClass = FunctionClass::Normal;
5454

5555
/** Exception specification for the function.
5656
*/
@@ -148,7 +148,7 @@ struct FunctionSymbol final
148148
BOOST_DESCRIBE_STRUCT(
149149
FunctionSymbol,
150150
(SymbolCommonBase<SymbolKind::Function>),
151-
(ReturnType, Params, Template, Class, Noexcept, Requires,
151+
(ReturnType, Params, Template, FuncClass, Noexcept, Requires,
152152
IsVariadic, IsDefaulted, IsExplicitlyDefaulted, IsDeleted,
153153
IsDeletedAsWritten, IsNoReturn, HasOverrideAttr, HasTrailingReturn,
154154
IsNodiscard, IsExplicitObjectMemberFunction, Constexpr,

include/mrdocs/Metadata/Symbol/Overloads.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct OverloadsSymbol final
2626
: SymbolCommonBase<SymbolKind::Overloads>
2727
{
2828
/// The class of the functions.
29-
FunctionClass Class = FunctionClass::Normal;
29+
FunctionClass FuncClass = FunctionClass::Normal;
3030

3131
/// The overloaded operator, if any.
3232
OperatorKind OverloadedOperator = OperatorKind::None;
@@ -64,7 +64,7 @@ struct OverloadsSymbol final
6464
BOOST_DESCRIBE_STRUCT(
6565
OverloadsSymbol,
6666
(SymbolCommonBase<SymbolKind::Overloads>),
67-
(Class, OverloadedOperator, Members) // ReturnType intentionally omitted.
67+
(FuncClass, OverloadedOperator, Members) // ReturnType intentionally omitted.
6868
)
6969

7070
/** Merge overload sets, preserving ordering in `Members`.

include/mrdocs/Metadata/Symbol/SymbolBase.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ struct MRDOCS_VISIBLE Symbol {
180180
BOOST_DESCRIBE_STRUCT(
181181
Symbol,
182182
(),
183-
(Name, Loc, Kind, id, Access, Extraction, Parent)
183+
(Name, Loc, Kind, id, Access,
184+
Extraction, IsCopyFromInherited, Parent) // `doc` intentionally omitted.
184185
)
185186

186187
//------------------------------------------------
@@ -263,6 +264,7 @@ tag_invoke(
263264
{
264265
MRDOCS_ASSERT(domCorpus);
265266
mapWithDescribe(io, I, domCorpus);
267+
io.map("class", std::string("symbol"));
266268
io.map("isRegular", I.Extraction == ExtractionMode::Regular);
267269
io.map("isSeeBelow", I.Extraction == ExtractionMode::SeeBelow);
268270
io.map("isImplementationDefined", I.Extraction == ExtractionMode::ImplementationDefined);

include/mrdocs/Metadata/Symbol/SymbolDescribeMapper.hpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ shouldMapValue(T const& value)
6161
}
6262
}
6363

64-
/** Convert member name to a DOM-friendly format.
64+
/** Convert a member name to the corresponding DOM name.
6565
6666
E.g.:
6767
- IsVariadic -> isVariadic
@@ -75,10 +75,6 @@ normalizeMemberName(std::string_view name)
7575
{
7676
return "constexprKind";
7777
}
78-
else if (name == "Class")
79-
{
80-
return "functionClass";
81-
}
8278
else if (name == "ReturnType")
8379
{
8480
return "return";
@@ -87,26 +83,23 @@ normalizeMemberName(std::string_view name)
8783
{
8884
return "exceptionSpec";
8985
}
90-
else if (name == "id")
91-
{
92-
return "symbol";
93-
}
9486
else if (name == "Explicit")
9587
{
9688
return "explicitSpec";
9789
}
98-
else if (name == "Symbol")
99-
{
100-
return "class";
101-
}
10290
else if (name == "KeyKind")
10391
{
10492
return "tag";
10593
}
94+
else if (name == "Class")
95+
{
96+
return "usingClass";
97+
}
10698
else
10799
{
108100
std::string result(name);
109-
if (!result.empty()) {
101+
if (!result.empty())
102+
{
110103
result.front() = std::tolower(result.front(), std::locale::classic());
111104
}
112105
return result;
@@ -139,7 +132,7 @@ mapAllDescribedMembers(
139132

140133
}
141134

142-
/** Automatically map all Boost.Describe'd members of a type to DOM.
135+
/** Automatically map all Boost.Describe'd members of a type to the DOM.
143136
144137
This replaces the manual `tag_invoke()` implementations with a single
145138
call that handles all member mappings via reflection.

share/mrdocs/addons/generator/common/partials/symbol/name-text.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 (eq kind "function") (eq functionClass "conversion"))~}}
14+
{{~#if (and (eq kind "function") (eq funcClass "conversion"))~}}
1515
{{! Conversion operator: "operator" and the type declarator ~}}
1616
operator {{>type/declarator-text return ~}}
1717
{{~else if (eq kind "guide")~}}

share/mrdocs/addons/generator/common/partials/symbol/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 (eq kind "function") (eq functionClass "conversion"))~}}
14+
{{~#if (and (eq kind "function") (eq funcClass "conversion"))~}}
1515
{{! Conversion operator: "operator" and the type declarator ~}}
1616
operator {{>type/declarator return ~}}
1717
{{~else if (eq kind "guide")~}}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{~#if (and parent parent.parent)~}}
2424
{{~> symbol/qualified-name-title parent is-qualified-name-parent=true ~}}{{#if parent.name }}::{{/if}}
2525
{{~/if~}}
26-
{{~#if (and (eq kind "function") (eq functionClass "conversion"))~}}
26+
{{~#if (and (eq kind "function") (eq funcClass "conversion"))~}}
2727
{{~> symbol/name . ~}}
2828
{{~else if is-qualified-name-parent ~}}
2929
{{!~ If this is a parent, we only print it if it really has a name ~}}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
{{/if~}}
1313
{{#if explicitSpec}}{{explicitSpec}}
1414
{{/if~}}
15-
{{#if (eq functionClass "normal")}}{{>type/declarator-prefix return}}
15+
{{#if (eq funcClass "normal")}}{{>type/declarator-prefix return}}
1616
{{/if~}}
1717
{{~#if force-link~}}
1818
{{>symbol/name symbol }}
19-
{{~else if (eq functionClass "conversion")~}}
19+
{{~else if (eq funcClass "conversion")~}}
2020
{{>symbol/name symbol }}
2121
{{~else if (contains (arr "explicit" "partial") template.kind)~}}
2222
{{>symbol/name template.primary ~}}{{>template/args-text args=template.args ~}}
@@ -32,7 +32,7 @@
3232
{{#if isVolatile}} volatile{{/if~}}
3333
{{#if refQualifier}} {{refQualifier}}{{/if~}}
3434
{{#if exceptionSpec}} {{exceptionSpec}}{{/if~}}
35-
{{#if (eq functionClass "normal")}}{{>type/declarator-suffix return}}{{/if~}}
35+
{{#if (eq funcClass "normal")}}{{>type/declarator-suffix return}}{{/if~}}
3636
{{#if requires}}
3737

3838
requires {{requires}}{{/if~}}

share/mrdocs/addons/generator/common/partials/symbol/special-function-suffix.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
{{#if (eq kind "overloads")~}}
1616
{{>symbol/special-function-suffix (front members)}}
1717
{{~else if (eq kind "function")~}}
18-
{{#if (eq functionClass "constructor")}}
18+
{{#if (eq funcClass "constructor")}}
1919
{{#>markup/span class="small"}}[constructor]{{/markup/span}}
20-
{{~else if (eq functionClass "destructor")~}}
20+
{{~else if (eq funcClass "destructor")~}}
2121
{{#>markup/span class="small"}}[destructor]{{/markup/span}}
2222
{{~/if~}}
2323
{{~#if isVirtual~}}

0 commit comments

Comments
 (0)