This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""MkDocs hook to add block override validation | |
This hook adds a filter function to the Environment `validate_block`. | |
This function is a context filter, and takes the content, name, depth and saved checksum. | |
```jinja | |
{% block site_nav %} | |
{% set _ = super() | validate_block("site_nav", 2, "68f1518853") %} | |
{{ super() }} | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""MkDocs hook for performance debugging | |
The idea behind it is to provide a minimal curated performance log for a `mkdocs build` run. | |
Of course anyone can use a proper profiler, but the output often contains a lot of non-critical data | |
that the user has to first filter to get a clearer picture. This hook takes care of this and allows | |
to quickly see where a bottleneck is occurring. It also has a lower overhead than a proper profiler. | |
It creates a file in the current working directory, it can be configured easily with variables set | |
at the bottom of the file. There are also the timing categories included. |