Skip to content
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

Allow style configuration #56

Open
3 tasks
slifty opened this issue Jul 7, 2021 · 0 comments
Open
3 tasks

Allow style configuration #56

slifty opened this issue Jul 7, 2021 · 0 comments

Comments

@slifty
Copy link
Contributor

slifty commented Jul 7, 2021

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:

  1. The "title page" (title layout + style, subtitle layout + style, logo image layout)
  2. The table of contents (title, ToC fonts; no layoud style modifications)
  3. 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.
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

No branches or pull requests

1 participant