Skip to content

extract_listings

[PyPI | mkdocs-extract-listings-plugin] [Github | six-two/mkdocs-extract-listings-plugin]

This plugin allows you to search only your code listings for specific works or substrings. It can also show you all your code listings on a single page. I wrote it after the normal search stopped being accurate after my knowledge base grew too much.

Configuration

Add plugin to mkdocs.yml

plugins:
- extract_listings:
    javascript_search_file: assets/js/listing-search-plugin.js

On the page where you want to use the code search function, define an element with the id listing-extract-search and load the script file generated by the plugin:

<div id="listing-extract-search"></div>
<script src="/assets/js/listing-search-plugin.js"></script>

Demo

Below is a version of it in action:

The following pages link to this page: