-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support stable heading id for non english languages #968
Comments
Alternative decision is to add ability configuring custom markdown plugins. It is not difficult to add custom function to configure
|
Heya, what exactly does MyST-Parser/myst_parser/mdit_to_docutils/base.py Lines 774 to 775 in 1038800
|
It generates an english name from other language. It allows to use static id. def make_id_by_any_lang(str:str)->str:
# see https://pypi.org/project/transliterate/
tr_str = translit(str,"ru",reversed=True)
#This function is a modified version of ``docutils.nodes.make_id()`` of
#docutils-0.16
# It is test code so probably it is not nessasary
result = _make_id(tr_str).lower()
return result |
We have implemented pull request which allows to do it |
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.
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.
I have maken some test in the function generate_heading_target
It seems It is working.
Will it be accepted If I make a pull request?
The text was updated successfully, but these errors were encountered: