Introduction

  • 🎨 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.

Installation

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"]

Uninstallation

Simply remove the whichlang.js and whichlang.css files and remove the references to them in the book.toml configuration file.

Usage

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