Skip to content

Commit

Permalink
Fix position of data member name anchor
Browse files Browse the repository at this point in the history
It should be on the template<> not below it.
  • Loading branch information
danakj committed Sep 7, 2023
1 parent 5e0bd4f commit 052679b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions subdoc/gen_tests/struct-complex/S.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@
</div>
<div class="section-items">
<div class="section-item">
<div class="item-name member-signature"><span class="static">static</span> bool <a class="field-name" name="field.static_bool_member" href="S.html#field.static_bool_member">static_bool_member</a></div>
<div class="item-name member-signature"><a name="field.static_bool_member"></a><span class="static">static</span> bool <a class="field-name" href="S.html#field.static_bool_member">static_bool_member</a></div>
<div class="description long">
<p>Comment headline static_bool_member</p>

</div>
</div>
<div class="section-item">
<div class="item-name member-signature"><span class="static">static</span> <span class="volatile">volatile</span> <a class="type-name" href="OtherType.html" title="OtherType">OtherType</a> <a class="field-name" name="field.static_type_member" href="S.html#field.static_type_member">static_type_member</a></div>
<div class="item-name member-signature"><a name="field.static_type_member"></a><span class="static">static</span> <span class="volatile">volatile</span> <a class="type-name" href="OtherType.html" title="OtherType">OtherType</a> <a class="field-name" href="S.html#field.static_type_member">static_type_member</a></div>
<div class="description long">
<p>Comment headline static_type_member</p>

Expand Down Expand Up @@ -196,14 +196,14 @@
</div>
<div class="section-items">
<div class="section-item">
<div class="item-name member-signature">bool <a class="field-name" name="field.bool_field" href="S.html#field.bool_field">bool_field</a></div>
<div class="item-name member-signature"><a name="field.bool_field"></a>bool <a class="field-name" href="S.html#field.bool_field">bool_field</a></div>
<div class="description long">
<p>Comment headline bool_field</p>

</div>
</div>
<div class="section-item">
<div class="item-name member-signature"><span class="const">const</span> <a class="type-name" href="OtherType.html" title="OtherType">OtherType</a> <a class="field-name" name="field.type_field" href="S.html#field.type_field">type_field</a></div>
<div class="item-name member-signature"><a name="field.type_field"></a><span class="const">const</span> <a class="type-name" href="OtherType.html" title="OtherType">OtherType</a> <a class="field-name" href="S.html#field.type_field">type_field</a></div>
<div class="description long">
<p>Comment headline type_field</p>

Expand Down
4 changes: 2 additions & 2 deletions subdoc/gen_tests/templates/TemplateMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
</div>
<div class="section-items">
<div class="section-item">
<div class="item-name member-signature"><div class="template">template &lt;class U&gt;</div><span class="static">static</span> U <a class="field-name" name="field.member" href="TemplateMethods.html#field.member">member</a></div>
<div class="item-name member-signature"><a name="field.member"></a><div class="template">template &lt;class U&gt;</div><span class="static">static</span> U <a class="field-name" href="TemplateMethods.html#field.member">member</a></div>
<div class="description long">
</div>
</div>
Expand Down Expand Up @@ -212,7 +212,7 @@
</div>
<div class="section-items">
<div class="section-item">
<div class="item-name member-signature"><a class="type-name" href="S.html" title="S">S</a>&lt;<a class="type-name" href="S.html" title="S">S</a>&lt;int&gt;&gt; <a class="field-name" name="field.template_field" href="TemplateMethods.html#field.template_field">template_field</a></div>
<div class="item-name member-signature"><a name="field.template_field"></a><a class="type-name" href="S.html" title="S">S</a>&lt;<a class="type-name" href="S.html" title="S">S</a>&lt;int&gt;&gt; <a class="field-name" href="TemplateMethods.html#field.template_field">template_field</a></div>
<div class="description long">
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions subdoc/gen_tests/typenames-across-paths/n-HoldS.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@
</div>
<div class="section-items">
<div class="section-item">
<div class="item-name member-signature"><a class="type-name" href="other-subother-S-FirstNested-Nested.html" title="other::subother::S::FirstNested::Nested">Nested</a> <a class="field-name" name="field.nested" href="n-HoldS.html#field.nested">nested</a></div>
<div class="item-name member-signature"><a name="field.nested"></a><a class="type-name" href="other-subother-S-FirstNested-Nested.html" title="other::subother::S::FirstNested::Nested">Nested</a> <a class="field-name" href="n-HoldS.html#field.nested">nested</a></div>
<div class="description long">
</div>
</div>
<div class="section-item">
<div class="item-name member-signature"><a class="type-name" href="other-subother-S.html" title="other::subother::S">S</a> <a class="field-name" name="field.s" href="n-HoldS.html#field.s">s</a></div>
<div class="item-name member-signature"><a name="field.s"></a><a class="type-name" href="other-subother-S.html" title="other::subother::S">S</a> <a class="field-name" href="n-HoldS.html#field.s">s</a></div>
<div class="description long">
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion subdoc/lib/gen/generate_record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ sus::Result<void, MarkdownToHtmlError> generate_record_fields(
name_div.add_class("item-name");
name_div.add_class("member-signature");

{
auto anchor = name_div.open_a();
anchor.add_name(construct_html_url_anchor_for_field(fe));
}
if (!fe.template_params.is_empty()) {
auto template_div = name_div.open_div(HtmlWriter::SingleLine);
template_div.add_class("template");
Expand All @@ -241,7 +245,6 @@ sus::Result<void, MarkdownToHtmlError> generate_record_fields(
}
generate_type(name_div, fe.type, [&](HtmlWriter::OpenDiv& div) {
auto anchor = div.open_a();
anchor.add_name(construct_html_url_anchor_for_field(fe));
anchor.add_href(construct_html_url_for_field(fe));
anchor.add_class("field-name");
anchor.write_text(fe.name);
Expand Down

0 comments on commit 052679b

Please sign in to comment.