-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/phu specific templates #93
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
Conversation
…c templates and update asset directory paths
|
Note this is a draft pr! Still more to add here. |
…der info for English and French templates
…derer calls with consistent indentation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| TEMPLATE_MODULE_MAP = { | ||
| # shared test templates package | ||
| "templates": { | ||
| Language.ENGLISH.value: "en_template", | ||
| Language.FRENCH.value: "fr_template", | ||
| }, | ||
| # PHU-specific templates package (production) | ||
| "phu_templates": { | ||
| # PHU repo uses a different module name for English templates | ||
| Language.ENGLISH.value: "en_template_row", | ||
| # If a PHU-specific French template exists name it here, otherwise | ||
| # the code will fall back to the shared `templates` package. | ||
| Language.FRENCH.value: "fr_template", | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should perhaps be in config if needed
| columns: (50%,50%), | ||
| gutter: 5%, | ||
| [#image(logo, width: 6cm)], | ||
| [#image(logo, width: logo_width)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is logo width and envelope width coming from config file?
| // Immunization Notice Section | ||
| #let immunization_notice(client, client_id, immunizations_due, date, font_size) = block[ | ||
| #v(0.2cm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these hard coded values 6cm and 81pt come from parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #70
|
Closed with #111 |
This pull request introduces support for switching between test mode (default) and production/PHU-specific mode in the pipeline, allowing dynamic selection of template packages and assets. The main changes include adding CLI flags to control the mode, refactoring template renderer selection to be dynamic, and updating Typst template functions for greater flexibility.
Test/Production mode support:
--test-modeand--no-test-modetopipeline/orchestrator.py, allowing users to toggle between test mode (shared templates/assets) and production mode (PHU-specific templates/assets). The default is test mode. [1] [2] [3]Dynamic template renderer selection:
pipeline/generate_notices.pyto import template renderers dynamically at runtime, based on the selected template package (templatesorphu_templates), instead of hardcoding imports. This includes a new function_import_rendererand a mapping for module names. [1] [2] [3]render_notice,generate_typst_files,main) to accept atemplates_packageargument and use the dynamic renderer selection. [1] [2] [3] [4] [5] [6] [7]Typst template improvements:
templates/conf.typand usage in template files to accept a configurablelogo_widthandenvelope_window_heightfor more flexible rendering. [1] [2] [3] [4] [5] [6] [7] [8]Testing and coverage:
templates_packageargument when retrieving language renderers, ensuring compatibility with the refactored API. [1] [2] [3] [4]printstatements from coverage inpyproject.toml.Documentation:
README.mdexplaining the test/production modes, CLI usage, and import path requirements for template packages.