• Stars
    star
    271
  • Rank 151,717 (Top 3 %)
  • Language
    JavaScript
  • Created almost 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A toolkit for building your CV with JSON and creating stylish HTML/PDF files.

jsoncv

A toolkit for building your CV with JSON and creating stylish HTML/PDF files.

jsoncv comprises the following components:

  1. Schema
  2. Editor
  3. CV HTML
  4. Converters

For in-depth explanations and usage guidelines, please refer to the documentation below.

Introduction

Schema

jsoncv use JSON Schema to create JSON-based standard for CVs.

The schema used in jsoncv is a fork of the JSON Resume Schema, with the following differences:

  • JSON Schema version

    JSON Resume utilizes the outdated draft-04 version, while jsoncv uses the current draft-07. To ensure compatibility with draft-07, all instances of additionalItems have been removed.

  • Additional sideProjects section

    jsoncv includes an additional section, called sideProjects, that allows for the distinction between side projects and career projects

  • Additional name property in meta section

    jsoncv includes a name property in the meta section, which allows the user to specify the desired name for exported HTML/PDF files.

These differences do not impact the compatibility between jsoncv and JSON Resume. This means that you can easily import JSON Resume data into jsoncv and vice versa, as jsoncv data will pass the validation of JSON Resume Schema .

The complete diff between the JSON Resume schema and the jsoncv schema can be viewed here

Editor

jsoncv comes with an online editor that provides a graphical user interface for creating and editing your jsoncv data. Visit it at https://jsoncv.reorx.com/editor/.

The Editor consists of three panes, from left to right:

  1. Sidebar

    Allows navigation to different sections in the schema form and provides operations such as "Download HTML" and "Upload Data"

  2. Schema Form

    Lets you edit the properties of your CV data. You can also select which properties to display or hide.

  3. Preview

    Displays the rendered CV HTML as changes are made in the Schema Form.

CV HTML

The core product of jsoncv is CV HTML, which is the HTML representation of your jsoncv data. It is a compact, single-file HTML document that can be converted to PDF or hosted online to create a static CV website.

CV HTML is designed with a specific layout to display a CV on an A4 sheet of paper. The CSS has been tailored to optimize printing, ensuring the best typography whether printed on paper or saved as a PDF. Therefore, CV HTML is best suited for creating professional or academic CVs/resumes, rather than creative or interactive portfolio websites.

CV HTMl supports themes, which can be found in the src/themes directory.

To get CV HTML, please refer to Export CV data and HTML and Build HTML locally

Converters

Converters are scripts to help user converting jsoncv data from/to other sources.

Currently, there is only one converter available: rxresume-to-jsoncv.js, which converts data exported from RxResume into the jsoncv format.

If you have any additional requirements, please feel free to submit an issue. Pull requests are also greatly appreciated.

Usage

Write your CV

It is recommended to write your CV using the online Editor. However, if you are comfortable with JSON, you can maintain the data file using a text editor on your local machine.

When you open the Editor for the first time, a sample data is loaded. You can either edit it or click the "New Data" button to start with an empty form. Your CV data is saved in your browser every time you make a change, so you don't have to worry about losing your work.

If you already have a local copy of your CV data, you can click the "Upload Data" button to load it into the Editor.

Export CV data and HTML

Once you have finished editing, you can click the Download JSON button to export your CV data in JSON format.

If you want to export the rendered HTML in the Preview pane, simply click the Download HTML button.

Please note that you can name the exported files by adding the meta.name property. If it is not specified, the filename will be constructed using a combination of basics.name and meta.version.

Convert HTML to PDF

To keep things simple, jsoncv does not include or use any external tools to generate PDFs. Instead, you should use the generated HTML file to convert it to a PDF document. The only requirement is a modern browser; the steps below use Google Chrome as an example:

  1. Open the generated HTML file in Chrome.

  2. Press ⌘ P (or βŒƒ P in Windows), and the Print dialog will open.

  3. In the dialog, select "Destination" as "Save as PDF" and make sure all items in "Options" are unchecked.

  4. Click "Save" to save the PDF file in your file system.

