Skip to content

Conversation

@dannyadair
Copy link
Member

@dannyadair dannyadair commented Apr 15, 2025

  • Support custom locations for files/directories (with example document)
  • Lots of refactoring to cleaner class structure (major simplification from new PDFBakerConfiguration class)
  • Proper handling of overrides on main, document and page level
  • Added debug logging and made logging prettier with sections/subsections/errors emphasised
  • Added "trace" logging with full details (image data, templates etc. truncated for readability)
  • Add VSCode launch configs and tasks, esp. for tests and test coverage reports
  • Add full test suite (49 tests, 91% coverage), also test builds all examples
  • Improved error handling (examples and testing uncovered a few more that could be encountered)
  • Improved documentation, added diagrams

Documentation still needs to be reviewed and adjusted for the new custom locations handling.

No more `self.page.document.baker.debug()`
However, configuration instances log through their "parent",
not directly (so PDFBakerPage uses `self.page.debug()`)
When did that get lost
Just missing the top level now
* Allow override of defaults (for library use, incl. our tests)
* Improved logging for all log levels (incl. template rendering preview for --trace)
* Teardown of top-level build directory
* Minor tidy-ups/clarifications
pytest-cov and debugpy don't play
Click does the work, and doesn't care about return values.
Also, we don't stop processing when one document fails, so we
can see all problems not just one.
So we need to error out if any of the documents failed.
We just tear down the document build dir at the end, no matter what.
The way it was before it would tear down, _then_ show an error message
if there was an error. Now the output is more logical. (sure, same result)
This looks correct now.
A new document will start with a default config that includes e.g.
the "pages" directory to be "pages". So this is in its base config,
not in its own config - but it still is relative to its own config.
* Proper logging setup instead of basicConfig()
* INFO and below to stdout, WARNING and above to stderr
If Ghostscript is not installed, will fall back to uncompressed.
So it's ok to always give it a go.
Not the greatest of tests, but having 49 tests with a total
test coverage of 91% is a good starting point.
@dannyadair dannyadair changed the title WIP Revamp Revamp Apr 19, 2025
@dannyadair dannyadair merged commit 0ecf635 into main Apr 19, 2025
1 check passed
@dannyadair dannyadair deleted the danny-revamp branch April 19, 2025 17:09
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