Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Making it more clear where Request::setTrustedProxies should go #7619

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

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

weaverryan
Copy link
Member

... And trying out the diff format! I know we lose the php formatting, but in this case, it seems superior.

@javiereguiluz
Copy link
Member

About the "diff + syntax highlighting" feature, I've only found this old article: https://blaxpirit.com/blog/1/diffs-with-syntax-highlight.html So it looks complicated to get it done with Pygments.

@javiereguiluz
Copy link
Member

I've opened a "feature request" in the Pygments repository about "diff + highlighting" --> https://bitbucket.org/birkenfeld/pygments-main/issues/1339/add-support-for-using-the-diff-lexer-code

@javiereguiluz
Copy link
Member

I like this proposal a lot, but currently it looks like this:

original

However, given that red-green color blindness affect to 8% of people, I guess this will be confused by a mistake where we made a typo and put a + in the code.

I propose to change this to show the + and - on the left margin:

improvement_1

Another proposal for which I'm not sure would be to display a green/red background color on the changes, to make them stand out more:

improvement_2


My vote would be yes to 1) and no to 2). What do others think? Thanks!

@HeahDude
Copy link
Contributor

I'm definitely 👍 for aligning left margin, and I'm also 👍 for the background color, looks more like a diff to me.

@weaverryan
Copy link
Member Author

I agree with @HeahDude! I like both the left margin align and the light green background (which obviously GitHub does - that's always a good source to follow). IF possible, it would be great to make the + not selectable - possibly via a :before content CSS selector - it's what we use on our code blocks on KnpU (https://knpuniversity.com/screencast/javascript/window-global-vars).

@javiereguiluz are you proposals possible? Or are we going to need to hack through some sphinx code to do this?

@javiereguiluz
Copy link
Member

Luckily we can do these changes just with CSS.


Let's consider a GitHub diff as a reference:

diff-github

This is the default Pygments style:

diff-before

And this is the design that has been proposed to symfony.com private repo:

diff-after

We can't do the same as GitHub because the Pygment markup is not advanced enough to highlight the specific chars changed on each line.

@javiereguiluz
Copy link
Member

The changes in the diff styles have already been merged on symfony.com ... so it's safe now to merge this. Thanks!

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@weaverryan
Copy link
Member Author

Woohoo! That was quick work! Thanks!

@weaverryan weaverryan merged commit 869e5d2 into 2.7 Mar 15, 2017
weaverryan added a commit that referenced this pull request Mar 15, 2017
…uld go (weaverryan)

This PR was merged into the 2.7 branch.

Discussion
----------

Making it more clear where Request::setTrustedProxies should go

... And trying out the `diff` format! I know we lose the `php` formatting, but in this case, it seems superior.

Commits
-------

869e5d2 Making it more clear where to add the Request::setTrustedProxies line
@weaverryan weaverryan deleted the weaverryan-patch-2 branch March 15, 2017 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants