Add functionality to raise error if `block` or `include_block` is not found in file by geel9 · Pull Request #31 · rnorth/mkdocs-codeinclude-plugin
The current behavior for block and include_block is to return the full contents of the file if the block is not found. This is not optimal for our use case -- a block not being found is, to us, an error which should prevent the building of our docs site entirely.
This PR:
- Adds a config option,
block_throw, which defaults tofalse.- If
false, behavior remains unchanged. - If
true, theselect()method will raise aValueErrorifblockorinside_blockare notNone, and the requested block is not found in the file.
- If
- Updates
README.md- Explains behavior if block not found
- Adds
Configurationsection detailing config options
- Adds tests for new behavior