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
ROI: extend dedent for code-block and literalinclude #2030
Comments
Hi,
with
In this way
|
The original intent of I reckon that it is very error-prone to specify an integer which, as it is implemented now, eats characters from the left independently of whether they are whitespace characters or not. I have two solutions which are more sain in my opinion:
I have no problem making a pull request for this issue if someone will take up the discussion and tell me the preferred solutions. |
If it were for my personal taste I will agree with point 2 and make https://docs.python.org/3.1/library/textwrap.html#textwrap.dedent |
I am in need of this functionality as it is impractical to have o find the indent of the specific code block. If any indent changes are made to the code, this will break the docs or make it look bad. using :dedent-auto: seems like a decent solution imo, but it can't dedent all lines using the textwrap.dedent(). When I tried that, this was the result:
will look like this:
when it should be this:
|
It would be better to change the argument of |
I did find a work-around for this for my project, but I still think this is a nice to have enhancement. |
Fix #2030: automatic dedent support in code-block directive
Hi,
I think it would be nice to let
:dedent:
behave like the corresponding Python one:https://docs.python.org/2/library/textwrap.html#textwrap.dedent
It may just that if nod edent value is provided, then a full dedent is performed.
The text was updated successfully, but these errors were encountered: