#mdbook #chapter #private #section #control #visibility #markdown

bin+lib mdbook-private

An mdbook preprocessor that controls visibility of private chapters and sections within them

6 releases

new 0.2.3 Dec 14, 2024
0.2.2 Oct 10, 2023
0.2.1 Sep 11, 2023
0.1.1 Jul 3, 2023
0.1.0 Feb 20, 2023

#301 in Text processing

Download history 8/week @ 2024-09-20 1/week @ 2024-09-27 5/week @ 2024-10-04 11/week @ 2024-10-11 5/week @ 2024-10-18 3/week @ 2024-10-25 13/week @ 2024-11-01 9/week @ 2024-11-08 11/week @ 2024-11-15 10/week @ 2024-11-22 13/week @ 2024-11-29 38/week @ 2024-12-06

72 downloads per month

MPL-2.0 license

46KB
1K SLoC

mdbook-private

build crate.io downloads license

An mdbook preprocessor for defining and optionally hiding private sections and chapters in your book.

Usage

Installation

cargo install mdbook-private

Configuration in book.toml

# Default options
[preprocessor.private]
remove = false
style = true
notice = "CONFIDENTIAL"
chapter-prefix = "_"

Options Explained

  • remove (boolean): Determines whether to remove or retain sections marked as private.
  • style (boolean): Styles the private sections (when retained) using blockquote CSS.
  • notice (string): Adds a notice to styled sections at the top right corner.
  • chapter-prefix (string): If the remove option is active, chapters with filenames prefixed with this value will be excluded.

Markdown Usage

For a hands-on example, explore the example-book.

# Summary

- [Chapter 1](./chapter_1.md)
  - [Sub chapter](./_chapter_1_sub.md)
- [Chapter 2](./_chapter_2.md)
  - [Sub chapter](./chapter_2_sub.md)

Note: With the remove option enabled, only "Chapter 1" will be retained.


<!--private
This is some highly confidential material which we want to hide when sharing with external parties.

Another *line*.

# A title that should remain a title  
Yet another **line**.
-->

Example output

Dependencies

~11–22MB
~328K SLoC