This is a mdbook
preprocessor that will walk a specified base path and add all
the markdowns to your mdbook
. This is pretty naive and will probably work best
for smaller projects but feel free to give it a go for any folder structure!
The preprocessor can be configured with the following settings:
```toml [preprocessor.all-the-markdowns]
draft-folders = true
[[preprocessor.all-the-markdowns.section]]
title = "Auto generated"
base = "./examples/example-folder-structures/slim"
ignore = [] ```
Since section
is a list of tables you can add multiple groups by adding
multiple sections.
```toml [preprocessor.all-the-markdowns]
[[preprocessor.all-the-markdowns.section]] title = "Libraries" base = "./examples/example-folder-structures/slim/my-libraries" ignore = []
[[preprocessor.all-the-markdowns.section]] title = "Services" base = "./examples/example-folder-structures/slim/my-services" ignore = [] ```
Given the following folder structure:
sh
.
├── my-libraries
│ └── lib-biz
│ ├── INSTALLATION.md
│ ├── README.md
│ ├── sub-lib-a
│ │ ├── CONTRIBUTORS.md
│ │ ├── README.md
│ │ └── USAGE.md
│ └── sub-lib-b
│ └── README.md
└── my-services
├── service-bar
│ ├── README.md
│ └── infra
│ └── kubernetes
│ └── README.md
└── service-foo
└── README.md
Based on the title in each document, combined with the folder names as title case, the preprocessor with the first configuration would render the following:
![]() |
![]() |
Result with the first example with one section. | Result with the second example with multiple sections. |
You can test rendering any of the example folders in this directory with the
book found in examples/book1
with mdbook serve examples/book1
.