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

Use Github Actions to build PDF #1

Open
mikepqr opened this issue Aug 14, 2020 · 4 comments
Open

Use Github Actions to build PDF #1

mikepqr opened this issue Aug 14, 2020 · 4 comments

Comments

@mikepqr
Copy link
Owner

mikepqr commented Aug 14, 2020

While the requirements are not particularly onerous, it would be nice to be able to build with zero dependencies, just by pushing to Github. I've set up the machinery to do this on the workflow branch. It basically works fine, but the PDF output doesn't look great because Times New Roman is not installed in the container that does the build. I cannot figure out how to install it in a headless (i.e. non-interactive and license compliant way).

This issue can be resolved by either:

  • Changing the default font to one that is installed or easy to install in the environment Github Workflows run
  • Figuring out how to install TNR in that environment
  • Deciding to live with the difference in output

Thoughts welcome!

mikepqr added a commit that referenced this issue Oct 25, 2020
This commit changes the default font to Source Code Pro. This choice of
a free font available from Google Fonts allows resume.pdf to be built by a Github Workflow.
mikepqr added a commit that referenced this issue Oct 25, 2020
This commit changes the default font to Source Code Pro. This choice of
a free font available from Google Fonts allows resume.pdf to be built by a Github Workflow.
@mikepqr
Copy link
Owner Author

mikepqr commented Oct 26, 2020

That doesn't work :-(

Note that the numbers in https://github.com/williamsmj/resume.md/blob/workflow/resume.pdf are not in Source Serif Pro.

@mikepqr
Copy link
Owner Author

mikepqr commented Mar 4, 2021

mikepqr added a commit that referenced this issue Mar 16, 2021
This major update changes how PDFs are built. Instead of requiring
weasyprint we use Google Chrome (or Chromium). Weasyprint turns out to
be non-trivial to install (especially on Windows and Apple Silicon).

This change is made by adding functionality to launch Chrome in headless
mode to resume.py. This requires lots of special cases and options to
get things to work on all the platforms I've tested.

resume.py is now a "real" command line program with --no-html,
--no-pdf, --quiet and --chrome-path options.

The script uses Chromium if it is available, falling back to the evil version if
Chromium is not found. It searches likely paths for the Chromium/Chrome
executable, but you can specify the path with the --chrome-path option.

This commit also adds a GitHub action to build HTML and PDF on Linux,
Windows and macOS. Inspection of the build artifacts is useful for
testing. It is related to #1, but is probably not ready for use by
regular users.

Closes #4, #6, #8
mikepqr added a commit that referenced this issue Mar 16, 2021
This major update changes how PDFs are built. Instead of requiring
weasyprint we use Google Chrome (or Chromium). Weasyprint turns out to
be non-trivial to install (especially on Windows and Apple Silicon).

This change is made by adding functionality to launch Chrome in headless
mode to resume.py. This requires lots of special cases and options to
get things to work on all the platforms I've tested.

resume.py is now a "real" command line program with --no-html,
--no-pdf, --quiet and --chrome-path options.

The script uses Chromium if it is available, falling back to the evil version if
Chromium is not found. It searches likely paths for the Chromium/Chrome
executable, but you can specify the path with the --chrome-path option.

This commit also adds a GitHub action to build HTML and PDF on Linux,
Windows and macOS. Inspection of the build artifacts is useful for
testing. It is related to #1, but is probably not ready for use by
regular users.

Closes #4, #6, #8
mikepqr added a commit that referenced this issue Mar 16, 2021
This major update changes how PDFs are built. Instead of requiring
weasyprint we use Google Chrome (or Chromium). Weasyprint turns out to
be non-trivial to install (especially on Windows and Apple Silicon).

This change is made by adding functionality to launch Chrome in headless
mode to resume.py. This requires lots of special cases and options to
get things to work on all the platforms I've tested.

resume.py is now a "real" command line program with --no-html,
--no-pdf, --quiet and --chrome-path options.

The script uses Chromium if it is available, falling back to the evil version if
Chromium is not found. It searches likely paths for the Chromium/Chrome
executable, but you can specify the path with the --chrome-path option.

This commit also adds a GitHub action to build HTML and PDF on Linux,
Windows and macOS. Inspection of the build artifacts is useful for
testing. It is related to #1, but is probably not ready for use by
regular users.

Closes #4, #6, #8
@mikepqr
Copy link
Owner Author

mikepqr commented Mar 16, 2021

#11 basically closed this issue, but I would like to spend some more time trying to get Times New Roman to work. ttf-mscorefonts-installer and sudo fc-cache -f -v didn't seem to help.

@mikepqr
Copy link
Owner Author

mikepqr commented Feb 14, 2022

The CI job can produce "nice" PDF output, i.e. Time New Roman, if it's set to use macOS or Windows.

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