-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
how to highlight code syntax? #263
Comments
I changed the source a bit and switched the engine to only that the TOC part is not working correctly, because |
Ok, I've made some search. IIUC markdown assigns as |
There is highlighting in the ReadTheDocs theme. You can see it here: http://mkdocs.readthedocs.org/en/latest/#installation |
... It uses highlight.js |
To use that extension, you need to add 'fenced_code' to your config. http://www.mkdocs.org/user-guide/configuration/#formatting-options |
OK. I figured it out. |
I cannot make it work. This is my config file:
I've tried indented blocks, fenced blocks and fenced block with languages specified. What I'm missing? |
BTW, MkDocs doc seems to suggest that fenced_code is already enabled:
|
comment this line out:
it falls back automatically to the you can just copy the css from any theme you like, as a quick fix to this problem. eg.: css files
from:
\site-packages\mkdocs\themes\readthedocs\css
to:
\site-packages\mkdocs\themes\mkdocs\css |
@d0ugal how is generated the documentation on readthedocs.org? I'd like to see the source of the page you linked. |
The documentation I linked is the MkDocs documentation with the RTD theme. |
Yes, I know, of course. But it doesn't use the same mkdocs.yml, right? So some processing must be done. I wonder how it's changed, that's why I'd like to see the exact sources used to generate the documentation on readthedocs.org, which is not the same source used to generate the documentation on mkdocs.org I did try to add I hope I've provided enough information to understand my question now. |
It is exactly the same but the theme is replaced with readthedocs. Read The Docs doesn't support other MkDocs themes at this point. |
@{
Hello World (from the view)
|
Reading issue #183 , I understand that mkdocs supports syntax highlighting. And I see also the prettify.js files in all the themes.except readthedocs.
I wonder where can I find the instructions about the use of prettify. Is it supposed to recognize the language automatically or should I specify the lang in the fenced block?
I've tried py, js, css but none works.
It would be worth adding some information in the documentation.
Thanks
The text was updated successfully, but these errors were encountered: