- Notifications
You must be signed in to change notification settings - Fork1
Language code tabs preprocessor for mdBook
NotificationsYou must be signed in to change notification settings
nx10/mdbook-langtabs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
AnmdBook preprocessor that creates language tabs for code examples.
Also check out thelive demo.
- Switch between language examples without scrolling
- Automatic language icons viaDevicon
cargo install mdbook-langtabs
Or install the current development version:
cargo install --git https://github.com/nx10/mdbook-langtabs
Either use the automatic installer:
mdbook-langtabs install /path/to/your/book
Or manually:
- Add to your
book.toml:
[preprocessor.langtabs]command ="mdbook-langtabs"[output.html]additional-css = ["langtabs.css"]additional-js = ["langtabs.js"]
- Copy
langtabs.cssandlangtabs.jsto your book's root directory.
Wrap your code blocks with the special comments:
<!-- langtabs-start-->```rustfnmain() {println!("Hello from Rust!");}``````pythondefmain():print("Hello from Python!")``````javascriptfunctionmain() {console.log("Hello from JavaScript!");}```<!-- langtabs-end-->
This creates tabbed code examples that readers can switch between, as shown in the demo above.
MIT
About
Language code tabs preprocessor for mdBook
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
