@weaverryan pointed out that some docs use the diff view for code samples (e.g. https://webpack.js.org/guides/code-splitting-css/#using-extracttextwebpackplugin) This is a test to see if this could work for us too. If it works, it'd be used selectively and only when it really makes sense.
Testing the use of a "diff" view for some code samples
the (php) diff mean in the previous version a semicolon was missing.
(same comment applies to other php diff)
Import the DiffLexer
Fixed the code syntax
This is how it looks by default (we could tweak the design a bit):
See the rest at http://pr-7455-6snzjvi-6qmocelev2lwe.eu.platform.sh/components/dependency_injection.html
Personally I like this idea a lot because in some specific cases, the diff view is the best one when following an article from the start to the end.
The only negative points may be that:
Testing the real diff format syntax
Reverted the last change because it doesn't improve anything
Closing it because this was just an experiment to see if it was going to work.
Ideally, we could support both in one syntax block (just like GitHub is doing recently in their diff views). I'm not 100% sure how to implement this as a Pygments lexer though