strictdoc icon indicating copy to clipboard operation
strictdoc copied to clipboard

Update anchor format

Open mettta opened this issue 2 years ago • 0 comments

I. TODO:
make the format for nodes Anchors with UIDs consistent
(generation based on UID, without adding a unique_prefix sequence number).
Leave title-based anchors only for sections without UIDs.
This will only go into the TOC and be used locally.

II. TODO: It's the same for inline links!
[LINK: UID] is now replaced by:
1) anchor/link using a title,
2) the visible part of the link using the title.
(1) should be changed (using UID), and (2) should be left as it is.

In the moment we have these formats:

in section: f"{unique_prefix}-{self._string_to_link(node.title)}" in requirement: f"{unique_prefix}-{self._string_to_link(node.reserved_uid)}" f"{unique_prefix}-{self._string_to_link(node.reserved_title)}"

*** where unique_prefix = node.context.title_number_string

     # export/html/renderers/link_renderer.py
     def render_local_anchor

After that, update the tests for links and TOC

mettta avatar Oct 26 '23 21:10 mettta