Sphinx is interpreting `\t` as a tab character in the docstring
Details
https://github.com/ManimCommunity/manim/blob/ee0501c2b6a1e1d2e6171d9b24380c3473df817f/manim/mobject/text/numbers.py#L60-L80
In the code, the unit argument is set to r"\text{M-Units}", but Sphinx’s docstring extraction processes \t as a tab space. The documentation and the animation renders incorrectly as a result.
Screenshot of the documentation issue (link):
This is actually a pretty interesting problem. A simple workaround would be to rewrite the raw string to a normal one, while properly escaping the backslash.
I think that a proper fix, allowing our directive to read the content as a raw string (actually: preserving the raw string behavior in raw strings within the content passed to the directive) would require significantly more effort.
Hi, I want to work on this issue and contribute, can I work on this issue please? Thank you.
I just forked the repo and locally cloned it onto my machine, if I am not wrong it might be something to do with using the character " (line 67) in a block which is already using """ (line 25)
Has someone tried writing it as :
unit=r'\text{M-Units}',
Technically, ' ' is used withing a block which is already enclosed in a " " or """ """ block
So instead this could be done :
r"""An mobject representing a decimal number.
# code
unit=r'\text{M-Units}',
# code
"""
Should I submit a pull request implementing this?
Feel free to try whether this fixes the issue @adityakiran1423, sure!
@behackl sorry for my late response, I was travelling. Sure, I will make a PR and see if it fixes the issue
Hi, is this issue still open ? I'm new to open source but i'd like to work on this.
Hi, is this issue still open ? I'm new to open source but i'd like to work on this.
I just checked https://docs.manim.community/en/stable/reference/manim.mobject.text.numbers.DecimalNumber.html and it appears that the problem has been resolved in the meantime. There is lots of other issues that would need a helping hand though! 👋