Create a page that contains all of your listings
Project description
mkdocs-extract-listings-plugin
A small plugin to extract all your listings and put them in a single page.
Might for example be useful if the search plugin makes it hard finding a code snippet you want to find (or you disabled the search).
Just open the page with all listings and use the Find in page
function.
Setup
-
Install the plugin using pip:
pip install mkdocs-extract-listings-plugin
-
Add the plugin to your
mkdocs.yml
:plugins: - search - extract_listings
If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set.More information about plugins in the MkDocs documentation.
-
Add a Markdown file for the page that will be filled with all the listings. In that file add the placeholder where the listings should be inserted. The default configuration expects a file named
listings.md
in yourdocs
folder, which contains the placeholderPLACEHOLDER_LISTINGS_PLUGIN
. This can be changed, see details in the following section.
Configuration
You can configure the plugin like this:
- extract_listings:
listings_file: listings.md
placeholder: PLACEHOLDER_LISTINGS_PLUGIN
listings_file
listings_file
is expected to contain the relative path to the Markdown file, where the listings should be written to.
If the file does not exist, an error will be raised during the build process.
The default value the string listings.md
.
placeholder
The value for placeholder
will be searched in the file referenced by listings_file
and be replaced with the list of all listings.
Changelog
Version 0.0.2
- Fixed
Unknown path
being shown on with different themes (readthedocs
andmaterial
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs-extract-listings-plugin-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc391dea5f35c3ab740242871a8d727bacdcb458477a764048a0d11c18016d6d |
|
MD5 | a26f6806584eba743d068a37da8c56af |
|
BLAKE2b-256 | ab2a20d28bf3d99c9830b633217591405642c83c7ffa14939c34be2ac5c6da77 |
Hashes for mkdocs_extract_listings_plugin-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 271e96149709ddc74587e4c3f659e8c98bba48cc43cf5b5ac2f1a14664233ef4 |
|
MD5 | 5bff5714250e1e753e8ba059e5cc8f79 |
|
BLAKE2b-256 | 16486e79c7e68a934b8f968b7408537517160cca5e2328b112603c344877b34c |