User Guide¶
Command Line¶
For command line guide refer to Getting started
Quick API Walkthrough¶
Introduction¶
A resume contains two parts a sidebar and and a main body.
cliriculum.resume.Resume
The sidebar is divided in a contact section in the top corner and another section
(generally for skills).
contact
information is set via JSON file, to understand acceptable fields refer to
cliriculum.deserializers.Contact
The other section is defined by a markdown file .
The main section is generated by a markdown file and metadata files (JSON files).
Two “augmenting” files are accepted respectively one for location data (see cliriculum.deserializers.location
for available fields)
and one for date data (see cliriculum.deserializers.Dates
for available fields)
The contact file would look like:
{ "name":"cliriculum",
"profession": "cli",
"website": {
"url": "https://www.github.com/sondalex/cliriculum",
"text":"github.com/sondalex/cliriculum",
"classes":"fa-brands fa-github"
}
}
The file for the other section of sidebar would look like:
# Dependencies
* Mistletoe
* paged.js
The main file would look like:
# Resume builder
Build your resume with only Markdown and JSON.
If you wish more customization you can use `css`.
## A Python cli-tool
To generate the HTML representation of the resume:
# :tags: [remove-cell]
from cliriculum.resume import Resume
resume = Resume()
html = resume(sidebar_md=sidebar_md, main_md=main_md, contact=contact)
print(html)
<html>
<!doctype html>
<head>
<meta charset="UTF-8">
<title>HTML Resume</title>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="fontawesome/css/all.css" type="text/css">
<link rel="stylesheet" href="fontawesome/css/v4-shims.css" type="text/css">
<script src="paged.polyfill.js"></script>
<script src="style.js"></script>
</head>
<body><aside id="aside" class="aside">
<div class="contact" id="contact">
<div class="content">
<p>
<strong>cliriculum</strong>
</p><p>
<i>cli</i>
</p><div class="box">
<i class="fa-brands fa-github"></i>
<a href="https://www.github.com/sondalex/cliriculum">github.com/sondalex/cliriculum</a>
</div><div class="social">
</div>
</div>
</div>
<div class="description">
<div class="content">
<h1>Dependencies</h1><ul>
<li>Mistletoe</li>
<li>paged.js</li>
</ul>
</div>
</div>
</aside>
<main id = "main" class="main">
<div class="content">
<h1>Resume builder</h1><p>Build your resume with only Markdown and JSON.
If you wish more customization you can use <code>css</code>.</p><h2>A Python cli-tool</h2>
</div>
</main>
</body></html>
If you write this HTML to filesystem and serve it via an HTTP server, it won’t display correctly, because necessary web resources i.e css stylesheets and JS scripts were not copied.
A working HTML resume structure would look like this:
index.html
paged.polyfill.js
style.css
style.js
fontawesome/
- css/
- all.css
- v4-shims.css
cliriculum.utils.copy_resources
copies all those files except index.html
.
Therefore, to create a minimal working resume (note that resume/
should exist):
from cliriculum.utils import copy_resources
copy_resources("resume")
with open("resume/index.html", "w") as f:
f.write(html)
If you open a terminal and run:
cd resume/
python -m http.server
open the link with your browser (preferably Chromium based i.e. Chromium, Chrome, Brave, …) and you’ll see how your resume looks like.
You can then convert the resume to PDF in a web browser (generally with ctrl+p
or cmd+p
)
Automating PDF creation¶
To generate the PDF on the fly (for instance to automate the procedure) cliriculum.pdf.chromium_print
is the right utility.
from cliriculum.pdf import chromium_print
chromium_print(directory="resume", filename="output.pdf", verbose=True)
chromium --headless='new' --timeout=3000 --print-to-pdf=output.pdf --run-all-compositor-stages-before-draw --disable-gpu --no-first-run --no-default-browser-check --hide-scrollbars --no-sandbox --disable-setuid-sandbox --disable-software-rasterizer http://127.0.0.1:8000
[2061:2076:0901/132557.320319:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2076:0901/132557.320385:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2076:0901/132557.320551:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2076:0901/132557.320569:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2076:0901/132557.320580:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2076:0901/132557.663483:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2076:0901/132557.663505:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2061:2130:0901/132558.252852:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2061:2130:0901/132558.253084:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[2061:2130:0901/132558.253269:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
127.0.0.1 - - [01/Sep/2024 13:25:58] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:58] "GET /style.css HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:58] "GET /fontawesome/css/all.css HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:58] "GET /fontawesome/css/v4-shims.css HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:58] "GET /paged.polyfill.js HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:58] "GET /style.js HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:59] "GET /fontawesome/webfonts/fa-brands-400.woff2 HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:59] "GET /fontawesome/webfonts/fa-regular-400.woff2 HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:59] "GET /fontawesome/webfonts/fa-solid-900.woff2 HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:59] "GET /fontawesome/webfonts/fa-v4compatibility.woff2 HTTP/1.1" 200 -
127.0.0.1 - - [01/Sep/2024 13:25:59] code 404, message File not found
127.0.0.1 - - [01/Sep/2024 13:25:59] "GET /favicon.ico HTTP/1.1" 404 -
856 bytes written to file output.pdf
How it looks?¶