Please note that the PDF exported from Chrome may have some issues with text copying. For more information, see the FAQ section.

Build HTML locally

jsoncv uses Vite as its static-site building tool. The index.html file in the root of the project is the entry point for builing a single-file CV HTML.

Here are the steps to build a CV HTML using your own data:

  1. Make sure that you are using NodeJS version 18 or higher.

  2. Install the dependencies by running: npm run install

  3. Build your CV HTML by specifying DATA_FILENAME and OUT_DIR environment variables:

    DATA_FILENAME="$HOME/Downloads/mycv/cv.json" OUT_DIR="$HOME/Downloads/mycv" npm run build
    

    This will build your CV HTML using the data file located at $HOME/Downloads/mycv/cv.json, and the generated HTML will be located in the $HOME/Downloads/mycv directory.

The following environment variables are supported in the build process:

  • DATA_FILENAME: The CV data to use, can be a relative or absolute path.
  • OUT_DIR: The output directory for the generated HTML file.
  • THEME: The theme to use, must be one of the directory name in src/themes/.

To customize the primary color of the theme, modify the --primary-color CSS variable in index.scss. Note that making this change will result in unstaged changes in Git. If you want to build the HTML yourself, it is recommended that you create a new project instead of editing the source code in jsoncv. For instructions on how to do this, please refer to the Build a static CV site section.

Build a static CV site

The generated index.html file can be used anywhere and on any hosting platform. Simply upload it to a web server, and you will have your own online CV site. The built-in theme "reorx" also includes responsive support for mobile devices.

However, if you want extra customization, like the CV site at https://cv.reorx.com/ which has a footer with links to the PDF file and the author's home page, you can follow these steps:

  1. Create an empty repository

  2. Add jsoncv as the submodule

    git submodule add https://github.com/reorx/jsoncv.git
    
  3. Put your CV data file, for example cv.json, in the project.

  4. Initialize package.json by running npm init.

  5. Install jsoncv as a dependency by running npm i ./jsoncv.

  6. Copy the scripts and devDependencies from ./jsoncv/package.json to package.json, and then run npm i to install them.

  7. Copy ./jsoncv/vite.json.js to vite.json.js and make the following changes:

    • Change all instances of ./src to ./jsoncv/src.
    • Change the value of dataFilename to your CV data file, for example cv.json.
    • Change renderData.theme to the theme you want to use.
  8. Copy ./jsoncv/index.html to index.html and change all instances of ./src to ./jsoncv/src. Then Copy ./jsoncv/index.scss to index.scss.

  9. Run npm run build to test if everything works.

After completing these steps, you can now add your own elements and styles to index.html and index.scss to further customize your CV website. You can use HTML, CSS, and JavaScript to add your own branding, layout, and functionality to the site.

Create your own theme

jsoncv includes several built-in themes that you can use either directly in the Editor or when building the static CV site. If you want to create your own custom theme, here is how:

The file system hierarchy for themes is as follows:

src/themes
└── reorx
 Β Β  β”œβ”€β”€ index.ejs
 Β Β  └── index.scss

You can add your own theme by creating a new folder under src/themes with index.ejs and index.scss files.

