Skip to content

acrlakshman/profileio-resume

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProfileIO Resume

LaTeX based resume generator for ProfileIO

How to use?

While profileio-resume is primarily designed to work with ProfileIO, it can be used standalone or in a different project. Basic usage looks as follows:

go get github.com/acrlakshman/profileio-resume
// main.go
package main

import (
	"io/ioutil"
	"log"
	"os"
	"os/exec"

	"github.com/acrlakshman/profileio-resume/profileio"
)

func main() {
	// For sample profile_resume.json, please refer to
	// "profileio-resume -> profileio -> samples -> profile_resume.json
	jsonData, _ := ioutil.ReadFile("./profile_resume.json")
	profileio.ProfileIO(jsonData)

	app := "xelatex"
	if !commandExists(app) {
		app = "pdflatex"
		if !commandExists(app) {
			log.Fatal("Cannot compile resume.tex")
		}
	}

	// profileio-resume, writes tex and cls files to a
	// folder "resume" in the current directory.
	os.Chdir("./resume")
	cmd := exec.Command(app, "resume.tex")
	_, err := cmd.Output()
	if err != nil {
		log.Fatal(err)
	}
}

func commandExists(cmd string) bool {
	_, err := exec.LookPath(cmd)

	return err == nil
}