-
Notifications
You must be signed in to change notification settings - Fork 4k
Add support for toml syntax highlighting in code blocks #3140
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
|
I filed #3156 to remind myself to revisit how syntax highlighting and alert boxes interact in general. |
We changed the behavior of auto-syntax highlighting in code blocks in streamlit#2814 to *not* attempt to highlight code as if it were python if the language specified isn't a supported one, which had the side effect of removing syntax highlighting from toml code blocks (toml was being highlighted as if it were python). This change adds toml highlighting back using prismjs' native support. We also re-order and re-group the imports in the file.
7375ee7 to
2739ade
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
comment to un-stale |
* develop: Remove tag from PR template (streamlit#3284) Add test req version bound for TF to fix tests (streamlit#3266) Add support for toml syntax highlighting in code blocks (streamlit#3140) Don't allow config.get_option to be called on file import (streamlit#3235) pin click to < 8.0 (streamlit#3256) Random cleanup: docstrings + type-safety (streamlit#3252) "setWidgetValue" -> "commitWidgetValue" (streamlit#3253)
* develop: (75 commits) Remove tag from PR template (#3284) Add test req version bound for TF to fix tests (#3266) pin click to < 8.0 (#3256) Up version to 0.82.0 Update change log Add support for toml syntax highlighting in code blocks (#3140) Don't allow config.get_option to be called on file import (#3235) pin click to < 8.0 (#3256) Random cleanup: docstrings + type-safety (#3252) "setWidgetValue" -> "commitWidgetValue" (#3253) Fix inactive DatePicker if the date value is 10 years earlier (#3241) Upgrade trim to 0.0.3 or later (#3250) Manually name all snapshots and generate missing ones (#3205) Fix Video Recorded modal dialog width (#3226) Bump handlebars from 4.7.6 to 4.7.7 in /frontend (#3238) Bump hosted-git-info from 2.8.8 to 2.8.9 in /frontend (#3234) Bump lodash from 4.17.20 to 4.17.21 in /frontend (#3233) Bump ua-parser-js from 0.7.23 to 0.7.28 in /frontend (#3231) Update FAQs with supported browsers (#3225) Update copyright date (#3228) ...


We changed the behavior of auto-syntax highlighting in code blocks in #2814 to
not attempt to highlight code as if it were python if the language
specified isn't a supported one, which had the side effect of removing
syntax highlighting from toml code blocks (toml was being highlighted as if it
were python). This change adds toml highlighting back using prismjs' native
support.
We also re-order and re-group the imports in the file.
Note that it's possible for syntax highlighting in general to not look great in alert
boxes because there are 4 possible background colors that they can be, and
I filed #3156 to address this. Since we still highlight syntax for other supported
languages, I think we should still re-add toml syntax highlighting as its strictly
better than not having it, and code blocks for other languages in alert boxes still
have potential display issues.