Closed rowanc1 closed 2 years ago
One thing to note here, the naming of these needs a little thought:
In https://github.com/chrisjsewell/docutils/blob/8adab0660b2097b4f3c32cef7e5ff4cb3c72b084/docutils/docutils/parsers/rst/roles.py#L251-L252, the actual canonical (language independent) names are subscript
and superscript
, then if you are using the default english en
language sub
and sup
are allowed: https://github.com/chrisjsewell/docutils/blob/8adab0660b2097b4f3c32cef7e5ff4cb3c72b084/docutils/docutils/parsers/rst/languages/en.py#L84-L87
Abbreviation is a bit weird, because in docutils abbreviation
is the canonical name, then ab
is allowed with en
.
BUT: then in sphinx they have decided to redefine their own abbreviation role, with the canonical name abbr
🤷 https://github.com/sphinx-doc/sphinx/blob/d788e78a5e2f339cc5e5c5fd5d8431e1991e568f/sphinx/roles.py#L356
So firstly this raises the question, should we/how do we handle language translations?
I think the translation/resolution of roles into various languages is likely something that can be kicked down the road for a while. The logic for this is combined to two, non-exposed, places (in the Role/Directive classes) currently the logic is to look into a user supplied dictionary, that can always get more sophisticated if the feature is necessary.
I will add the three aliases that you suggest.
I will also add the other math role in this PR, and then get it into main - so we can resolve some of the math rendering in a similar way between the various repositories.
Just another note, abbr
/sub
/sup
were also likely chosen because they are the html standard!
Ok - this PR is good to go in from my perspective.
This should be good to go in.
Added a few of the basic html roles that are in sphinx out of the box.