Skip to content

Commit 74e66cf

Browse files
authored
✨ add declarative shadow dom json-resume-ui (#3)
1 parent 3a30d69 commit 74e66cf

File tree

13 files changed

+3796
-2674
lines changed

13 files changed

+3796
-2674
lines changed

.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path'
33

44
export const references = {
55
"title": "jsonresume-theme-microdata",
6-
"url": "https://6632f42ef9bacea464588c02-tkarrbykzd.chromatic.com/",
6+
"url": "https://main--6632f42ef9bacea464588c02.chromatic.com/",
77
expanded: false,
88
}
99

README.hbs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# jsonresume-component
22

3-
`<json-resume>` is a web component (using LitElement) which presents resume content stored in [JSON Resume][jsonresume] format. The HTML structure uses the components from [jsonresume-theme-microdata][jtm] to generate HTML which includes structured data as microdata in HTML attributes.
3+
`<json-resume>` is a web component (using LitElement) which presents resume content stored in [JSON Resume][jsonresume] format. The HTML structure uses the components from [jsonresume-theme-microdata][jtm] to generate HTML which includes structured data as microdata in HTML attributes.
4+
5+
`<json-resume>` extends `<json-resume-ui>` (included in the NPM release and this repo), which can be used in server-side rendering situations to generate a declarative shadow DOM containing the resume HTML and styles.
6+
7+
Check out [the storybook for `jsonresume-component`](https://main--6632f42ef9bacea464588c02.chromatic.com) to play with both components.
48

59

610
## NPM / Node.js usage
@@ -11,14 +15,32 @@
1115
npm i jsonresume-component
1216
```
1317

18+
### Resume from Gist ID
19+
1420
```javascript
15-
import { JsonResume } from 'jsonresume-component/src/index.js';
21+
import { JsonResume } from 'jsonresume-component';
1622
```
1723

1824
```html
1925
<JsonResume gist_id="9e7a7ceb9425336c6aa08d58afb63b8d"></JsonResume>
2026
```
2127

28+
### Declarative Shadow DOM
29+
30+
You can generate the HTML on the server using the `<json-resume-ui>` component.
31+
32+
```javascript
33+
import { JsonResumeUI } from 'jsonresume-component/ui';
34+
// your resume data
35+
import resumejson from '../local/path/to/resume.json'
36+
// you can use your own stylesheet instead of the bundled one
37+
import styles from 'jsonresume-component/style.css?inline'
38+
```
39+
40+
```html
41+
<JsonResumeUI resumejson={resumejson} stylesheet={styles}></JsonResumeUI>
42+
```
43+
2244
## Browser usage
2345

2446
The web component is lightly-bundled in that it puts all non-`lit` external files in a single .js file, which is located at `./dist/json-resume.js` in the NPM package.

README.md

Lines changed: 151 additions & 31 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)