-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Default language for code tag #370
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
Comments
Thanks for the bug report! I'm not very very familiar with the options for rustdoc, but @steveklabnik will certainly be. Is there a conservative mode for rustdoc that onlyc checks codeblocks explicitely marked as Rust? |
There is not, or at least, not one I'm aware of. |
Hi,
Ok, so I'll mark all of my piece of code (which isn't executable Rust code) with the |
Actually, now I wonder if I didn't already open an issue on rustdoc for this specific feature some time ago. This feels like déjà-vu.. 😄 |
Would it be possible to check for rust code explicitly since I'm thinking of using mdbook for other languages as well 😸 |
@agauniyal could you describe what is your problem exactly? ```python def main(): print("hello") ``` You'll get syntax highlighting (not all languages are supported but particular one can be added on request). |
Oh I misunderstood the issue then 😅. Its okay to use different codeblocks for different languages in single book, right? eg
|
Sure! We also support highlighting several markups. You only loose the additional functionality available for rust codeblocks that I've mentioned. |
And expanding on that, is it possible to add similar play button for other services like - https://wandbox.org/ or embedding godbolt views. Wandbox provides similar play button service but for plethora of other languages throught same api (including rust) and godbolt is lang->asm converter for languages like c/c++, d, rust etc. |
Yep. We already have an issue for exactly that problem |
Hi,
Basic code tag (without language name specified) is not supported by markdown interpreter when I put a piece of Rust code.
I tried this code:
(No language name specified in code tag)
I expected to see this happen: No error thrown by
mdbook test
.Instead, this happened:
mdbook test
throws an error.Meta
Backtrace:
You should "skip" code compilation when language name isn't specified in markdown code tag, maybe ? So:
(Specified language name: rust)
Ok !
(Specified language name: nothing,
text
by default)Compilation skipped, not enough information to test code tag content.
See here(my travis backtrace) for more.
Solution
I've added
text
language name in code tag to skip this test.Works properly.
Regards.
The text was updated successfully, but these errors were encountered: