-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix indentation of diff code blocks #15009
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Thanks Wouter for taking the time to do this and thanks Jérémy for being the original creator of the script and the proposal.
Alright, so I found out that Sphinx doesn't use the first line of a code example. Somehow, Sphinx/reStructuredText captures a whole indented block and uses the left most line as the indentation. (fyi, seems like the PHP doc builder doesn't capture diff blocks correctly at all) So I'll update the script and this PR to instead indent everything properly and remove the |
Co-authored-by: Jérémy Derussé <[email protected]>
I've updated the script and this PR. No crazy indentation magic anymore, Sphinx just calculates the indent level completely correct at any times. @javiereguiluz this requires the symfony.com to remove |
That's awesome. Thanks you very much @wouterj for taking care of this PR ❤️ |
@wouter I'll send you some DM on Slack when this is merged/deployed. Thanks. |
* 4.4: [#15009] Fix inconsistent diff examples
* 5.2: [#15009] Fix inconsistent diff examples
Co-authored-by: Jérémy Derussé <[email protected]>
* 5.2: [symfony#15009] Fix indentation of all diff code blocks
* 4.4: [#15009] Fix indentation of all diff code blocks
Thanks @jderusse and @javiereguiluz. This has now been merged in all versions. The tool made it very easy to counter the merge conflicts between 4.4 and 5.2 💚 |
Thank you @wouterj |
This continues #14971, the difference:
:dedent: 0
"hack" (this changes nothing, but makes sure Sphinx knows the indentation).