#mdbook #css #nice #install #add #book #plugin

app mdbook-nice

A mdbook plugin to add nice css to your book

1 unstable release

0.1.0 Feb 12, 2025

#217 in Text processing

Download history 128/week @ 2025-02-11

128 downloads per month

MIT/Apache

165KB
111 lines

mdbook_nice

A css theme for mdbook. CSS 美化文件, 主要用于mdbook-pdf打印和html页面的基本美化.

美化思路:

  1. 使用伪选择器,berfor和after,实现标题和代码块的背景色和字体颜色.
  2. 使用伪选择器,实现表格的边框和背景色.
  3. 使用page-break,实现分页.
  4. 使用 word-break,word-wrap等实现换行和单词显示操作.

Installation

gitee: git clone https://gitee.com/jakHall/mdbook-nice github: git clone https://github.com/passion-coder-min/mdbook-nice.git

或者

  • cargo install --git https://gitee.com/jakHall/mdbook-nice
  • cargo install --git https://github.com/passion-coder-min/mdbook-nice.git

Usage

mdbook-nice install . 或者 mdbook-nice install path

Install the preprocessor and its assets

Usage: mdbook-nice install [dest]

Arguments:
  [dest]  The destination directory for the assets [default: ./]

Options:
  -h, --help  Print help

效果参考:

  • 标题/代码块 标题/代码块

  • 表格 表格

  • 引用块 引用块

  • 图片 图片

参考链接

Dependencies

~13–25MB
~371K SLoC