Skip to content

Conversation

Alexey-NM
Copy link

@Alexey-NM Alexey-NM commented Jan 27, 2025

They need stable heading id to make refrences to headers from external documentation (some_chapter.html#zagalovok).
Unfortunately If there are titles 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.

This merge request allows to generate stable ids by setting myst_fully_normalize_name_slug_func in config.py

myst_fully_normalize_name_slug_func = 'utils.fully_normalize_name_by_any_lang'
def fully_normalize_name_by_any_lang(str:str)->str:
    normalize_name = ' '.join(str.lower().split())
    tr_str = translit(normalize_name,"ru",reversed=True)
    result = _make_id(tr_str)
    return result

It generates an english name from other language. It allows to use static id.

See also: #968 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants