Skip to content

Support stable heading id for non english languages #968

Open
@Alexey-NM

Description

@Alexey-NM

Feature

I need ability to make refrences to headers from external documentation (some_chapter.html#zagalovok).
Unfortunately If I have a title in a non english language it will have numeric id which can be changed in any time.
It is difficult to automate and it is unstable because such number can be changed at any time.

<section id="id2">

Solution

I want to have the ablility to define the id generation function in my conf.py to a function that accepts a string and returns a stable id.

The function will generate stable id by a node title.

<section id="zagalovok">

I have maken some test in the function generate_heading_target

name = nodes.fully_normalize_name(implicit_text)
name = conf.make_id_by_any_lang(name)

It seems It is working.

Will it be accepted If I make a pull request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions