jsonresume-theme-modern-classic 1.1.12 → 1.1.14
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/CHANGELOG.md +13 -0
- package/dist/index.js +62 -9
- package/package.json +2 -2
- package/src/Resume.jsx +20 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# jsonresume-theme-modern-classic
|
|
2
2
|
|
|
3
|
+
## 1.1.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [601e883]
|
|
8
|
+
- @jsonresume/core@0.4.1
|
|
9
|
+
|
|
10
|
+
## 1.1.13
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 2b3af11: Render inline Markdown (bold, emphasis, code, links) in summaries, descriptions and highlights with the shared renderer from @jsonresume/core (#600).
|
|
15
|
+
|
|
3
16
|
## 1.1.12
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1455,6 +1455,50 @@ function SectionTitle({
|
|
|
1455
1455
|
}
|
|
1456
1456
|
);
|
|
1457
1457
|
}
|
|
1458
|
+
const ESCAPES = {
|
|
1459
|
+
"&": "&",
|
|
1460
|
+
"<": "<",
|
|
1461
|
+
">": ">",
|
|
1462
|
+
'"': """,
|
|
1463
|
+
"'": "'"
|
|
1464
|
+
};
|
|
1465
|
+
const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
1466
|
+
const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
|
|
1467
|
+
const CODE = /`([^`]+)`/g;
|
|
1468
|
+
const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
1469
|
+
const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
|
|
1470
|
+
const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
|
|
1471
|
+
const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
|
|
1472
|
+
const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
|
|
1473
|
+
EMPHASIS,
|
|
1474
|
+
(_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
|
|
1475
|
+
);
|
|
1476
|
+
const inline = (text, out) => {
|
|
1477
|
+
const kept = [];
|
|
1478
|
+
const keep = (value) => `${kept.push(value) - 1}`;
|
|
1479
|
+
const marks = (t) => emphasis(t, out.strong, out.em);
|
|
1480
|
+
const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
|
|
1481
|
+
LINK,
|
|
1482
|
+
(_2, label, url) => keep(out.link(marks(out.text(label)), url))
|
|
1483
|
+
);
|
|
1484
|
+
return marks(out.text(rest)).replace(
|
|
1485
|
+
/\uE000(\d+)\uE000/g,
|
|
1486
|
+
(_2, i) => kept[Number(i)]
|
|
1487
|
+
);
|
|
1488
|
+
};
|
|
1489
|
+
function renderInlineMarkdown(text) {
|
|
1490
|
+
if (typeof text !== "string") return "";
|
|
1491
|
+
return inline(text, {
|
|
1492
|
+
text: escapeHtml,
|
|
1493
|
+
code: (body) => `<code>${escapeHtml(body)}</code>`,
|
|
1494
|
+
link: (label, url) => {
|
|
1495
|
+
const href = safeHref(url);
|
|
1496
|
+
return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
|
|
1497
|
+
},
|
|
1498
|
+
strong: (t) => `<strong>${t}</strong>`,
|
|
1499
|
+
em: (t) => `<em>${t}</em>`
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1458
1502
|
dt.div`
|
|
1459
1503
|
margin-bottom: ${(props) => props.theme?.spacing?.item || "var(--resume-space-item, 1rem)"};
|
|
1460
1504
|
|
|
@@ -1783,6 +1827,15 @@ dt.span`
|
|
|
1783
1827
|
}
|
|
1784
1828
|
}
|
|
1785
1829
|
`;
|
|
1830
|
+
function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
|
|
1831
|
+
return /* @__PURE__ */ jsx(
|
|
1832
|
+
Tag,
|
|
1833
|
+
{
|
|
1834
|
+
...rest,
|
|
1835
|
+
dangerouslySetInnerHTML: { __html: renderInlineMarkdown(text) }
|
|
1836
|
+
}
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1786
1839
|
dt.hr`
|
|
1787
1840
|
border: none;
|
|
1788
1841
|
border-top: 0.5pt solid
|
|
@@ -6266,7 +6319,7 @@ function Resume({ resume }) {
|
|
|
6266
6319
|
/* @__PURE__ */ jsx(Name, { children: basics.name }),
|
|
6267
6320
|
basics.label && /* @__PURE__ */ jsx(Label, { children: basics.label }),
|
|
6268
6321
|
/* @__PURE__ */ jsx(StyledContactInfo, { basics }),
|
|
6269
|
-
basics.summary && /* @__PURE__ */ jsx(
|
|
6322
|
+
basics.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: Summary, text: basics.summary })
|
|
6270
6323
|
] }),
|
|
6271
6324
|
work?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
6272
6325
|
/* @__PURE__ */ jsx(StyledSectionTitle, { children: "Experience" }),
|
|
@@ -6278,8 +6331,8 @@ function Resume({ resume }) {
|
|
|
6278
6331
|
] }),
|
|
6279
6332
|
/* @__PURE__ */ jsx(DateText, { children: /* @__PURE__ */ jsx(DateRange, { startDate: job.startDate, endDate: job.endDate }) })
|
|
6280
6333
|
] }),
|
|
6281
|
-
job.summary && /* @__PURE__ */ jsx(
|
|
6282
|
-
job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6334
|
+
job.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: job.summary }),
|
|
6335
|
+
job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6283
6336
|
] }, index))
|
|
6284
6337
|
] }),
|
|
6285
6338
|
skills?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6306,8 +6359,8 @@ function Resume({ resume }) {
|
|
|
6306
6359
|
/* @__PURE__ */ jsx(StyledSectionTitle, { children: "Projects" }),
|
|
6307
6360
|
projects.map((project, index) => /* @__PURE__ */ jsxs(WorkItem, { children: [
|
|
6308
6361
|
/* @__PURE__ */ jsx(Position, { children: project.name }),
|
|
6309
|
-
project.description && /* @__PURE__ */ jsx(
|
|
6310
|
-
project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6362
|
+
project.description && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: project.description }),
|
|
6363
|
+
project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6311
6364
|
] }, index))
|
|
6312
6365
|
] }),
|
|
6313
6366
|
volunteer?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6326,8 +6379,8 @@ function Resume({ resume }) {
|
|
|
6326
6379
|
}
|
|
6327
6380
|
) })
|
|
6328
6381
|
] }),
|
|
6329
|
-
vol.summary && /* @__PURE__ */ jsx(
|
|
6330
|
-
vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6382
|
+
vol.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: vol.summary }),
|
|
6383
|
+
vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6331
6384
|
] }, index))
|
|
6332
6385
|
] }),
|
|
6333
6386
|
awards?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6339,7 +6392,7 @@ function Resume({ resume }) {
|
|
|
6339
6392
|
award.awarder
|
|
6340
6393
|
] }),
|
|
6341
6394
|
award.date && /* @__PURE__ */ jsx(EducationDate, { children: award.date }),
|
|
6342
|
-
award.summary && /* @__PURE__ */ jsx(
|
|
6395
|
+
award.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: award.summary })
|
|
6343
6396
|
] }, index))
|
|
6344
6397
|
] }),
|
|
6345
6398
|
publications?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6351,7 +6404,7 @@ function Resume({ resume }) {
|
|
|
6351
6404
|
pub.publisher
|
|
6352
6405
|
] }),
|
|
6353
6406
|
pub.releaseDate && /* @__PURE__ */ jsx(EducationDate, { children: pub.releaseDate }),
|
|
6354
|
-
pub.summary && /* @__PURE__ */ jsx(
|
|
6407
|
+
pub.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: pub.summary })
|
|
6355
6408
|
] }, index))
|
|
6356
6409
|
] }),
|
|
6357
6410
|
certificates?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsonresume-theme-modern-classic",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"description": "A universal, default style for engineers and professionals",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"styled-components": "^6.1.19",
|
|
21
|
-
"@jsonresume/core": "0.4.
|
|
21
|
+
"@jsonresume/core": "0.4.1"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
package/src/Resume.jsx
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
SectionTitle,
|
|
6
6
|
DateRange,
|
|
7
7
|
ContactInfo,
|
|
8
|
+
InlineMarkdown,
|
|
8
9
|
} from '@jsonresume/core';
|
|
9
10
|
|
|
10
11
|
const Layout = styled.div`
|
|
@@ -203,7 +204,9 @@ function Resume({ resume }) {
|
|
|
203
204
|
<Name>{basics.name}</Name>
|
|
204
205
|
{basics.label && <Label>{basics.label}</Label>}
|
|
205
206
|
<StyledContactInfo basics={basics} />
|
|
206
|
-
{basics.summary &&
|
|
207
|
+
{basics.summary && (
|
|
208
|
+
<InlineMarkdown as={Summary} text={basics.summary} />
|
|
209
|
+
)}
|
|
207
210
|
</Header>
|
|
208
211
|
|
|
209
212
|
{work?.length > 0 && (
|
|
@@ -220,11 +223,13 @@ function Resume({ resume }) {
|
|
|
220
223
|
<DateRange startDate={job.startDate} endDate={job.endDate} />
|
|
221
224
|
</DateText>
|
|
222
225
|
</WorkHeader>
|
|
223
|
-
{job.summary &&
|
|
226
|
+
{job.summary && (
|
|
227
|
+
<InlineMarkdown as={WorkSummary} text={job.summary} />
|
|
228
|
+
)}
|
|
224
229
|
{job.highlights?.length > 0 && (
|
|
225
230
|
<Highlights>
|
|
226
231
|
{job.highlights.map((highlight, i) => (
|
|
227
|
-
<li key={i}
|
|
232
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
228
233
|
))}
|
|
229
234
|
</Highlights>
|
|
230
235
|
)}
|
|
@@ -274,12 +279,12 @@ function Resume({ resume }) {
|
|
|
274
279
|
<WorkItem key={index}>
|
|
275
280
|
<Position>{project.name}</Position>
|
|
276
281
|
{project.description && (
|
|
277
|
-
<WorkSummary
|
|
282
|
+
<InlineMarkdown as={WorkSummary} text={project.description} />
|
|
278
283
|
)}
|
|
279
284
|
{project.highlights?.length > 0 && (
|
|
280
285
|
<Highlights>
|
|
281
286
|
{project.highlights.map((highlight, i) => (
|
|
282
|
-
<li key={i}
|
|
287
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
283
288
|
))}
|
|
284
289
|
</Highlights>
|
|
285
290
|
)}
|
|
@@ -307,11 +312,13 @@ function Resume({ resume }) {
|
|
|
307
312
|
</DateText>
|
|
308
313
|
)}
|
|
309
314
|
</WorkHeader>
|
|
310
|
-
{vol.summary &&
|
|
315
|
+
{vol.summary && (
|
|
316
|
+
<InlineMarkdown as={WorkSummary} text={vol.summary} />
|
|
317
|
+
)}
|
|
311
318
|
{vol.highlights?.length > 0 && (
|
|
312
319
|
<Highlights>
|
|
313
320
|
{vol.highlights.map((highlight, i) => (
|
|
314
|
-
<li key={i}
|
|
321
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
315
322
|
))}
|
|
316
323
|
</Highlights>
|
|
317
324
|
)}
|
|
@@ -328,7 +335,9 @@ function Resume({ resume }) {
|
|
|
328
335
|
<Institution>{award.title}</Institution>
|
|
329
336
|
{award.awarder && <Degree>Awarded by {award.awarder}</Degree>}
|
|
330
337
|
{award.date && <EducationDate>{award.date}</EducationDate>}
|
|
331
|
-
{award.summary &&
|
|
338
|
+
{award.summary && (
|
|
339
|
+
<InlineMarkdown as={WorkSummary} text={award.summary} />
|
|
340
|
+
)}
|
|
332
341
|
</EducationItem>
|
|
333
342
|
))}
|
|
334
343
|
</Section>
|
|
@@ -344,7 +353,9 @@ function Resume({ resume }) {
|
|
|
344
353
|
{pub.releaseDate && (
|
|
345
354
|
<EducationDate>{pub.releaseDate}</EducationDate>
|
|
346
355
|
)}
|
|
347
|
-
{pub.summary &&
|
|
356
|
+
{pub.summary && (
|
|
357
|
+
<InlineMarkdown as={WorkSummary} text={pub.summary} />
|
|
358
|
+
)}
|
|
348
359
|
</EducationItem>
|
|
349
360
|
))}
|
|
350
361
|
</Section>
|