mdbook-files

Crates.iomdbook-files
lib.rsmdbook-files
version0.2.0
sourcesrc
created_at2023-12-16 21:35:02.576766
updated_at2023-12-29 23:43:50.79514
descriptionPreprocessor for mdbook which renders files from a directory as an interactive widget
homepage
repositoryhttps://github.com/xfbs/mdbook-files
max_upload_size
id1072013
size385,374
Patrick Elsen (xfbs)

documentation

README

mdbook-files

docs.rs status Crates.io version

Preprocessor for mdBook which renders files from a directory as an interactive widget, with syntax highlighting.

Example of mdbook-files

Example

You can run the example by launching mdbook in the example directory in this repository.

mdbook serve

Usage

Install mdbook-files using cargo:

cargo install mdbook-files

Put the following into your book.toml:

[preprocessor.files]
prefix = "examples"

The prefix is a path, relative to which files are to be included. It is mandatory to give a prefix. Every include path in the book must be within this prefix.

You will also need to add the style.css from this repository to your list of extra CSS files:

[output.html]
additional-css = ["style.css"]

To use it, add something like this to your book:

```files
title = "Files in subfolder"
paths = ["subfolder/**"]
```

This will produce a widget with all files in examples/subfolder, with the given title. The content of this is a TOML document which contains configuration.

License

MIT.

Commit count: 30

cargo fmt