@enure/jacklin 3.2.0 → 3.4.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/README.md +1 -11
- package/index.ts +37 -2
- package/package.json +4 -4
- package/template.handlebars +12 -11
package/README.md
CHANGED
package/index.ts
CHANGED
|
@@ -3,21 +3,56 @@ import { dirname, resolve } from "path";
|
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
4
|
import Handlebars from "handlebars";
|
|
5
5
|
|
|
6
|
+
type WorkItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
position: string;
|
|
9
|
+
startDate: string;
|
|
10
|
+
endDate?: string;
|
|
11
|
+
isFeatured?: boolean;
|
|
12
|
+
hide?: boolean;
|
|
13
|
+
summaryItems?: string[];
|
|
14
|
+
highlights?: string[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type Resume = {
|
|
18
|
+
basics: {
|
|
19
|
+
name: string;
|
|
20
|
+
label: string;
|
|
21
|
+
email: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
summary: string;
|
|
24
|
+
location: {
|
|
25
|
+
city: string;
|
|
26
|
+
region: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
work: WorkItem[];
|
|
30
|
+
education: {
|
|
31
|
+
institution: string;
|
|
32
|
+
area: string;
|
|
33
|
+
studyType: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
|
|
6
37
|
Handlebars.registerHelper("or", (a, b) => a || b);
|
|
7
38
|
|
|
8
39
|
Handlebars.registerHelper("getShortDate", (dateStr) => {
|
|
9
40
|
if (typeof dateStr === 'string') {
|
|
10
41
|
const date = new Date(dateStr);
|
|
42
|
+
if (isNaN(date.getTime())) {
|
|
43
|
+
throw new Error(`Invalid date: "${dateStr}"`);
|
|
44
|
+
}
|
|
11
45
|
const year = date.getFullYear();
|
|
12
46
|
const month = date.getMonth() + 1;
|
|
13
|
-
const fullMonth = month.
|
|
47
|
+
const fullMonth = String(month).padStart(2, '0');
|
|
48
|
+
|
|
14
49
|
return `${fullMonth}/${year}`;
|
|
15
50
|
} else {
|
|
16
51
|
return dateStr;
|
|
17
52
|
}
|
|
18
53
|
});
|
|
19
54
|
|
|
20
|
-
export const render = (resume) => {
|
|
55
|
+
export const render = (resume: Resume) => {
|
|
21
56
|
const modulePath = dirname(fileURLToPath(import.meta.url));
|
|
22
57
|
const template = readFileSync(
|
|
23
58
|
resolve(modulePath, "./template.handlebars"),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enure/jacklin",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "3.4.0",
|
|
4
|
+
"description": "A JSON Resume theme. Renders resume data to HTML with a bundled Handlebars template.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"exports": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"handlebars": "^4.7.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/bun": "
|
|
26
|
+
"@types/bun": "1.3.9",
|
|
27
27
|
"resumed": "^6.1.0"
|
|
28
28
|
},
|
|
29
|
-
"packageManager": "
|
|
29
|
+
"packageManager": "bun@1.3.9",
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"typescript": "^5"
|
|
32
32
|
}
|
package/template.handlebars
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
max-width: 800px;
|
|
30
30
|
}
|
|
31
31
|
section {
|
|
32
|
-
margin-top:
|
|
32
|
+
margin-top: 32px;
|
|
33
33
|
}
|
|
34
34
|
h1, h2 {
|
|
35
35
|
font-size: 13px;
|
|
@@ -133,16 +133,6 @@
|
|
|
133
133
|
</section>
|
|
134
134
|
</header>
|
|
135
135
|
<main>
|
|
136
|
-
<section>
|
|
137
|
-
<h2>Education</h2>
|
|
138
|
-
{{#each education}}
|
|
139
|
-
<ul class="EducationList">
|
|
140
|
-
<li>{{ this.institution }}</li>
|
|
141
|
-
<li>{{ this.area }}</li>
|
|
142
|
-
<li>{{ this.studyType }}</li>
|
|
143
|
-
</ul>
|
|
144
|
-
{{/each}}
|
|
145
|
-
</section>
|
|
146
136
|
<section>
|
|
147
137
|
<h2>Work History</h2>
|
|
148
138
|
<ul class="WorkList">
|
|
@@ -160,6 +150,7 @@
|
|
|
160
150
|
{{#each this.summaryItems}}
|
|
161
151
|
<li class="SummaryList-item">{{this}}</li>
|
|
162
152
|
{{/each}}
|
|
153
|
+
</ul>
|
|
163
154
|
</div>
|
|
164
155
|
{{#if this.highlights}}
|
|
165
156
|
<ul class="WorkList-highlights">
|
|
@@ -184,6 +175,16 @@
|
|
|
184
175
|
{{/unless}}
|
|
185
176
|
{{/each}}
|
|
186
177
|
</ul>
|
|
178
|
+
</section>
|
|
179
|
+
<section>
|
|
180
|
+
<h2>Education</h2>
|
|
181
|
+
{{#each education}}
|
|
182
|
+
<ul class="EducationList">
|
|
183
|
+
<li>{{ this.institution }}</li>
|
|
184
|
+
<li>{{ this.area }}</li>
|
|
185
|
+
<li>{{ this.studyType }}</li>
|
|
186
|
+
</ul>
|
|
187
|
+
{{/each}}
|
|
187
188
|
</section>
|
|
188
189
|
</main>
|
|
189
190
|
</body>
|