- 🎨 Optimized for every theme.
- 🔥 Zero-Setup installation: Download the standalone files from the repository's releases section or download them via command-line.
- 🔧 Highly configurable.
In the directory of your book, install whichlang with the following command.
wget https://github.com/phoenixr-codes/mdbook-whichlang/releases/latest/download/whichlang.js &&
wget https://github.com/phoenixr-codes/mdbook-whichlang/releases/latest/download/whichlang.css
Don't forget to add these files in your book.toml
:
# ...
[output.html]
additional-css = ["path/to/whichlang.css"]
additional-js = ["path/to/whichlang.js"]
Simply remove the whichlang.js
and whichlang.css
files and remove the
references to them in the book.toml
configuration file.
whichlang works out of the box. It detects the language defined on each code block and customizes them appropiately. You can furthermore configure them individually:
- override the name of the language
- override the icon of the language
- set a file path shown in the code block
You can see examples and more precise explanations in the documentation.
Tip
Building whichlang
yourself allows you to change configurations by editing
config.ts
.
deno run --allow-all bundle.ts
See Contributing.