jsonresume-theme-sidebar 0.2.12 → 0.2.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 +97 -9
- package/package.json +2 -2
- package/src/Resume.jsx +30 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# jsonresume-theme-sidebar
|
|
2
2
|
|
|
3
|
+
## 0.2.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [601e883]
|
|
8
|
+
- @jsonresume/core@0.4.1
|
|
9
|
+
|
|
10
|
+
## 0.2.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
|
## 0.2.12
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1435,6 +1435,50 @@ dt.span`
|
|
|
1435
1435
|
margin-right: 8px;
|
|
1436
1436
|
font-size: 1.2em;
|
|
1437
1437
|
`;
|
|
1438
|
+
const ESCAPES = {
|
|
1439
|
+
"&": "&",
|
|
1440
|
+
"<": "<",
|
|
1441
|
+
">": ">",
|
|
1442
|
+
'"': """,
|
|
1443
|
+
"'": "'"
|
|
1444
|
+
};
|
|
1445
|
+
const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
1446
|
+
const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
|
|
1447
|
+
const CODE = /`([^`]+)`/g;
|
|
1448
|
+
const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
1449
|
+
const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
|
|
1450
|
+
const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
|
|
1451
|
+
const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
|
|
1452
|
+
const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
|
|
1453
|
+
EMPHASIS,
|
|
1454
|
+
(_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
|
|
1455
|
+
);
|
|
1456
|
+
const inline = (text, out) => {
|
|
1457
|
+
const kept = [];
|
|
1458
|
+
const keep = (value) => `${kept.push(value) - 1}`;
|
|
1459
|
+
const marks = (t) => emphasis(t, out.strong, out.em);
|
|
1460
|
+
const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
|
|
1461
|
+
LINK,
|
|
1462
|
+
(_2, label, url) => keep(out.link(marks(out.text(label)), url))
|
|
1463
|
+
);
|
|
1464
|
+
return marks(out.text(rest)).replace(
|
|
1465
|
+
/\uE000(\d+)\uE000/g,
|
|
1466
|
+
(_2, i) => kept[Number(i)]
|
|
1467
|
+
);
|
|
1468
|
+
};
|
|
1469
|
+
function renderInlineMarkdown(text) {
|
|
1470
|
+
if (typeof text !== "string") return "";
|
|
1471
|
+
return inline(text, {
|
|
1472
|
+
text: escapeHtml,
|
|
1473
|
+
code: (body) => `<code>${escapeHtml(body)}</code>`,
|
|
1474
|
+
link: (label, url) => {
|
|
1475
|
+
const href = safeHref(url);
|
|
1476
|
+
return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
|
|
1477
|
+
},
|
|
1478
|
+
strong: (t) => `<strong>${t}</strong>`,
|
|
1479
|
+
em: (t) => `<em>${t}</em>`
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1438
1482
|
dt.div`
|
|
1439
1483
|
margin-bottom: ${(props) => props.theme?.spacing?.item || "var(--resume-space-item, 1rem)"};
|
|
1440
1484
|
|
|
@@ -1655,6 +1699,15 @@ dt.span`
|
|
|
1655
1699
|
}
|
|
1656
1700
|
}
|
|
1657
1701
|
`;
|
|
1702
|
+
function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
|
|
1703
|
+
return /* @__PURE__ */ jsx(
|
|
1704
|
+
Tag,
|
|
1705
|
+
{
|
|
1706
|
+
...rest,
|
|
1707
|
+
dangerouslySetInnerHTML: { __html: renderInlineMarkdown(text) }
|
|
1708
|
+
}
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1658
1711
|
dt.hr`
|
|
1659
1712
|
border: none;
|
|
1660
1713
|
border-top: 0.5pt solid
|
|
@@ -6332,7 +6385,7 @@ function Resume({ resume }) {
|
|
|
6332
6385
|
] }),
|
|
6333
6386
|
basics.summary && /* @__PURE__ */ jsxs(MainSection, { children: [
|
|
6334
6387
|
/* @__PURE__ */ jsx(MainSectionTitle, { children: "PROFILE" }),
|
|
6335
|
-
/* @__PURE__ */ jsx(
|
|
6388
|
+
/* @__PURE__ */ jsx(InlineMarkdown, { as: ProfileText, text: basics.summary })
|
|
6336
6389
|
] }),
|
|
6337
6390
|
work.length > 0 && /* @__PURE__ */ jsxs(MainSection, { children: [
|
|
6338
6391
|
/* @__PURE__ */ jsx(MainSectionTitle, { children: "WORK EXPERIENCE" }),
|
|
@@ -6349,8 +6402,15 @@ function Resume({ resume }) {
|
|
|
6349
6402
|
job.endDate ? new Date(job.endDate).getFullYear() : "PRESENT"
|
|
6350
6403
|
] }) })
|
|
6351
6404
|
] }),
|
|
6352
|
-
job.summary && /* @__PURE__ */ jsx(
|
|
6353
|
-
|
|
6405
|
+
job.summary && /* @__PURE__ */ jsx(
|
|
6406
|
+
InlineMarkdown,
|
|
6407
|
+
{
|
|
6408
|
+
as: "p",
|
|
6409
|
+
style: { marginBottom: "10px", color: "#4a4a4a" },
|
|
6410
|
+
text: job.summary
|
|
6411
|
+
}
|
|
6412
|
+
),
|
|
6413
|
+
job.highlights && job.highlights.length > 0 && /* @__PURE__ */ jsx(WorkDescription, { children: job.highlights.map((highlight, idx) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, idx)) })
|
|
6354
6414
|
] }, index2))
|
|
6355
6415
|
] }),
|
|
6356
6416
|
projects.length > 0 && /* @__PURE__ */ jsxs(MainSection, { children: [
|
|
@@ -6375,8 +6435,15 @@ function Resume({ resume }) {
|
|
|
6375
6435
|
project.endDate && ` - ${new Date(project.endDate).getFullYear()}`
|
|
6376
6436
|
] }) })
|
|
6377
6437
|
] }),
|
|
6378
|
-
project.description && /* @__PURE__ */ jsx(
|
|
6379
|
-
|
|
6438
|
+
project.description && /* @__PURE__ */ jsx(
|
|
6439
|
+
InlineMarkdown,
|
|
6440
|
+
{
|
|
6441
|
+
as: "p",
|
|
6442
|
+
style: { marginBottom: "10px", color: "#4a4a4a" },
|
|
6443
|
+
text: project.description
|
|
6444
|
+
}
|
|
6445
|
+
),
|
|
6446
|
+
project.highlights && project.highlights.length > 0 && /* @__PURE__ */ jsx(WorkDescription, { children: project.highlights.map((highlight, idx) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, idx)) })
|
|
6380
6447
|
] }, index2))
|
|
6381
6448
|
] }),
|
|
6382
6449
|
volunteer.length > 0 && /* @__PURE__ */ jsxs(MainSection, { children: [
|
|
@@ -6394,8 +6461,15 @@ function Resume({ resume }) {
|
|
|
6394
6461
|
vol.endDate ? new Date(vol.endDate).getFullYear() : "PRESENT"
|
|
6395
6462
|
] }) })
|
|
6396
6463
|
] }),
|
|
6397
|
-
vol.summary && /* @__PURE__ */ jsx(
|
|
6398
|
-
|
|
6464
|
+
vol.summary && /* @__PURE__ */ jsx(
|
|
6465
|
+
InlineMarkdown,
|
|
6466
|
+
{
|
|
6467
|
+
as: "p",
|
|
6468
|
+
style: { marginBottom: "10px", color: "#4a4a4a" },
|
|
6469
|
+
text: vol.summary
|
|
6470
|
+
}
|
|
6471
|
+
),
|
|
6472
|
+
vol.highlights && vol.highlights.length > 0 && /* @__PURE__ */ jsx(WorkDescription, { children: vol.highlights.map((highlight, idx) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, idx)) })
|
|
6399
6473
|
] }, index2))
|
|
6400
6474
|
] }),
|
|
6401
6475
|
awards.length > 0 && /* @__PURE__ */ jsxs(MainSection, { children: [
|
|
@@ -6410,7 +6484,14 @@ function Resume({ resume }) {
|
|
|
6410
6484
|
award.awarder,
|
|
6411
6485
|
award.date && ` - ${new Date(award.date).toLocaleDateString()}`
|
|
6412
6486
|
] }),
|
|
6413
|
-
award.summary && /* @__PURE__ */ jsx(
|
|
6487
|
+
award.summary && /* @__PURE__ */ jsx(
|
|
6488
|
+
InlineMarkdown,
|
|
6489
|
+
{
|
|
6490
|
+
as: "p",
|
|
6491
|
+
style: { marginTop: "8px", color: "#4a4a4a" },
|
|
6492
|
+
text: award.summary
|
|
6493
|
+
}
|
|
6494
|
+
)
|
|
6414
6495
|
]
|
|
6415
6496
|
},
|
|
6416
6497
|
index2
|
|
@@ -6463,7 +6544,14 @@ function Resume({ resume }) {
|
|
|
6463
6544
|
pub.publisher,
|
|
6464
6545
|
pub.releaseDate && ` - ${new Date(pub.releaseDate).toLocaleDateString()}`
|
|
6465
6546
|
] }),
|
|
6466
|
-
pub.summary && /* @__PURE__ */ jsx(
|
|
6547
|
+
pub.summary && /* @__PURE__ */ jsx(
|
|
6548
|
+
InlineMarkdown,
|
|
6549
|
+
{
|
|
6550
|
+
as: "p",
|
|
6551
|
+
style: { marginTop: "8px", color: "#4a4a4a" },
|
|
6552
|
+
text: pub.summary
|
|
6553
|
+
}
|
|
6554
|
+
)
|
|
6467
6555
|
]
|
|
6468
6556
|
},
|
|
6469
6557
|
index2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsonresume-theme-sidebar",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Two-column sidebar resume theme with dark sidebar and light main content - ATS-friendly",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"react": "^19.2.0",
|
|
29
29
|
"react-dom": "^19.2.0",
|
|
30
30
|
"styled-components": "^6.1.19",
|
|
31
|
-
"@jsonresume/core": "0.4.
|
|
31
|
+
"@jsonresume/core": "0.4.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@vitejs/plugin-react": "^4.3.4",
|
package/src/Resume.jsx
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
BadgeList,
|
|
8
8
|
safeUrl,
|
|
9
9
|
getLinkRel,
|
|
10
|
+
InlineMarkdown,
|
|
10
11
|
} from '@jsonresume/core';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -454,7 +455,7 @@ function Resume({ resume }) {
|
|
|
454
455
|
{basics.summary && (
|
|
455
456
|
<MainSection>
|
|
456
457
|
<MainSectionTitle>PROFILE</MainSectionTitle>
|
|
457
|
-
<ProfileText
|
|
458
|
+
<InlineMarkdown as={ProfileText} text={basics.summary} />
|
|
458
459
|
</MainSection>
|
|
459
460
|
)}
|
|
460
461
|
|
|
@@ -481,14 +482,16 @@ function Resume({ resume }) {
|
|
|
481
482
|
</WorkDate>
|
|
482
483
|
</WorkHeader>
|
|
483
484
|
{job.summary && (
|
|
484
|
-
<
|
|
485
|
-
|
|
486
|
-
|
|
485
|
+
<InlineMarkdown
|
|
486
|
+
as="p"
|
|
487
|
+
style={{ marginBottom: '10px', color: '#4a4a4a' }}
|
|
488
|
+
text={job.summary}
|
|
489
|
+
/>
|
|
487
490
|
)}
|
|
488
491
|
{job.highlights && job.highlights.length > 0 && (
|
|
489
492
|
<WorkDescription>
|
|
490
493
|
{job.highlights.map((highlight, idx) => (
|
|
491
|
-
<li key={idx}
|
|
494
|
+
<InlineMarkdown as="li" key={idx} text={highlight} />
|
|
492
495
|
))}
|
|
493
496
|
</WorkDescription>
|
|
494
497
|
)}
|
|
@@ -530,14 +533,16 @@ function Resume({ resume }) {
|
|
|
530
533
|
</WorkDate>
|
|
531
534
|
</WorkHeader>
|
|
532
535
|
{project.description && (
|
|
533
|
-
<
|
|
534
|
-
|
|
535
|
-
|
|
536
|
+
<InlineMarkdown
|
|
537
|
+
as="p"
|
|
538
|
+
style={{ marginBottom: '10px', color: '#4a4a4a' }}
|
|
539
|
+
text={project.description}
|
|
540
|
+
/>
|
|
536
541
|
)}
|
|
537
542
|
{project.highlights && project.highlights.length > 0 && (
|
|
538
543
|
<WorkDescription>
|
|
539
544
|
{project.highlights.map((highlight, idx) => (
|
|
540
|
-
<li key={idx}
|
|
545
|
+
<InlineMarkdown as="li" key={idx} text={highlight} />
|
|
541
546
|
))}
|
|
542
547
|
</WorkDescription>
|
|
543
548
|
)}
|
|
@@ -569,14 +574,16 @@ function Resume({ resume }) {
|
|
|
569
574
|
</WorkDate>
|
|
570
575
|
</WorkHeader>
|
|
571
576
|
{vol.summary && (
|
|
572
|
-
<
|
|
573
|
-
|
|
574
|
-
|
|
577
|
+
<InlineMarkdown
|
|
578
|
+
as="p"
|
|
579
|
+
style={{ marginBottom: '10px', color: '#4a4a4a' }}
|
|
580
|
+
text={vol.summary}
|
|
581
|
+
/>
|
|
575
582
|
)}
|
|
576
583
|
{vol.highlights && vol.highlights.length > 0 && (
|
|
577
584
|
<WorkDescription>
|
|
578
585
|
{vol.highlights.map((highlight, idx) => (
|
|
579
|
-
<li key={idx}
|
|
586
|
+
<InlineMarkdown as="li" key={idx} text={highlight} />
|
|
580
587
|
))}
|
|
581
588
|
</WorkDescription>
|
|
582
589
|
)}
|
|
@@ -601,9 +608,11 @@ function Resume({ resume }) {
|
|
|
601
608
|
` - ${new Date(award.date).toLocaleDateString()}`}
|
|
602
609
|
</WorkCompany>
|
|
603
610
|
{award.summary && (
|
|
604
|
-
<
|
|
605
|
-
|
|
606
|
-
|
|
611
|
+
<InlineMarkdown
|
|
612
|
+
as="p"
|
|
613
|
+
style={{ marginTop: '8px', color: '#4a4a4a' }}
|
|
614
|
+
text={award.summary}
|
|
615
|
+
/>
|
|
607
616
|
)}
|
|
608
617
|
</div>
|
|
609
618
|
))}
|
|
@@ -672,9 +681,11 @@ function Resume({ resume }) {
|
|
|
672
681
|
` - ${new Date(pub.releaseDate).toLocaleDateString()}`}
|
|
673
682
|
</WorkCompany>
|
|
674
683
|
{pub.summary && (
|
|
675
|
-
<
|
|
676
|
-
|
|
677
|
-
|
|
684
|
+
<InlineMarkdown
|
|
685
|
+
as="p"
|
|
686
|
+
style={{ marginTop: '8px', color: '#4a4a4a' }}
|
|
687
|
+
text={pub.summary}
|
|
688
|
+
/>
|
|
678
689
|
)}
|
|
679
690
|
</div>
|
|
680
691
|
))}
|