@bafif/foja 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.es.md +40 -0
- package/README.md +39 -2
- package/dist/foja.mjs +29255 -0
- package/dist/template/fonts/GUST-FONT-LICENSE.txt +29 -0
- package/dist/template/fonts/NotoSans-Bold.ttf +0 -0
- package/dist/template/fonts/NotoSans-BoldItalic.ttf +0 -0
- package/dist/template/fonts/NotoSans-Italic.ttf +0 -0
- package/dist/template/fonts/NotoSans-LICENSE.txt +94 -0
- package/dist/template/fonts/NotoSans-Medium.ttf +0 -0
- package/dist/template/fonts/NotoSans-Regular.ttf +0 -0
- package/dist/template/fonts/XCharter-Bold.otf +0 -0
- package/dist/template/fonts/XCharter-BoldItalic.otf +0 -0
- package/dist/template/fonts/XCharter-Italic.otf +0 -0
- package/dist/template/fonts/XCharter-LICENSE.txt +14 -0
- package/dist/template/fonts/XCharter-Roman.otf +0 -0
- package/dist/template/fonts/lmmono9-regular.otf +0 -0
- package/dist/template/labels.json +86 -0
- package/dist/template/lib.typ +233 -0
- package/dist/template/styles/arco.typ +177 -0
- package/dist/template/styles/banda.typ +97 -0
- package/dist/template/styles/claustro.typ +91 -0
- package/dist/template/styles/legajo.typ +155 -0
- package/dist/template/styles/llano.typ +80 -0
- package/dist/template/styles/minimal.typ +87 -0
- package/dist/template/styles/portada.typ +132 -0
- package/dist/template/styles/recto.typ +86 -0
- package/dist/template/styles/rotulo.typ +146 -0
- package/dist/template/styles.json +59 -0
- package/package.json +44 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
% This is version 1.0, dated 22 June 2009, of the GUST Font License.
|
|
2
|
+
% (GUST is the Polish TeX Users Group, https://www.gust.org.pl)
|
|
3
|
+
%
|
|
4
|
+
% For the most recent version of this license see
|
|
5
|
+
% https://www.gust.org.pl/fonts/licenses/GUST-FONT-LICENSE.txt
|
|
6
|
+
% or
|
|
7
|
+
% https://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt
|
|
8
|
+
%
|
|
9
|
+
% This work may be distributed and/or modified under the conditions
|
|
10
|
+
% of the LaTeX Project Public License, either version 1.3c of this
|
|
11
|
+
% license or (at your option) any later version.
|
|
12
|
+
%
|
|
13
|
+
% Please also observe the following clause:
|
|
14
|
+
% 1) it is requested, but not legally required, that derived works be
|
|
15
|
+
% distributed only after changing the names of the fonts comprising this
|
|
16
|
+
% work and given in an accompanying "manifest", and that the
|
|
17
|
+
% files comprising the Work, as listed in the manifest, also be given
|
|
18
|
+
% new names. Any exceptions to this request are also given in the
|
|
19
|
+
% manifest.
|
|
20
|
+
%
|
|
21
|
+
% We recommend the manifest be given in a separate file named
|
|
22
|
+
% MANIFEST-<fontid>.txt, where <fontid> is some unique identification
|
|
23
|
+
% of the font family. If a separate "readme" file accompanies the Work,
|
|
24
|
+
% we recommend a name of the form README-<fontid>.txt.
|
|
25
|
+
%
|
|
26
|
+
% The latest version of the LaTeX Project Public License is in
|
|
27
|
+
% https://www.latex-project.org/lppl.txt and version 1.3c or later
|
|
28
|
+
% is part of all distributions of LaTeX version 2006/05/20 or later.
|
|
29
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Noto Sans: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic).
|
|
2
|
+
Subset to Latin (and unhinted) for Foja.
|
|
3
|
+
|
|
4
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
5
|
+
This license is copied below, and is also available with a FAQ at:
|
|
6
|
+
http://scripts.sil.org/OFL
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
11
|
+
-----------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
PREAMBLE
|
|
14
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
15
|
+
development of collaborative font projects, to support the font creation
|
|
16
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
17
|
+
open framework in which fonts may be shared and improved in partnership
|
|
18
|
+
with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
22
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply
|
|
27
|
+
to any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
DEFINITIONS
|
|
30
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
31
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
32
|
+
include source files, build scripts and documentation.
|
|
33
|
+
|
|
34
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
35
|
+
copyright statement(s).
|
|
36
|
+
|
|
37
|
+
"Original Version" refers to the collection of Font Software components as
|
|
38
|
+
distributed by the Copyright Holder(s).
|
|
39
|
+
|
|
40
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
41
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
42
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
43
|
+
new environment.
|
|
44
|
+
|
|
45
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
46
|
+
writer or other person who contributed to the Font Software.
|
|
47
|
+
|
|
48
|
+
PERMISSION & CONDITIONS
|
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
50
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
51
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
52
|
+
Software, subject to the following conditions:
|
|
53
|
+
|
|
54
|
+
1) Neither the Font Software nor any of its individual components,
|
|
55
|
+
in Original or Modified Versions, may be sold by itself.
|
|
56
|
+
|
|
57
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
58
|
+
redistributed and/or sold with any software, provided that each copy
|
|
59
|
+
contains the above copyright notice and this license. These can be
|
|
60
|
+
included either as stand-alone text files, human-readable headers or
|
|
61
|
+
in the appropriate machine-readable metadata fields within text or
|
|
62
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
63
|
+
|
|
64
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
65
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
66
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
67
|
+
presented to the users.
|
|
68
|
+
|
|
69
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
70
|
+
Software shall not be used to promote, endorse or advertise any
|
|
71
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
72
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
73
|
+
permission.
|
|
74
|
+
|
|
75
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
76
|
+
must be distributed entirely under this license, and must not be
|
|
77
|
+
distributed under any other license. The requirement for fonts to
|
|
78
|
+
remain under this license does not apply to any document created
|
|
79
|
+
using the Font Software.
|
|
80
|
+
|
|
81
|
+
TERMINATION
|
|
82
|
+
This license becomes null and void if any of the above conditions are
|
|
83
|
+
not met.
|
|
84
|
+
|
|
85
|
+
DISCLAIMER
|
|
86
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
87
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
88
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
89
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
90
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
91
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
92
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
93
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
94
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Original Bitstream Free font license:
|
|
2
|
+
|
|
3
|
+
(c) Copyright 1989-1992, Bitstream Inc., Cambridge, MA.
|
|
4
|
+
|
|
5
|
+
You are hereby granted permission under all Bitstream propriety rights
|
|
6
|
+
to use, copy, modify, sublicense, sell, and redistribute the 4
|
|
7
|
+
Bitstream Charter (r) Type 1 outline fonts for any purpose and without
|
|
8
|
+
restriction; provided, that this notice is left intact on all copies
|
|
9
|
+
of such fonts and that Bitstream's trademark is acknowledged as shown
|
|
10
|
+
below on all unmodified copies of the 4 Charter Type 1 fonts.
|
|
11
|
+
|
|
12
|
+
BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
|
|
13
|
+
|
|
14
|
+
Portions of the font modifications are Copyright (c) 2009--2012, Andrey Panov; Copyright (c) 2013--2024, Michael Sharpe.
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"es": {
|
|
3
|
+
"profile": "Perfil",
|
|
4
|
+
"contact": "Contacto",
|
|
5
|
+
"skills": "Habilidades",
|
|
6
|
+
"present": "actualidad",
|
|
7
|
+
"months": [
|
|
8
|
+
"ene",
|
|
9
|
+
"feb",
|
|
10
|
+
"mar",
|
|
11
|
+
"abr",
|
|
12
|
+
"may",
|
|
13
|
+
"jun",
|
|
14
|
+
"jul",
|
|
15
|
+
"ago",
|
|
16
|
+
"sep",
|
|
17
|
+
"oct",
|
|
18
|
+
"nov",
|
|
19
|
+
"dic"
|
|
20
|
+
],
|
|
21
|
+
"contacts": {
|
|
22
|
+
"phone": "Teléfono",
|
|
23
|
+
"email": "Correo",
|
|
24
|
+
"website": "Web",
|
|
25
|
+
"github": "GitHub",
|
|
26
|
+
"linkedin": "LinkedIn",
|
|
27
|
+
"location": "Ubicación"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"en": {
|
|
31
|
+
"profile": "Profile",
|
|
32
|
+
"contact": "Contact",
|
|
33
|
+
"skills": "Skills",
|
|
34
|
+
"present": "present",
|
|
35
|
+
"months": [
|
|
36
|
+
"Jan",
|
|
37
|
+
"Feb",
|
|
38
|
+
"Mar",
|
|
39
|
+
"Apr",
|
|
40
|
+
"May",
|
|
41
|
+
"Jun",
|
|
42
|
+
"Jul",
|
|
43
|
+
"Aug",
|
|
44
|
+
"Sep",
|
|
45
|
+
"Oct",
|
|
46
|
+
"Nov",
|
|
47
|
+
"Dec"
|
|
48
|
+
],
|
|
49
|
+
"contacts": {
|
|
50
|
+
"phone": "Phone",
|
|
51
|
+
"email": "Email",
|
|
52
|
+
"website": "Website",
|
|
53
|
+
"github": "GitHub",
|
|
54
|
+
"linkedin": "LinkedIn",
|
|
55
|
+
"location": "Location"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"pt": {
|
|
59
|
+
"profile": "Perfil",
|
|
60
|
+
"contact": "Contato",
|
|
61
|
+
"skills": "Competências",
|
|
62
|
+
"present": "atual",
|
|
63
|
+
"months": [
|
|
64
|
+
"jan",
|
|
65
|
+
"fev",
|
|
66
|
+
"mar",
|
|
67
|
+
"abr",
|
|
68
|
+
"mai",
|
|
69
|
+
"jun",
|
|
70
|
+
"jul",
|
|
71
|
+
"ago",
|
|
72
|
+
"set",
|
|
73
|
+
"out",
|
|
74
|
+
"nov",
|
|
75
|
+
"dez"
|
|
76
|
+
],
|
|
77
|
+
"contacts": {
|
|
78
|
+
"phone": "Telefone",
|
|
79
|
+
"email": "E-mail",
|
|
80
|
+
"website": "Site",
|
|
81
|
+
"github": "GitHub",
|
|
82
|
+
"linkedin": "LinkedIn",
|
|
83
|
+
"location": "Localização"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// Foja's template library. Every CV style, the built-in ones and those people write themselves,
|
|
2
|
+
// is a Typst file that starts with
|
|
3
|
+
//
|
|
4
|
+
// #import "/lib.typ": *
|
|
5
|
+
//
|
|
6
|
+
// and lays out `cv`, the profile being built, already resolved: entries looked up, dates
|
|
7
|
+
// formatted, labels in the CV's language, contacts with their links. The marks (`anchored`) and
|
|
8
|
+
// the column geometry (`geometry`) are what the editor uses for click-to-edit and the page-fit
|
|
9
|
+
// badge; a style works without them, those two features just do not.
|
|
10
|
+
//
|
|
11
|
+
// Inputs (`sys.inputs`): `project`, path of the project JSON (default `/project.json`), and
|
|
12
|
+
// `profile`, the id of the profile to lay out (default: the first one). The photo is a file under
|
|
13
|
+
// `/assets/`.
|
|
14
|
+
|
|
15
|
+
#let project = json(sys.inputs.at("project", default: "/project.json"))
|
|
16
|
+
#let profile-id = sys.inputs.at("profile", default: project.profiles.keys().first())
|
|
17
|
+
#let profile = project.profiles.at(profile-id)
|
|
18
|
+
#let layout = profile.at("layout", default: (:))
|
|
19
|
+
|
|
20
|
+
/// A layout option of the profile, or `default` when it is not set.
|
|
21
|
+
#let opt(key, default) = layout.at(key, default: default)
|
|
22
|
+
|
|
23
|
+
#let all-labels = json("/labels.json")
|
|
24
|
+
#let lang = project.language.split("-").first()
|
|
25
|
+
/// Fixed words in the CV's language: `labels.profile`, `labels.contact`, `labels.skills`,
|
|
26
|
+
/// `labels.present`, `labels.months`, `labels.contacts.<kind>`.
|
|
27
|
+
#let labels = all-labels.at(opt("labels", lang), default: all-labels.en)
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------- text and dates
|
|
30
|
+
|
|
31
|
+
/// A plain string where `**bold**` spans become strong.
|
|
32
|
+
#let inline(s) = s.split("**").enumerate().map(((i, part)) => if calc.odd(i) { strong(part) } else { part }).join()
|
|
33
|
+
|
|
34
|
+
/// `2026-05` in the profile's date format: `05/2026`, `may 2026` or `2026`.
|
|
35
|
+
#let month(value) = {
|
|
36
|
+
// An incomplete date (the editor may store one while it is being typed) shows as is.
|
|
37
|
+
if type(value) != str or value.split("-").len() != 2 { return if type(value) == str { value } else { "" } }
|
|
38
|
+
let (year, m) = value.split("-")
|
|
39
|
+
let format = opt("dateFormat", "MM/YYYY")
|
|
40
|
+
if format == "YYYY" { year } else if format == "MMM YYYY" { labels.months.at(int(m) - 1) + " " + year } else {
|
|
41
|
+
m + "/" + year
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// The period of an entry: `start` alone is a single date, `end: none` means ongoing.
|
|
46
|
+
#let period(e) = {
|
|
47
|
+
if "start" not in e { return "" }
|
|
48
|
+
if "end" not in e { return month(e.start) }
|
|
49
|
+
let start = month(e.start)
|
|
50
|
+
let end = if e.end == none { labels.present } else { month(e.end) }
|
|
51
|
+
if start == end { start } else { start + " – " + end }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// The text of an item, with its heading in bold.
|
|
55
|
+
#let item-body(it) = {
|
|
56
|
+
if it.at("heading", default: none) != none { strong(it.heading + ".") + " " }
|
|
57
|
+
inline(it.text)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ---------------------------------------------------------------- options
|
|
61
|
+
|
|
62
|
+
/// The accent colour: the profile's, or the style's `default`.
|
|
63
|
+
#let accent(default) = if "accent" in layout { rgb(layout.accent) } else { default }
|
|
64
|
+
/// Body size in points (`fontSize`, default 10).
|
|
65
|
+
#let base-size = opt("fontSize", 10) * 1pt
|
|
66
|
+
/// Spacing factor of the `density` option: 0.7, 1 or 1.3.
|
|
67
|
+
#let density = (compact: 0.7, normal: 1, relaxed: 1.3).at(opt("density", "normal"))
|
|
68
|
+
/// Page size of the `paper` option.
|
|
69
|
+
#let paper = if opt("paper", "a4") == "a4" { (width: 210mm, height: 297mm) } else { (width: 215.9mm, height: 279.4mm) }
|
|
70
|
+
/// The margins: the profile's (in mm), each falling back to the style's `default` (also in mm).
|
|
71
|
+
#let margins(default) = {
|
|
72
|
+
let m = layout.at("margins", default: (:))
|
|
73
|
+
(
|
|
74
|
+
top: m.at("top", default: default.top) * 1mm,
|
|
75
|
+
bottom: m.at("bottom", default: default.bottom) * 1mm,
|
|
76
|
+
left: m.at("left", default: default.left) * 1mm,
|
|
77
|
+
right: m.at("right", default: default.right) * 1mm,
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ---------------------------------------------------------------- marks for the editor
|
|
82
|
+
|
|
83
|
+
/// An invisible marker; `anchored` puts one at each end of a part.
|
|
84
|
+
#let mark(path, kind, column) = context [#metadata((
|
|
85
|
+
path: path,
|
|
86
|
+
kind: kind,
|
|
87
|
+
column: column,
|
|
88
|
+
page: here().page(),
|
|
89
|
+
x: here().position().x.pt(),
|
|
90
|
+
y: here().position().y.pt(),
|
|
91
|
+
))<foja>]
|
|
92
|
+
|
|
93
|
+
/// `body`, marked as the part at `path` (e.g. `cv.sections.at(0).path`) in `column` ("main" or
|
|
94
|
+
/// "side"), so that a click on it in the editor opens that part.
|
|
95
|
+
#let anchored(path, body, column: "main") = {
|
|
96
|
+
mark(path, "start", column)
|
|
97
|
+
body
|
|
98
|
+
mark(path, "end", column)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/// Declares where the columns are on the page (from the left edge), for the editor to know the
|
|
102
|
+
/// width of a marked part: `geometry(main: (x: 200pt, width: 360pt), side: (x: 34pt, width: 150pt))`.
|
|
103
|
+
#let geometry(main: none, side: none) = {
|
|
104
|
+
let pt(c) = if c == none { none } else { (x: c.x.pt(), width: c.width.pt()) }
|
|
105
|
+
[#metadata((main: pt(main), side: pt(side)))<foja-geometry>]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ---------------------------------------------------------------- what of the bank goes in
|
|
109
|
+
|
|
110
|
+
// The same rules as packages/core/src/select.ts, which the other exports use: keep both in step.
|
|
111
|
+
// Each entry, item and skill has a priority (`essential`, `normal`, `extra`); the profile's length
|
|
112
|
+
// says which go in, and its overrides make the exceptions.
|
|
113
|
+
|
|
114
|
+
#let length = opt("length", "normal")
|
|
115
|
+
#let shown-priorities = (short: ("essential",), normal: ("essential", "normal"), full: ("essential", "normal", "extra")).at(
|
|
116
|
+
length,
|
|
117
|
+
default: ("essential", "normal"),
|
|
118
|
+
)
|
|
119
|
+
#let overrides = profile.at("overrides", default: (:))
|
|
120
|
+
|
|
121
|
+
/// Whether the thing of the bank at `key` (`entries/<id>`, `entries/<id>/items/<id>` or
|
|
122
|
+
/// `skills/<group>/<id>`) goes in the profile: its override, or the length rule.
|
|
123
|
+
#let shown(key, thing) = {
|
|
124
|
+
let override = overrides.at(key, default: none)
|
|
125
|
+
if type(override) == bool { override } else { thing.at("priority", default: "normal") in shown-priorities }
|
|
126
|
+
}
|
|
127
|
+
#let block-shown(b) = b.type != "entry" or shown("entries/" + b.entry, project.entries.at(b.entry))
|
|
128
|
+
#let summary-short = profile.at("summaryShort", default: "")
|
|
129
|
+
#let uses-short-summary = (
|
|
130
|
+
opt("summaryLength", if length == "short" { "short" } else { "long" }) == "short" and summary-short.trim() != ""
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
// ---------------------------------------------------------------- the CV, resolved
|
|
134
|
+
|
|
135
|
+
#let link-for(kind, value) = {
|
|
136
|
+
if kind == "email" { "mailto:" + value } else if kind in ("website", "github", "linkedin") {
|
|
137
|
+
if value.starts-with("http") { value } else { "https://" + value }
|
|
138
|
+
} else { none }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/// Everything a style lays out:
|
|
142
|
+
/// - `name`, `given`, `family`, `subtitle`, `summary` (may be ""), `highlight` (`(title, text)` or none);
|
|
143
|
+
/// - `photo` (a path for `image`, or none) and `photo-shape` ("square", "rounded", "circle");
|
|
144
|
+
/// - `contacts`: array of `(kind, label, value, link)` (`link` is none for phone and location);
|
|
145
|
+
/// - `skills`: rows of groups `(title, items)`; a row with several groups goes side by side;
|
|
146
|
+
/// - `sections`: array of `(index, path, id, title, side, compact, blocks)`; `side` is true for
|
|
147
|
+
/// sections meant for a sidebar; each block is either
|
|
148
|
+
/// `(type: "entry", path, id, title, place, period, note, items)` or
|
|
149
|
+
/// `(type: "item" | "paragraph", path, heading, text)`.
|
|
150
|
+
#let cv = {
|
|
151
|
+
let person = project.person
|
|
152
|
+
let photo-name = person.at("photo", default: none)
|
|
153
|
+
(
|
|
154
|
+
name: (person.givenNames + person.familyNames).join(" "),
|
|
155
|
+
given: person.givenNames.join(" "),
|
|
156
|
+
family: person.familyNames.join(" "),
|
|
157
|
+
subtitle: profile.subtitle,
|
|
158
|
+
summary: if uses-short-summary { summary-short } else { profile.summary },
|
|
159
|
+
highlight: profile.at("highlight", default: none),
|
|
160
|
+
photo: if photo-name == none or opt("photo", "square") == "none" { none } else { "/assets/" + photo-name },
|
|
161
|
+
photo-shape: opt("photo", "square"),
|
|
162
|
+
contacts: profile
|
|
163
|
+
.contacts
|
|
164
|
+
.filter(k => k in project.contacts)
|
|
165
|
+
.map(k => (kind: k, label: labels.contacts.at(k), value: project.contacts.at(k), link: link-for(k, project.contacts.at(k)))),
|
|
166
|
+
skills: profile
|
|
167
|
+
.skills
|
|
168
|
+
.map(row => row
|
|
169
|
+
.filter(id => id in project.skills)
|
|
170
|
+
.map(id => (id: id, group: project.skills.at(id)))
|
|
171
|
+
// A group the selection emptied goes away; one that was empty stays.
|
|
172
|
+
.filter(((id, group)) => group.items.len() == 0 or group.items.any(s => shown("skills/" + id + "/" + s.id, s)))
|
|
173
|
+
.map(((id, group)) => (
|
|
174
|
+
title: group.title,
|
|
175
|
+
items: group.items.filter(s => shown("skills/" + id + "/" + s.id, s)).map(s => s.text),
|
|
176
|
+
)))
|
|
177
|
+
.filter(row => row.len() > 0),
|
|
178
|
+
sections: profile
|
|
179
|
+
.sections
|
|
180
|
+
.enumerate()
|
|
181
|
+
// A section the selection emptied goes away; one that was empty stays. `index` and `path`
|
|
182
|
+
// keep the section's place in the profile, as the blocks' paths keep theirs.
|
|
183
|
+
.filter(((i, s)) => s.blocks.len() == 0 or s.blocks.any(block-shown))
|
|
184
|
+
.map(((i, s)) => (
|
|
185
|
+
index: i,
|
|
186
|
+
path: "sections." + str(i),
|
|
187
|
+
id: s.id,
|
|
188
|
+
title: s.title,
|
|
189
|
+
side: s.at("column", default: "main") == "side",
|
|
190
|
+
compact: s.at("compact", default: false),
|
|
191
|
+
blocks: s
|
|
192
|
+
.blocks
|
|
193
|
+
.enumerate()
|
|
194
|
+
.filter(((j, b)) => block-shown(b))
|
|
195
|
+
.map(((j, b)) => {
|
|
196
|
+
let path = "sections." + str(i) + ".blocks." + str(j)
|
|
197
|
+
if b.type == "entry" {
|
|
198
|
+
let e = project.entries.at(b.entry)
|
|
199
|
+
(
|
|
200
|
+
type: "entry",
|
|
201
|
+
path: path,
|
|
202
|
+
id: b.entry,
|
|
203
|
+
title: e.title,
|
|
204
|
+
place: e.at("place", default: ""),
|
|
205
|
+
period: period(e),
|
|
206
|
+
note: e.at("note", default: none),
|
|
207
|
+
items: e.at("items", default: ()).filter(it => shown("entries/" + b.entry + "/items/" + it.at("id", default: ""), it)),
|
|
208
|
+
)
|
|
209
|
+
} else {
|
|
210
|
+
(type: b.type, path: path, heading: b.at("heading", default: none), text: b.text)
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
)),
|
|
214
|
+
)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/// The photo at `width`, in the profile's shape; none when there is no photo.
|
|
218
|
+
#let photo(width, shape: cv.photo-shape) = {
|
|
219
|
+
if cv.photo == none { return none }
|
|
220
|
+
if shape == "circle" {
|
|
221
|
+
box(clip: true, radius: 50%, width: width, height: width, image(cv.photo, width: width, height: width, fit: "cover"))
|
|
222
|
+
} else if shape == "rounded" {
|
|
223
|
+
box(clip: true, radius: width * 0.08, image(cv.photo, width: width))
|
|
224
|
+
} else {
|
|
225
|
+
image(cv.photo, width: width)
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/// A contact value as text, linked when it has a link.
|
|
230
|
+
#let contact-text(c) = if c.link == none { c.value } else { link(c.link, c.value) }
|
|
231
|
+
|
|
232
|
+
/// The document metadata every style should set.
|
|
233
|
+
#let document-info = (title: cv.name + " — " + cv.subtitle, author: cv.name)
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Arco: made for a CV with little in it, so that it looks full and kind. A tinted panel down the
|
|
2
|
+
// left with the photo in an arch at its top (the initials, when there is no photo), the name large
|
|
3
|
+
// in a bold serif, the subtitle and the summary on a soft card, and titles over a fine line that
|
|
4
|
+
// ends in a diamond. Two columns: the panel holds the contacts, the skills and the side sections.
|
|
5
|
+
|
|
6
|
+
#import "/lib.typ": *
|
|
7
|
+
|
|
8
|
+
#let ink = rgb("#2b2427")
|
|
9
|
+
#let muted = ink.lighten(38%)
|
|
10
|
+
#let accent-color = accent(rgb("#b06a5b"))
|
|
11
|
+
#let deep = accent-color.darken(30%)
|
|
12
|
+
#let tint = accent-color.lighten(88%)
|
|
13
|
+
#let soft = accent-color.lighten(76%)
|
|
14
|
+
#let m = margins((top: 14, bottom: 12, left: 13, right: 14))
|
|
15
|
+
#let text-width = paper.width - m.left - m.right
|
|
16
|
+
#let side-width = text-width * 0.33
|
|
17
|
+
#let gutter = 10mm
|
|
18
|
+
#let main-width = text-width - side-width - gutter
|
|
19
|
+
#let main-x = m.left + side-width + gutter
|
|
20
|
+
#let pad = 5mm
|
|
21
|
+
#let small = base-size * 0.9
|
|
22
|
+
#let serif = "XCharter"
|
|
23
|
+
#let shows-picture = opt("photo", "square") != "none"
|
|
24
|
+
#let pic-width = side-width * 0.8
|
|
25
|
+
#let pic-height = pic-width * 1.2
|
|
26
|
+
// On the first page the panel starts halfway down the photo, which stands out of it.
|
|
27
|
+
#let panel-top = if shows-picture { m.top + pic-height * 0.55 } else { m.top - pad }
|
|
28
|
+
|
|
29
|
+
#set document(..document-info)
|
|
30
|
+
#set page(width: paper.width, height: paper.height, margin: m, background: context {
|
|
31
|
+
let first = counter(page).get().first() == 1
|
|
32
|
+
let y0 = if first { panel-top } else { 0pt }
|
|
33
|
+
place(top + left, dx: m.left - pad, dy: y0, rect(
|
|
34
|
+
width: side-width + 2 * pad,
|
|
35
|
+
height: paper.height - y0,
|
|
36
|
+
fill: tint,
|
|
37
|
+
radius: if first { (top-left: 6mm, top-right: 6mm) } else { 0pt },
|
|
38
|
+
))
|
|
39
|
+
})
|
|
40
|
+
#set text(font: opt("font", "Noto Sans"), size: base-size, fill: ink, lang: lang)
|
|
41
|
+
#set par(leading: 0.62em, spacing: 0.62em * density, justify: false)
|
|
42
|
+
#set list(marker: text(fill: accent-color, sym.bullet), indent: 0.1em, body-indent: 0.5em, spacing: 0.45em * density)
|
|
43
|
+
#show link: set text(hyphenate: false)
|
|
44
|
+
|
|
45
|
+
#geometry(main: (x: main-x, width: main-width), side: (x: m.left, width: side-width))
|
|
46
|
+
|
|
47
|
+
// ---------------------------------------------------------------- ornaments
|
|
48
|
+
|
|
49
|
+
#let diamond(size: 4.4pt) = box(width: size, height: size, align(center + horizon, rotate(45deg, square(size: size * 0.68, fill: accent-color))))
|
|
50
|
+
|
|
51
|
+
/// A four-pointed star of radius `r`.
|
|
52
|
+
#let star(r) = {
|
|
53
|
+
let w = r * 0.28
|
|
54
|
+
polygon(fill: accent-color.lighten(25%), (r, 0pt), (r + w, r - w), (2 * r, r), (r + w, r + w), (r, 2 * r), (r - w, r + w), (0pt, r), (r - w, r - w))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#let title-line(title, size: base-size * 1.2) = block(above: 1.35em * density, below: 0.7em * density, sticky: true, {
|
|
58
|
+
text(font: serif, size: size, weight: "bold", fill: ink, title)
|
|
59
|
+
h(0.5em)
|
|
60
|
+
box(width: 1fr, baseline: -0.3em, line(length: 100%, stroke: 0.6pt + accent-color.lighten(30%)))
|
|
61
|
+
box(baseline: -(0.3em - 2.2pt), diamond())
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
// ---------------------------------------------------------------- the panel
|
|
65
|
+
|
|
66
|
+
#let first-letter(s) = if s.len() > 0 { upper(s.clusters().first()) } else { "" }
|
|
67
|
+
#let arch(w) = (top-left: w / 2, top-right: w / 2)
|
|
68
|
+
#let picture = if not shows-picture { none } else {
|
|
69
|
+
let inner = if cv.photo != none {
|
|
70
|
+
box(clip: true, radius: arch(pic-width), width: pic-width, height: pic-height, image(cv.photo, width: pic-width, height: pic-height, fit: "cover"))
|
|
71
|
+
} else {
|
|
72
|
+
box(radius: arch(pic-width), width: pic-width, height: pic-height, fill: soft, align(center + horizon, text(
|
|
73
|
+
font: serif,
|
|
74
|
+
size: pic-width * 0.3,
|
|
75
|
+
weight: "bold",
|
|
76
|
+
fill: white,
|
|
77
|
+
first-letter(cv.given) + first-letter(cv.family),
|
|
78
|
+
)))
|
|
79
|
+
}
|
|
80
|
+
box(stroke: 0.8pt + accent-color, radius: arch(pic-width + 9pt), inset: 4.5pt, inner)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#let dots(items) = block(above: 0.2em, stroke: (left: 0.7pt + accent-color.lighten(35%)), inset: (left: 10pt, y: 1pt), for (i, it) in items.enumerate() {
|
|
84
|
+
block(above: if i == 0 { 0pt } else { 0.62em * density }, below: 0pt, {
|
|
85
|
+
place(left, dx: -10pt - 2.6pt, dy: 0.12em, circle(radius: 2.3pt, fill: tint, stroke: 0.8pt + accent-color))
|
|
86
|
+
it
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
#let contact-line(c) = block(above: 0.6em * density, below: 0pt, grid(
|
|
91
|
+
columns: (auto, 1fr),
|
|
92
|
+
column-gutter: 0.55em,
|
|
93
|
+
move(dy: 0.12em, circle(radius: 2.6pt, stroke: 0.9pt + accent-color)),
|
|
94
|
+
contact-text(c),
|
|
95
|
+
))
|
|
96
|
+
|
|
97
|
+
#let side-section(s) = {
|
|
98
|
+
title-line(s.title, size: base-size * 1.1)
|
|
99
|
+
for b in s.blocks {
|
|
100
|
+
anchored(b.path, column: "side", block(above: 0.65em * density, below: 0pt, if b.type == "entry" {
|
|
101
|
+
text(weight: "bold", b.title)
|
|
102
|
+
if b.place != "" { linebreak() + text(fill: deep, b.place) }
|
|
103
|
+
if b.period != "" { linebreak() + text(fill: muted, b.period) }
|
|
104
|
+
} else { item-body(b) }))
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
#let sidebar = {
|
|
109
|
+
set text(size: small)
|
|
110
|
+
if picture != none {
|
|
111
|
+
place(top + left, dx: -1mm, dy: 5mm, star(3.2pt))
|
|
112
|
+
place(top + left, dx: 2.6mm, dy: 11mm, star(1.9pt))
|
|
113
|
+
place(top + left, dx: -0.4mm, dy: 15.5mm, star(1.4pt))
|
|
114
|
+
anchored("photo", column: "side", align(center, picture))
|
|
115
|
+
v(3mm)
|
|
116
|
+
}
|
|
117
|
+
if cv.contacts.len() > 0 {
|
|
118
|
+
anchored("contacts", column: "side", {
|
|
119
|
+
title-line(labels.contact, size: base-size * 1.1)
|
|
120
|
+
for c in cv.contacts { contact-line(c) }
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
for (i, row) in cv.skills.enumerate() {
|
|
124
|
+
anchored("skills." + str(i), column: "side", for g in row {
|
|
125
|
+
title-line(g.title, size: base-size * 1.1)
|
|
126
|
+
dots(g.items)
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
for s in cv.sections.filter(s => s.side) { anchored(s.path, column: "side", side-section(s)) }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------- the main column
|
|
133
|
+
|
|
134
|
+
#let entry(b, compact) = anchored(b.path, block(above: 1em * density, below: 0pt, {
|
|
135
|
+
text(weight: "bold", b.title)
|
|
136
|
+
if b.place != "" or b.period != "" {
|
|
137
|
+
linebreak()
|
|
138
|
+
text(size: small, {
|
|
139
|
+
if b.place != "" { text(fill: deep, weight: "medium", b.place) }
|
|
140
|
+
if b.place != "" and b.period != "" { h(0.45em) + text(fill: accent-color, "|") + h(0.45em) }
|
|
141
|
+
text(fill: muted, b.period)
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
if b.note != none { par(text(size: small, fill: muted, b.note)) }
|
|
145
|
+
if not compact and b.items.len() > 0 { block(above: 0.5em * density, list(..b.items.map(item-body))) }
|
|
146
|
+
}))
|
|
147
|
+
|
|
148
|
+
#let main-section(s) = anchored(s.path, {
|
|
149
|
+
title-line(s.title)
|
|
150
|
+
for b in s.blocks {
|
|
151
|
+
if b.type == "entry" { entry(b, s.compact) } else if b.type == "item" {
|
|
152
|
+
anchored(b.path, block(above: 0.5em * density, below: 0pt, list(item-body(b))))
|
|
153
|
+
} else { anchored(b.path, block(above: 0.5em * density, below: 0pt, par(justify: true, inline(b.text)))) }
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
#let main = {
|
|
158
|
+
anchored("name", par(leading: 0.32em, text(font: serif, size: base-size * 3.1, weight: "bold", fill: ink, {
|
|
159
|
+
cv.given
|
|
160
|
+
linebreak()
|
|
161
|
+
cv.family
|
|
162
|
+
})))
|
|
163
|
+
block(above: 1em, fill: soft.lighten(30%), radius: 5pt, inset: (x: 11pt, y: 10pt), width: 100%, {
|
|
164
|
+
anchored("subtitle", text(size: base-size * 1.12, weight: "bold", fill: deep, cv.subtitle))
|
|
165
|
+
if cv.highlight != none {
|
|
166
|
+
v(0.3em)
|
|
167
|
+
anchored("highlight", text(size: small)[#text(weight: "bold", fill: deep, cv.highlight.title): #cv.highlight.text])
|
|
168
|
+
}
|
|
169
|
+
if cv.summary != "" {
|
|
170
|
+
v(0.45em)
|
|
171
|
+
anchored("summary", par(justify: true, inline(cv.summary)))
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
for s in cv.sections.filter(s => not s.side) { main-section(s) }
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
#grid(columns: (side-width, main-width), column-gutter: gutter, sidebar, main)
|