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 to false.
    • If false, behavior remains unchanged.
    • If true, the select() method will raise a ValueError if block or inside_block are not None, and the requested block is not found in the file.
  • Updates README.md
    • Explains behavior if block not found
    • Adds Configuration section detailing config options
  • Adds tests for new behavior