index.ejs is an ejs template used for constructing the CV content. The data that is passed to the template is structured as follows:

  • cv: the entire jsoncv data that conforms to the jsoncv schema
  • fn: a set of utility functions
    • getCVTitle: gets the CV title from cv data
    • reformatDate: transforms a date string to a specified format
    • getIconSVG: gets the iconify SVG string or DOM element from the icon name
    • noSchemaURL: remove the schema (https://) prefix of the url

For more information, see the complete definition in src/themes/data.js.

Once you have created a new theme (let's use yourtheme as an example), you can start developing and previewing it by running the following code:

THEME=yourtheme npm run dev-site

Pull requests for adding new themes are always welcomed.

You can just name the theme after your own name, this is what I did for the theme "reorx". Because I think that theme is tightly bound to the developer's aesthetic and personal taste, and common words may not accurately represent the theme.

Tech stack

  • vite
  • ejs
  • scss
  • iconify
  • ajv

FAQ

Text copied from the PDF is reversed

Yes, this is a known issue with Chrome's "Save as PDF" feature. The resulting PDFs can have text that is backwards when copied in Preview.app on MacOS.

This issue has been reported by several users and is not specific to jsoncv. As seen in: "Save as PDF" produces documents with backwards text. - Google Chrome Community

Solution: Use Firefox or Safari to get the PDF

The order of properties in the exported JSON changes sometimes

See Does JavaScript guarantee object property order? - Stack Overflow

TODO

  • Supports Markdown in summary and description properties
  • Allows customizing primary color for the current theme
  • Export PDF directly (using browser's print feature)
  • Supports responsive style for themes, so that the CV site is friendly to view on mobile devices.
  • Add more themes.
  • Allows switching themes in Editor
  • Add more sample data. By clicking the "Load Sample" button, a dialog will open, allowing the user to select from various languages

Credits

jsoncv could not be made possible without these awesome projects below:

Donation

If you think this project is enjoyable to use, or saves some time, consider giving me a cup of coffee :)

More Repositories

1

httpstat

curl statistics made simple
Python
5,954
star
2

awesome-chatgpt-api

Curated list of apps and tools that not only use the new ChatGPT API, but also allow users to configure their own API keys, enabling free and on-demand usage of their own quota.
Python
5,900
star
3

sui2

a startpage for your server and / or new tab page
JavaScript
389
star
4

Share-to-ChatGPT-Shortcut

An Apple Shortcut for sharing text to ChatGPT using personalized prompts
315
star
5

obsidian-paste-image-rename

Renames pasted images and all the other attachments added to the vault
TypeScript
272
star
6

cht-colors

Chinese Traditional Colors
HTML
218
star
7

ai.py

A single-file Python script that interacts with ChatGPT API in the command-line.
Python
115
star
8

python-terminal-color

Drop-in single file library for printing color in terminal
Python
71
star
9

minimal-bilibili

η»™δ½ ηΊ―ε‡€ηš„ Bilibili θ§†ι’‘ε‘ηŽ°δ½“ιͺŒ
TypeScript
61
star
10

torext

[WORKING ON] The missing tornado mate
Python
61
star
11

xiami_exporter

Export your data from Xiami
JavaScript
59
star
12

n8n-workflows

My workflows for n8n automation
Python
44
star
13

github-toc-sidebar

Show GitHub Readme TOC as a sidebar
TypeScript
44
star
14

obsidian-telegraph-publish

Publish your Obsidian note to a Telegraph page.
TypeScript
43
star
15

obsidian-people-link

Easily create links to people within your documents.
TypeScript
38
star
16

refgen

JavaScript
34
star
17

flomo-to-obsidian

JavaScript
31
star
18

cx-extractor

Automatically exported from code.google.com/p/cx-extractor
HTML
29
star
19

autotagger

Tag .mp3 and .m4a audio files from iTunes data automatically.
Python
29
star
20

obsidian-daily-notes-opener

Easily open daily notes and periodic notes in new pane; customize periodic notes background; quick append new line to daily notes.
TypeScript
25
star
21

substance

Extract substance from the web
HTML
23
star
22

project_sketch

A nerd's boilerplate for your Python project.
Python
20
star
23

readability

html main body extractor
HTML
17
star
24

dotfiles

my rcs
Vim Script
15
star
25

deptest

dependent testing framework
Python
15
star
26

chatroom

simple chatroom using tornado long polling feature
JavaScript
14
star
27

rdl

Redis dump & load tool.
Python
12
star
28

squared

JavaScript
11
star
29

tako

A simple task manager in Django
Python
10
star
30

simplemongo

A Simple & Clear MongoDB ORM
Python
9
star
31

ts

Twitter Search CLI
Python
9
star
32

xiamifav

xiami html5 client
JavaScript
7
star
33

miniflux-on-railway

miniflux deployed on railway.app
Python
7
star
34

drawtable

Draw ASCII art box with text.
Python
7
star
35

getenv

Environment variable definition with type
Python
7
star
36

userscripts

My UserScripts
JavaScript
7
star
37

blog

HTML
6
star
38

params

A Python package that does better in request parameters validation than django.forms, wtforms, web_args or so.
Python
6
star
39

n8n-on-railway

Shell
6
star
40

eurasia

Automatically exported from code.google.com/p/eurasia
Python
5
star
41

things-to-ticktick

Export tasks from Things.app to TickTick format
Shell
5
star
42

pyconv

Text file code conversion tool
Python
4
star
43

cv

My CV site.
JavaScript
4
star
44

dbflip

flip reading for douban note
JavaScript
4
star
45

beatles

Data and tools to enjoy The Beatles better.
Python
4
star
46

feishu-exporter

Export Feishu docs with ease
JavaScript
4
star
47

rss-filter

Modify and regenerate RSS source piped in
TypeScript
4
star
48

papermodx-example

HTML
3
star
49

V2EXWitch

Chrome Extension - V2EX Account Switcher & Notifier
JavaScript
3
star
50

python-playground

Python
3
star
51

scripts

miscellaneous scripts I use
Python
3
star
52

litekv

Simple kv store for Python
Python
3
star
53

window-opener

TypeScript
3
star
54

pex_uwsgi_demo

Python
3
star
55

json_include

An extension for JSON to support file including
Python
3
star
56

fuload

Automatically exported from code.google.com/p/fuload
C++
2
star
57

gouken

Go microservice framework built on top of grpc
Go
2
star
58

django_starter_pack

My personal starter pack for Django projects
Python
2
star
59

minireact

A minimal react project boilerplate
JavaScript
2
star
60

stexplorer

Download songs from SongTaste
Python
2
star
61

learn_applescript

Notes & code pieces recorded during my exploration to AppleScript.
AppleScript
2
star
62

gopkg_opml

Python
1
star
63

qdan-archives

my archives on qdan.me
CSS
1
star
64

rime_dict

Tools for manipulating userdict of rime input method
Python
1
star
65

pinback

Pinboard backup tool
Python
1
star
66

apibox

[WORKING ON] Building blocks for HTTP API development
Python
1
star
67

learn_spider

Practicing code to learn to write a spider
Python
1
star
68

whuspec

My graduation project.
HTML
1
star
69

obsidian-chatgpt

TypeScript
1
star
70

go-to-douban

I am Xiao Meng, and I want to work in Douban, I create this repository for announcing and yelling
1
star
71

start

Shell
1
star
72

python-installer

Shell
1
star
73

printable-css

HTML
1
star
74

kindle_ebook_template

for publishing kindle ebook - specially for chinese
1
star
75

quiverweb

Web service for Quiver note app
Python
1
star
76

pinyindep

essentials for implement pinyin transforming capability in your projects with python
Python
1
star
77

gatsby-starter-netlify-cms

JavaScript
1
star
78

webpack-chrome-boilerplate

A boilerplate for building Chrome extensions with Webpack
TypeScript
1
star
79

alfred-workflows

my alfred workflows
Python
1
star
80

awesome-javascript-editors

A collection of awesome javascript editors
1
star
81

torext-admin

Python
1
star
82

html-cutter

A Chrome extension to cut out HTML fragments from a page.
JavaScript
1
star
83

aima-python

Automatically exported from code.google.com/p/aima-python
Python
1
star
84

simplate

Created with CodeSandbox
JavaScript
1
star
85

tomorrow

A new task scheduler, aimed at quick, clean, and clear
1
star
86

SMU-MScCDA-ProgrammingTest-2023

Python
1
star
87

n8n-on-fly

1
star
88

proto-typist

generate proto code from proto code
Python
1
star
89

project-nowhere

Automatically exported from code.google.com/p/project-nowhere
PHP
1
star
90

nasdaqtrader-rss

Python
1
star