You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 PdfFactory class, add an optional parameter to the relevant generator methods (generatePdfWithPageNumbers, generatePdfFromScaffold, generateTableOfContentsPdf, generateTitlePagePdf, makePdf, and makePdfBooklet) and update the methods as needed.
add the optional styleConfigPath parameter to the commander command, including type guards / validation.
update documentation to describe the expected styleConfig format.
The text was updated successfully, but these errors were encountered:
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:
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
PdfFactory
class, add an optional parameter to the relevant generator methods (generatePdfWithPageNumbers
,generatePdfFromScaffold
,generateTableOfContentsPdf
,generateTitlePagePdf
,makePdf
, andmakePdfBooklet
) and update the methods as needed.styleConfigPath
parameter to the commander command, including type guards / validation.The text was updated successfully, but these errors were encountered: