-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I would like to propose an improvement to the mw2pdf API which allows for style configuration.
Below is a proposed spec and implementation plan:
Specification
The command will take in an optional --styleConfigPath paramter, which will accept a file path pointing to a json file containing style data. That content will be loaded and validated to ensure it is the proper type.
The config can specify custom style information for the following:
- The "title page" (title layout + style, subtitle layout + style, logo image layout)
- The table of contents (title, ToC fonts; no layoud style modifications)
- The page numbers (just the font; I don't think we will allow configurable location for this phase.)
Note that there is no concept of logo image yet, and that will be a separate issue, but I'm including a reference in this issue because ultimately that needs to be configurable as well.
Implementation
- move the current defaults to named constants in the
PdfFactoryclass, add an optional parameter to the relevant generator methods (generatePdfWithPageNumbers,generatePdfFromScaffold,generateTableOfContentsPdf,generateTitlePagePdf,makePdf, andmakePdfBooklet) and update the methods as needed. - add the optional
styleConfigPathparameter to the commander command, including type guards / validation. - update documentation to describe the expected styleConfig format.
Metadata
Metadata
Assignees
Labels
No labels