Crates.io | mdbook-rss |
lib.rs | mdbook-rss |
version | 0.1.0 |
source | src |
created_at | 2021-03-07 12:09:47.181737 |
updated_at | 2021-03-07 12:09:47.181737 |
description | mdBook preprocessor for generating an RSS feed from your chapters |
homepage | https://gitlab.com/albalitz/mdbook-rss |
repository | https://gitlab.com/albalitz/mdbook-rss |
max_upload_size | |
id | 365228 |
size | 88,201 |
A preprocessor for mdBook that generates an RSS feed from your chapters.
The code is built on the example from the documentation.
First, make sure to install this to your $PATH
so mdbook
can find and use it:
cargo install --git <url to this repository>
This section describes "global" configuration for the feed itself.
mdbook-rss
looks for a [preprocessor.rss]
section in your book.toml:
[preprocessor.rss]
files-glob = "posts/*.md"
url-base = "https://example.com/"
Available configuration keys taken from the book.toml:
files-glob
: A file glob used to specify which files to include in the RSS feedurl-base
: A URL that, in combination with the files' path is used to build links to the articles.site-url
option.url::Url::join
this should end with a '/'.The resulting RSS feed is written to an rss.xml
file next to your SUMMARY.md
, so it can be accessed via <url-base>/rss.xml
.
This section describes configuration on a per-chapter base.
In addition to global configuration, you may configure some attributes of each of your book's chapters, by defining a front matter like this:
---
pub_date: Wed, 03 Mar 2021 12:00:00 GMT
description: A helpful example
---
# Example
Rest of your markdown
Currently only pub_date
and description
are supported with the description being optional.
NOTE: This front matter ist removed from each chapter, so it won't be available anymore for preprocessors running after this one!
There are now actual tests yet. The only testing I did was checking the resulting feed in a feed reader.
The RSS items' content is HTML rendered by this preprocessor using the markdown crate; this means mdbook-specific features may be rendered incorrectly in the generated RSS feed.
Front matter is removed which makes it unavailable/incompatible with other preprocessors running after this which also use front matter.
Keep front matter and remove it with a separate preprocessor used for removing front matter?
This preprocessor currently assumes each RSS item is written by the same person(s) and just comma-separates the book's authors
field for each RSS item.
This could be overridden in front matter?
The titles for the RSS feed itself and each item is taken from the book and chapters.
This could be overridden in book.toml and front matter?
The code in this repository is released under the Mozilla Public License Version 2.0.