-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add an option to throw a warning when Pygments throws an ErrorToken #1565
Comments
I add warnings at 0329edc. Thank you for reporting. |
Just wanted to say thank you for this change, because it helped me catch a couple of mistakes in our docs. |
Nice, thanks for the feedback! |
😄 |
…docs. Playing around with Sphinx and Pygments the problem was the "hostname" line which might be uncommon/illegal in normal ini files. Since Sphinx 1.3.5 this becomes a warning and in the DebOps projects, warnings are handled as errors :) sphinx-doc/sphinx#1565 Disable ini highlighting for now.
…docs. Playing around with Sphinx and Pygments the problem was the "hostname" line which might be uncommon/illegal in normal ini files. Since Sphinx 1.3.5 this becomes a warning and in the DebOps projects, warnings are handled as errors :) sphinx-doc/sphinx#1565 Disable ini highlighting for now.
…docs. Playing around with Sphinx and Pygments the problem was the "hostname" line which might be uncommon/illegal in normal ini files. Since Sphinx 1.3.5 this becomes a warning and in the DebOps projects, warnings are handled as errors :) sphinx-doc/sphinx#1565 Disable ini highlighting for now.
Update Compiling.rst In response to Brad's [comment](#3243 (comment)), I made some changes to `compiling.rst` and other bits of documentation. To summarize: * Put man page under the 'Compiling Chapel Programs' section * Renamed it Chapel Man Page * Can't get inline code formatting in the sidebar, and the lower case 'chpl man page' among all other capitalized titles looks off. * Cross linked the man page from `compiling.rst` * (Bonus point) Fixed the table formatting in `compiling.rst` In the process of making these changes, I noticed that our Sphinx project is broken with that latest version of Sphinx (1.3.5), due to a [change that throws a warning when Pygments throws an ErrorToken](sphinx-doc/sphinx#1565). There were a handful of code blocks throughout the documentation that raised this error, so I corrected them to be valid Chapel code, or in some cases, made them `.. code-block:: text` when they weren't Chapel code to begin with. [Reviewed by @ronawho @benharsh and @bradcray ]
Currently pygments cannot parse TypeScript with JSX syntax in it. How can I set the warn flag to true to have this not error on my build? |
@saulshanabrook I just added |
@tk0miya Thank you! That works wonderfully. |
Currently, the behavior of Sphinx is to highlight the code-block as none in case the configured lexer throws an ErrorToken. It would be great if it could trigger a warning in this case as well (this could be subject to a configuration setting). It would allow spotting more easily code blocks which cannot be highlighted properly because of a mistake.
What do you think about it ?
The text was updated successfully, but these errors were encountered: