Skip to content

Commit dd8dc34

Browse files
committed
export/html: Enable anchor and back links for all nodes with UID
(not only for sections)
1 parent 362afd6 commit dd8dc34

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

strictdoc/export/html/_static/controllers/anchor_controller.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
// the result is expected to be the same as on the content flow.
3030
const contentLeft = this.element.getBoundingClientRect().x;
3131

32-
// ** 1) if a section does not have [data-uid] parameter,
33-
// ** we don't want to show anchors;
34-
// ** 2) show anchors only for sections: has [node-role="section"]:
35-
const anchors = [...this.element.querySelectorAll('sdoc-anchor[data-uid][node-role="section"]')];
32+
// ** 1) if a node does not have [data-uid] parameter,
33+
// ** we don't want to show anchors
34+
const anchors = [...this.element.querySelectorAll('sdoc-anchor[data-uid]')];
3635

3736
anchors.forEach(anchor => {
3837

strictdoc/export/html/templates/components/anchor/index.jinja

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
data-uid="{{ sdoc_entity.reserved_uid }}"
66
{%- endif -%}
77
>
8-
{%- if sdoc_entity.is_section -%}
9-
{%- set section = sdoc_entity %}
10-
{%- set incoming_links = view_object.traceability_index.get_incoming_links(section) %}
8+
{%- set incoming_links = view_object.traceability_index.get_incoming_links(sdoc_entity) %}
119
{%- if incoming_links is not none and incoming_links|length > 0 -%}
1210
<template>
1311
Incoming link{% if incoming_links|length > 1 -%}s{%- endif %} from:
@@ -20,5 +18,4 @@
2018
{% endfor -%}
2119
</template>
2220
{%- endif -%}
23-
{%- endif -%}
2421
</sdoc-anchor>

0 commit comments

Comments
 (0)