Skip to content

Commit

Permalink
Added support for RenderCV output
Browse files Browse the repository at this point in the history
  • Loading branch information
guruor committed Aug 9, 2024
1 parent d0745c4 commit 6d3d065
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 80 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Rendering pdf
run: npm run to_pdf

- name: Rendering RenderCV output
run: npm run to_rendercv

- name: Set version as short sha
run: echo "VERSION=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

Expand Down Expand Up @@ -65,6 +68,8 @@ jobs:
mkdir gh-pages
cp release/resume.html gh-pages/index.html
cp release/resume.pdf gh-pages/
cp release/rendercv_output/*.html gh-pages/resume-mini.html
cp release/rendercv_output/*.pdf gh-pages/resume-mini.pdf
echo "resume.govind.guru" > gh-pages/CNAME
- name: Deploy to GitHub Pages
Expand Down
33 changes: 33 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { exec } from "node:child_process";
import { promisify } from "node:util";
const execAsync = promisify(exec);
import { promises as fs } from "node:fs";
import path from "node:path";
import * as theme from "jsonresume-theme-stackoverflow";
Expand Down Expand Up @@ -56,6 +59,34 @@ async function generatePdf() {
console.log("Generated PDF from HTML");
}

async function generateRenderCV() {
await convertYamlToJson();
console.log("Converting JSON resume format to renderCV");
const { conv_stdout, conv_stderr } = await execAsync(
`jsonresume_to_rendercv resume.json renderCVResume.yaml`,
{ cwd: RELEASE_DIR },
);

if (conv_stderr) {
console.error(`Error converting to RenderCV YAML format: ${conv_stderr}`);
return;
}

console.log(`RenderCV conversion output: ${conv_stdout}`);
console.log("Rendering RenderCV format");

const { stdout, stderr } = await execAsync(`rendercv render renderCVResume.yaml`, {
cwd: RELEASE_DIR,
});

if (stderr) {
console.error(`Error output from RenderCV: ${stderr}`);
return;
}

console.log(`RenderCV output: ${stdout}`);
}

const argv = yargs(hideBin(process.argv)).argv;

if (argv.json) {
Expand All @@ -64,4 +95,6 @@ if (argv.json) {
generateHtml();
} else if (argv.pdf) {
generatePdf();
} else if (argv.rendercv) {
generateRenderCV();
}
147 changes: 74 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"private": true,
"type": "module",
"scripts": {
"preinstall": "echo 'Installing RenderCV Dependencies...' && pip install jsonresume_to_rendercv rendercv",
"to_json": "node index.js --json",
"to_html": "node index.js --html",
"to_pdf": "node index.js --pdf"
"to_pdf": "node index.js --pdf",
"to_rendercv": "node index.js --rendercv"
},
"dependencies": {
"jsonresume-theme-stackoverflow": "^2.0.2",
Expand Down
12 changes: 6 additions & 6 deletions resume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ basics:
region: Rajasthan
countryCode: IN
profiles:
- network: LinkedIn
- network: linkedin
username: connectgovinds
url: https://www.linkedin.com/in/connectgovinds
- network: Github
- network: github
username: guruor
url: https://www.github.com/guruor
- network: Calendly
username: connect-govinds
url: https://calendly.com/connect-govinds
# - network: calendly
# username: connect-govinds
# url: https://calendly.com/connect-govinds
# - network: HackerRank
# username: govindsinghr3
# url: https://www.hackerrank.com/govindsinghr3
Expand Down Expand Up @@ -117,7 +117,7 @@ skills:
- MongoDB
- Firebase
- ClickHouse
- name: Tools
- name: Software
keywords:
- Git
- Vim
Expand Down

0 comments on commit 6d3d065

Please sign in to comment.