-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Use Terminal lexer for console examples #6930
Conversation
This seems to work ... but it introduces some issues: comments are now considered prompts. For example, in this page: http://pr-6930-6qmocelev2lwe.eu.platform.sh/setup.html I'm afraid it's "the curse of Sphinx": when someone tries to fix something ... they end up breaking more things 😭 |
yeah, this is because a shell session does not have comments AFAIK |
status: needs work We can quite easily fix this by creating a custom lexer that will call the bash lexer for lines starting with |
64248e0
to
1090ea9
Compare
Wow, love carsonbot :) @javiereguiluz I've updated the PR with a very simple custom lexer. As far as I can see, it works. It uses 2 new styles not yet defined by symfony.com: Let me know if you like this change. |
@@ -108,6 +109,7 @@ | |||
lexers['rst'] = RstLexer() | |||
lexers['varnish3'] = CLexer() | |||
lexers['varnish4'] = CLexer() | |||
lexers['terminal'] = TerminalLexer() |
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.
@javiereguiluz you need to add this to the conf.py
used by the doc builder. You probably also have to add sys.path.append(os.path.abspath('_theme/_exts'))
(where os.path.abspath('_theme/_exts')
should be replaced by the path to the _theme/_exts
directory)
@wouterj we've updated symfony.com's Sphinx builder to include your TerminalLexer. Changes will be deployed soon and after that, it will be safe to merge this PR and regenerate the docs. |
The changes have been implemented on symfony.com, so we can merge this PR and see how the new docs are generated. Thanks. |
Okay, let's see how this looks like. :) |
This allows to fix #6865