Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

geel9
Copy link

@geel9 geel9 commented Aug 17, 2022

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

@fundthmcalculus
Copy link
Contributor

@rnorth any thoughts on this ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants