A preprocessor for mdbook that creates chapter-level contributor sections featuring authors' GitHub profiles.
cargo install mdbook-github-authors
- Add to your
book.toml
:
[preprocessor.github-authors]
command = "mdbook-github-authors"
- Add contributors/authors using these helpers in your markdown:
<!-- Single author -->
{{#author username}}
<!-- Multiple authors -->
{{#authors username1,username2,username3}}
Note
Rather than expanding in-place, this preprocessor adds a stylized Contributor section to the bottom of the Chapter, irrespective of where these author helpers are found in the raw markdown file.
The preprocessor will generate a "Contributors" section at the bottom of each chapter listing the GitHub profiles of specified authors.
# My Chapter
Content here...
{{#authors rust-lang,contributors}}
Will render as:
![image](https://private-user-images.githubusercontent.com/92402603/410582717-c0018fc9-eb1e-4901-a780-ca1d31d449de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjAxNjYsIm5iZiI6MTczODk1OTg2NiwicGF0aCI6Ii85MjQwMjYwMy80MTA1ODI3MTctYzAwMThmYzktZWIxZS00OTAxLWE3ODAtY2ExZDMxZDQ0OWRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDIwMjQyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWUyZmY5Y2ZkNzViZGY0YzcxMjliOWFmYmUwMzNjMGJhOTQxN2UwNjRkMmExZGZkNDQxNjVkOGQ5MTE3OWMxOGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pON5tWjip8N412WLF3b-HopY1tVHrhFTzJttLT9_Kmg)