Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to raise error if block or include_block is not found in file #31

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

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