Skip to content

Commit

Permalink
Merge with main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Manel Villar committed Oct 1, 2024
2 parents 69e093e + b5abc55 commit 2571132
Show file tree
Hide file tree
Showing 18 changed files with 422 additions and 54 deletions.
7 changes: 7 additions & 0 deletions .docker/resume.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM pandoc/latex:2.9

RUN apk add make texlive

ENV TEXMF /usr/share/texmf-dist

COPY actions/entrypoint.sh /entrypoint.sh
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.tuc
*.log
*.pdf
*.html
resume.tex
*.swo
*.swp
*.docx
*.rtf
55 changes: 55 additions & 0 deletions .github/workflows/docker-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow updates the docker container which has context and
# pandoc installed, and on which the resume documents are built. The
# workflow runs whenever the dockerfile is changed, and updates the
# container image in the Github Packages registry.

name: Publish Docker Image

# Controls when the action will run.
on:
# Triggers the workflow on push events but only for the master branch
push:
branches: [ master ]
paths-ignore:
- 'markdown/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and Push to GitHub Packages
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: .docker/resume.dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is a basic workflow to help you get started with Actions

name: build-resume

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
paths:
- 'markdown/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-resume:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Test directory contents
run: 'ls -al'

- name: Build resume
uses: ./actions

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
# Artifact name
name: Resume PDF # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: output/*.pdf

9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*.tuc
*.log
resume.tex
*.swo
*.swp
*.rtf
build
output/
result
result-*
.envrc
.direnv
17 changes: 17 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Expected Behavior

### Actual Behavior

### Steps to reproduce the behavior

### Versions

Pandoc and context versions

pandoc --version
context --version

OS information on non-Windows can use one of the following commands

cat /etc/*-release
lsb_release -a
86 changes: 56 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,58 @@
# Makefile for build Manel's CV

BUILD_DIR = build


.PHONY: all clean pdf html docx


all: resume.html resume.pdf resume.docx

pdf:$(BUILD_DIR)/resume.pdf
$(BUILD_DIR)/resume.pdf: resume.md
pandoc --standalone --template style_chmduquesne.tex \
--from markdown --to context \
-V papersize=A4 \
-o $(BUILD_DIR)/resume.pdf resume.md


html:$(BUILD_DIR)/resume.html
$(BUILD_DIR)/resume.html: style_chmduquesne.css resume.md
pandoc --standalone -H style_chmduquesne.css \
--from markdown --to html \
-o $(BUILD_DIR)/resume.html resume.md


docx:$(BUILD_DIR)/resume.docx
$(BUILD_DIR)/resume.docx: resume.md
pandoc -s -S resume.md -o $(BUILD_DIR)/resume.docx

OUT_DIR=output
IN_DIR=markdown
STYLES_DIR=styles
STYLE=chmduquesne

all: html pdf docx rtf

pdf: init
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.pdf; \
pandoc --standalone --template $(STYLES_DIR)/$(STYLE).tex \
--from markdown --to context \
--variable papersize=A4 \
--output $(OUT_DIR)/$$FILE_NAME.tex $$f > /dev/null; \
mtxrun --path=$(OUT_DIR) --result=$$FILE_NAME.pdf --script context $$FILE_NAME.tex > $(OUT_DIR)/context_$$FILE_NAME.log 2>&1; \
done

html: init
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.html; \
pandoc --standalone --include-in-header $(STYLES_DIR)/$(STYLE).css \
--lua-filter=pdc-links-target-blank.lua \
--from markdown --to html \
--output $(OUT_DIR)/$$FILE_NAME.html $$f \
--metadata pagetitle=$$FILE_NAME;\
done

docx: init
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.docx; \
pandoc --standalone $$SMART $$f --output $(OUT_DIR)/$$FILE_NAME.docx; \
done

rtf: init
for f in $(IN_DIR)/*.md; do \
FILE_NAME=`basename $$f | sed 's/.md//g'`; \
echo $$FILE_NAME.rtf; \
pandoc --standalone $$SMART $$f --output $(OUT_DIR)/$$FILE_NAME.rtf; \
done

init: dir version

dir:
mkdir -p $(OUT_DIR)

version:
PANDOC_VERSION=`pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1`; \
if [ "$$PANDOC_VERSION" -eq "2" ]; then \
SMART=-smart; \
else \
SMART=--smart; \
fi \

clean:
rm build/*
rm -f $(OUT_DIR)/*
111 changes: 103 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,109 @@
The Markdown Resume
===================

Instructions:
### Instructions

git clone https://github.com/mszep/pandoc_resume
cd pandoc_resume
vim resume.md #insert your own resume info
make
```bash
git clone https://github.com/mszep/pandoc_resume
cd pandoc_resume
vim markdown/resume.md # insert your own resume info
```

Requirements:
#### Local

* ConTeXt
* pandoc
Make everything

```bash
make
```

Make specifics

```bash
make pdf
make html
```

#### Dockerized

Make everything

```bash
docker-compose up -d
```

### Requirements

If not using `docker` then you will need the following dependencies.

* ConTeXt 0.6x
* pandoc 2.x
* 1.x is deprecated

Last tested on the above versions and that's not to say the later versions won't work. Please try to use the latest versions when possible.

#### Debian / Ubuntu

```bash
sudo apt install pandoc context
```

#### Fedora
```bash
sudo dnf install pandoc texlive-collection-context
```

#### Arch
```bash
sudo pacman -S pandoc texlive
```

#### OSX
```bash
brew install pandoc
brew install --cask mactex
```

Make sure to add the directory `/Library/TeX/texbin/` to your path or `context` and `mtxrun` will not be found.

```
export PATH=$PATH:/Library/TeX/texbin/
```

#### Nix

Make sure to enable flakes, see [this](https://nixos.wiki/wiki/Flakes).

```bash
nix build
```

The built resume will end up in `./result`.

### Troubleshooting

#### Get versions

Check if the dependencies are up to date.

```
context --version
pandoc --version
```

#### Cannot process lua
Currently pandoc 1.x may be within your distro's repos and the latest version should be used. See the
[pandoc releases](https://github.com/jgm/pandoc/releases) for your distro.

e.g. for Debian / Ubuntu
```
wget https://github.com/jgm/pandoc/releases/download/2.2.1/pandoc-2.2.1-1-amd64.deb
sudo dpkg -i pandoc-2.2.1-1-amd64.deb
```

#### Context executable cannot be found
Some users have reported problems where their system does not properly find the ConTeXt
executable, leading to errors like `Cannot find context.lua` or similar. It has been found
that running `mtxrun --generate`, ([suggested on texlive-2011-context-problem](
https://tex.stackexchange.com/questions/53892/texlive-2011-context-problem)), can fix the
issue.
7 changes: 7 additions & 0 deletions actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# action.yml
name: 'Texlive Build'
description: 'Build a document using texlive'
runs:
using: 'docker'
image: 'docker://ghcr.io/mszep/pandoc_resume:master'
entrypoint: '/entrypoint.sh'
3 changes: 3 additions & 0 deletions actions/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

sh -c "cd /home/app/resume && make pdf"
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '2'

services:

resume-make:
build:
context: .
dockerfile: ./.docker/resume.dockerfile
container_name: resume-make
entrypoint: /entrypoint.sh
image: resume-make
volumes:
- .:/home/app/resume:z
Loading

0 comments on commit 2571132

Please sign in to comment.