Building CVs with Go and ConTeXt.
Find a file
Dan Anglin 82bdc231e3
docs: update README
- Convert README.md to README.asciidoc
- Update the requirements section
- Add installation section
2023-08-12 15:26:04 +01:00
docker build: replace make with mage 2023-08-11 14:59:21 +01:00
example feat(BREAKING): limit shown employment history 2023-03-02 17:40:04 +00:00
internal fix: use slog for logging 2023-08-12 12:02:44 +01:00
magefiles build: fix the copying of the binary 2023-08-12 14:08:50 +01:00
.dockerignore fix: update the Dockerfile 2023-02-21 08:30:31 +00:00
.gitignore feat: add create subcommand and FlagSet 2023-08-12 09:43:45 +01:00
.hadolint.yaml feat: new cv builder tool 2023-02-18 21:01:28 +00:00
go.mod build: replace make with mage 2023-08-11 14:59:21 +01:00
go.sum build: replace make with mage 2023-08-11 14:59:21 +01:00
LICENSE feat: new cv builder tool 2023-02-18 21:01:28 +00:00
main.go fix: use slog for logging 2023-08-12 12:02:44 +01:00
README.asciidoc docs: update README 2023-08-12 15:26:04 +01:00

Spruce - A tool for building CVs

Overview

Spruce is a tool that generates a PDF document from a CV written in JSON. The PDF generation is completed in two steps:

  1. The application parses the JSON document and generates a TEX file using the TEX template files located in the templates directory.

  2. The application then uses ConTeXt to generate the final PDF document from the generated TEX file.

Requirements

Below is a list of required tools for installing and using spruce.

Go

A minimum version of Go 1.21.0 is required for installing spruce. Please go here to download the latest version.

ConTeXt

ConTeXt is required for generating the PDF documentation. You can go to the installation page to find out how to install ConTeXt for your Operating System.

The Carlito font (ttf-carlito)

Carlito is a free, metric compatible alternative to the Calibri font from Microsoft and is used when generating the PDF documentation.

For Debian/Ubuntu distributions you can use apt to install the font.

apt install font-crosextra-carlito

For Arch Linux you can use pacman.

pacman -S ttf-carlito

Alternatively you can download the font from Font Library.

Once Carlito is installed youll need to update ConTeXt so it can find the font when generating the PDF:

OSFONTDIR=/usr/share/fonts
mtxrun --script fonts --reload

Mage (Optional)

The project includes a magefile for automating the build and installation of the spruce binary. With Mage the build information is built into the binary when it is compiled. You can visit the website for instructions on how to install Mage.

Installation

With Mage

You can install spruce with Mage using the following commands:

git clone https://codeflow.dananglin.me.uk/apollo/spruce.git
cd spruce
mage install

The default install prefix is set to /usr/local so spruce will be installed to /usr/local/bin/spruce. If you dont have sudo privileges or you want to change the install prefix you can set the SPRUCE_INSTALL_PREFIX environment variable before installing.

SPRUCE_INSTALL_PREFIX=~/.local mage install

With Go

If your GOBIN directory is included in your PATH then you can install spruce with Go.

git clone https://codeflow.dananglin.me.uk/apollo/spruce.git
cd spruce
go install .

Verifying the installation

If you have installed spruce with Mage, you can get the build information to confirm that you have installed the correct version.

$ spruce version --full
Spruce
  Version: v0.1.0-14-ge503dbf
  Git commit: e503dbf
  Go version: go1.21.0
  Build date: 2023-08-12T13:00:51Z

Generating the example PDF Document

Once youve installed spruce you can generate a PDF from the example CV by running the following command:

spruce generate --input example/cv.json

This will create a file called cv.pdf which you can view in your favourite PDF viewer.

Inspirations

  • The Markdown Resume: This project uses ConTeXt and pandoc to convert Markdown based CVs into multiple formats including PDF, HTML and DOCX. This is where I discovered ConTeXt.

  • melkir/resume: This project generates CVs using Go and LaTeX.