From 052679bcb31a2bae253223ede1ee3b7147177997 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 6 Sep 2023 23:11:03 -0400 Subject: [PATCH] Fix position of data member name anchor It should be on the template<> not below it. --- subdoc/gen_tests/struct-complex/S.html | 8 ++++---- subdoc/gen_tests/templates/TemplateMethods.html | 4 ++-- subdoc/gen_tests/typenames-across-paths/n-HoldS.html | 4 ++-- subdoc/lib/gen/generate_record.cc | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/subdoc/gen_tests/struct-complex/S.html b/subdoc/gen_tests/struct-complex/S.html index 50abddedf..d486691e4 100644 --- a/subdoc/gen_tests/struct-complex/S.html +++ b/subdoc/gen_tests/struct-complex/S.html @@ -118,14 +118,14 @@
-
static bool static_bool_member
+
static bool static_bool_member

Comment headline static_bool_member

- +

Comment headline static_type_member

@@ -196,14 +196,14 @@
- +

Comment headline bool_field

- +

Comment headline type_field

diff --git a/subdoc/gen_tests/templates/TemplateMethods.html b/subdoc/gen_tests/templates/TemplateMethods.html index 336748113..b86789771 100644 --- a/subdoc/gen_tests/templates/TemplateMethods.html +++ b/subdoc/gen_tests/templates/TemplateMethods.html @@ -117,7 +117,7 @@
-
template <class U>
static U member
+
template <class U>
static U member
@@ -212,7 +212,7 @@
- +
diff --git a/subdoc/gen_tests/typenames-across-paths/n-HoldS.html b/subdoc/gen_tests/typenames-across-paths/n-HoldS.html index 3523fdc55..371ff7e5e 100644 --- a/subdoc/gen_tests/typenames-across-paths/n-HoldS.html +++ b/subdoc/gen_tests/typenames-across-paths/n-HoldS.html @@ -88,12 +88,12 @@
- +
diff --git a/subdoc/lib/gen/generate_record.cc b/subdoc/lib/gen/generate_record.cc index 3eba6f3c8..412d3ab93 100644 --- a/subdoc/lib/gen/generate_record.cc +++ b/subdoc/lib/gen/generate_record.cc @@ -221,6 +221,10 @@ sus::Result 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"); @@ -241,7 +245,6 @@ sus::Result 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);