GitXplorerGitXplorer
M

resume-printer

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
92124350d8e6b4b1100d041858d1088bb771fcae

Add explicit support for using this as a submodule

MMPLew-is committed 4 years ago
Unverified
0d2e1181fa9520497c5dbc224b3ac4833e20ff3e

Centralize source file definitions for later overriding

MMPLew-is committed 4 years ago
Unverified
ab1b0ba6357cd50b71e0e7e1796bc4b72a2e1863

Actually document Brewfile.lock.json rule

MMPLew-is committed 4 years ago
Unverified
75545fa8d886f169d5f462fb411827bb9961727a

Also clean up node modules and Homebrew lock file

MMPLew-is committed 4 years ago
Unverified
9a899e370bb1711ebb0093db052267e6031ace62

Default to building from user-specific and ignored `Sources` directory

MMPLew-is committed 4 years ago
Unverified
a2646465eb93c770c021de8294c0b7914bca3b5d

Overhaul and document build system

MMPLew-is committed 4 years ago

README

The README file for this repository.

Resume Printer

This repository contains a simple Node.js application designed to automate printing of an HTML resume to PDF (using the excellent Puppeteer package), along with a Makefile so you can just run make and have your HTML resume printed automatically. I fully realize that this is pretty excessive, but I got extremely tired of having to launch a browser, load or refresh my resume, print it to PDF, and then open it in yet another program just to see if my formatting or content changes came out the way I wanted. I'm also an automation enthusiast, and this was a chance to exercise those muscles a little.

There's no reason you couldn't use this to print other things, but I've made some assumptions on formatting and number of pages that are really designed just for printing a single-page document where the bottom margin should be slightly larger than the others (to visually balance with the normal large and space-filled header of a resume).

Quick-start

If you have Homebrew installed (or are willing to have it installed for you), all you have to do is:

$ git clone https://github.com/mplew-is/resume-printer
$ cd resume-printer
$ cp /path/to/resume.html [/path/to/resume.css] Sources/
$ make open

The Makefile is set up to automatically:

  1. Install Homebrew if it is not installed
  2. Install Node through Homebrew if not installed
  3. Install the Node dependencies needed
  4. Print your resume to PDF
    • Note that it is assumed your resume is named resume.html, see Advanced usage below for other options
  5. Open your resume in your OS-configured PDF viewer

Advanced usage

The above quick-start is great just to make sure everything works, but the real value of having an HTML resume to me is to be able to source-control it, and in order to do that using the prescribed Sources directory above, you'd have to fork this repository and make your changes - which you can absolutely do, but I also don't want to force you to do that if there's a better option.

To that end, this repository is designed to be used as a git submodule in a sub-directory of your actual resume source. A sample Makefile is provided to allow you to easily configure printing from a different directory than the standalone defaults; the intent is that you copy this file into the "supermodule" containing your resume, customize it with your actual parameters, and then can run make open as before.

That is, you can run the following from your resume repository:

$ git submodule add https://github.com/mplew-is/resume-printer
$ cp resume-printer/sample.mk ./Makefile
$ make open

The default configuration has your HTML file being ./resume.html (relative to your Makefile) and will save to ./resume.pdf, but those and a few more options are easily configurable. The following targets are exposed for convenience, and constitute the API for this build system (anything else that happens to be present is an implementation detail and is subject to change):

  • make [build]: build your PDF to your configured location
  • make open: open your built PDF with your OS-registered document viewer
  • make clean: delete the built PDF

Non-Homebrew dependencies

Personally I really like Homebrew (and it's gotten really good on Linux nowadays), so by default I assume you're willing to use it and make anything else opt-out. The good news is that it's really easy to do that: literally just install node (that is, have npm available on your PATH somewhere) via the method of your choosing, and none of the Homebrew installation steps will run.

The reason I did this is that I'm a big fan of Zero Install and similar techniques that minimize user interaction with regards to dependency management and bootstrapping a new project. One of the most frustrating things I find is when the documentation on how to get started from scratch is either incomplete or outdated; by explicitly encoding the bootstrapping as part of the code, it means all of that is part of the project itself and much more likely to remain up-to-date.