https://github.com/terraphim/md-book
Rust documentation can be pretty
https://github.com/terraphim/md-book
Last synced: about 2 months ago
JSON representation
Rust documentation can be pretty
- Host: GitHub
- URL: https://github.com/terraphim/md-book
- Owner: terraphim
- Created: 2024-11-29T22:40:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-09T20:17:49.000Z (6 months ago)
- Last Synced: 2025-03-30T11:15:50.851Z (3 months ago)
- Language: Rust
- Size: 9.69 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MD book is a mdbook replacement with some extra features
## Run
Checkout the source code and run:```rust
cargo run -- -i ../mdBook/test_book -o ./test_mdbook
```-i is the input directory and -o is the output directory.
input directory is the directory with md files.The tool will generate the input directory with markdown files and the output directory with HTML files ready to be deployed on any static site.
Adjust the styling in the src/templates/css/styles.css file.
Or anything you want to change in the src/templates folder. It's a standard Tera template, so you can add your own custom stuff there.
## Styling
* Nicer default styling for content - multiple columns for horizontal layout,
* Right-hand TOC to navigate around the page.
* Create index.md to create content for the home page; alternatively, it will create a list of cards with all the pages as an index.- Code blocks with syntax highlighting
- Better default styling
# Screenshots

# Configuration
You can add a book.toml file to the input directory to configure the book.
Supports TOML configuration via book.toml
Allows overriding with environment variables (prefixed with MDBOOK_)
Supports command-line arguments
Enables shell expansion in config file paths
Provides default values for optional fields
Example usage:```bash
# Using environment variables
MDBOOK_BOOK.TITLE="My Book" ./md-book -i input -o output# Using custom config file
./md-book -i input -o output -c ~/my-config.toml# Config values can be nested using an underscore
MDBOOK_OUTPUT.HTML.MATHJAX_SUPPORT=true ./md-book -i input -o output
```
The configuration system follows the priority order:
1. Command line arguments (highest priority)
2. Environment variables (prefixed with MDBOOK_)
3. Custom config file (if provided)
4. Default book.toml
5. Default values (lowest priority)
you shall be able to feed config into json and yaml files.# Serve and Watch
## Just build
```bash
cargo run -- -i input -o output
```## Build and watch
```bash
cargo run -- -i input -o output --watch
```## Build and serve
```bash
cargo run -- -i input -o output --serve
```## Build, watch and serve on custom port
```bash
cargo run -- -i input -o output --watch --serve --port 8080
```# TODO
- [ ] Rust specific synax highlight (Good first issue)
- [ ] Search (WIP)
- [ ] Mathjax