Skip to content

Conversation

@Ox54
Copy link
Contributor

@Ox54 Ox54 commented Mar 9, 2025

Overview

This PR adds support for configuring the pretty option at the individual documentation block level, allowing users to override the global setting on a case-by-case basis. It also includes updates to the project version (0.1.4) and comprehensive documentation of changes in the CHANGELOG.

Changes

  • Added version 0.1.4 to the CHANGELOG with detailed entries
  • Enhanced the TyperProcessor.run() method to support per-block configuration for the pretty option
  • Improved boolean parsing for the pretty option to properly handle string values like "true", "false", "1", "0", etc.
  • Added comprehensive tests with parameterized test cases to verify all combinations of global and block-level settings
  • Updated documentation to reflect new capabilities

Implementation Details

The implementation properly prioritizes block-level settings over global settings:

  • The global setting is used as the default
  • If a block includes a :pretty: directive, it overrides the global setting
  • The block-level setting properly handles different boolean-like string values

Testing

  • Added a new parameterized test case test_typer_processor_pretty_option to verify all combinations of global and block-level pretty settings
  • All 26 tests are now passing with 97% coverage
  • Manually verified the functionality by running the MkDocs server and checking the documentation output

Other Notes

The changes are backward compatible with existing documentation and do not affect previous functionality. Users can continue using the global setting or now opt to override it in specific documentation blocks as needed.

@codecov
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   96.33%   96.98%   +0.64%     
==========================================
  Files           5        5              
  Lines         191      199       +8     
==========================================
+ Hits          184      193       +9     
+ Misses          7        6       -1     
Files with missing lines Coverage Δ
src/mkdocs_typer2/markdown.py 96.07% <100.00%> (+3.05%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38bd12b...c75bcb0. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ox54 Ox54 merged commit d7c72cc into main Mar 9, 2025
4 checks passed
@Ox54 Ox54 deleted the docs/update-readme branch March 9, 2025 17:13
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