https://github.com/phoenixr-codes/mdbook-whichlang
Powerful Code Blocks for mdBook
https://github.com/phoenixr-codes/mdbook-whichlang
markdown mdbook mdbook-plugins mdbook-preprocessor preprocessor
Last synced: 5 months ago
JSON representation
Powerful Code Blocks for mdBook
- Host: GitHub
- URL: https://github.com/phoenixr-codes/mdbook-whichlang
- Owner: phoenixr-codes
- License: mit
- Created: 2023-12-15T22:13:55.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-07T16:55:55.000Z (over 1 year ago)
- Last Synced: 2025-02-07T17:22:33.004Z (over 1 year ago)
- Topics: markdown, mdbook, mdbook-plugins, mdbook-preprocessor, preprocessor
- Language: TypeScript
- Homepage: https://phoenixr-codes.github.io/mdbook-whichlang/
- Size: 3.17 MB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# whichlang - Powerful Code Blocks for mdBook


- 🎨 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.
```console,lang=Console,icon=%gnubash
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`:
```toml,fp=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
You can see examples and more precise explanations in the
[documentation](https://phoenixr-codes.github.io/mdbook-whichlang).
## Building
> [!TIP]
> Building `whichlang` yourself allows you to change configurations by editing
> `config.ts`.
```console
deno run --allow-all bundle.ts
```
## Contributing
See [Contributing](./CONTRIBUTING.md).