GitXplorerGitXplorer
M

resume-printer

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
289c94c74d31d01284a0ec120c335803268227ad

Update dependencies

MMPLew-is committed 4 years ago
Unverified
8d371a3ed9dab29d3dece6d2714b5acd70bd50c8

Update to new `package-lock.json` version

MMPLew-is committed 4 years ago
Unverified
0f8ad78834a784add5fc6e1d2ddbac7e76ed1d03

Don't copy `package-lock.json` to supermodule

MMPLew-is committed 4 years ago
Unverified
dc86bc7eb4f3e2b2b1e50bf8ec4fdeef637bb367

Make usage with llinuxbrew a little easier

MMPLew-is committed 4 years ago
Unverified
c07dd4910d5336fe5e4330ec767a58d12f1aea84

Finish dangling line

MMPLew-is committed 4 years ago
Unverified
99417a063185c603d5fcb6f88babb14d05938713

Actually depend on the NPM installation receipt

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.