0.3.1 • Published 12 months ago

jsonresume-component v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

jsonresume-component

<json-resume> is a web component (using LitElement) which presents resume content stored in JSON Resume format. The HTML structure uses the components from jsonresume-theme-microdata to generate HTML which includes structured data as microdata in HTML attributes.

<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.

Check out the storybook for jsonresume-component to play with both components.

NPM / Node.js usage

Install dependencies

npm i jsonresume-component

Resume from Gist ID

import { JsonResume } from 'jsonresume-component';
<JsonResume gist_id="9e7a7ceb9425336c6aa08d58afb63b8d"></JsonResume>

Declarative Shadow DOM

You can generate the HTML on the server using the <json-resume-ui> component.

import { JsonResumeUI } from 'jsonresume-component/ui';
// your resume data
import resumejson from '../local/path/to/resume.json'
// you can use your own stylesheet instead of the bundled one
import styles from 'jsonresume-component/style.css?inline'
<JsonResumeUI resumejson={resumejson} stylesheet={styles}></JsonResumeUI>

Browser usage

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.

include lit dependencies

<json-resume> uses lit and @lit/task which must be imported into your HTML file. You can include dependencies with an importmap like this:

<script type="importmap">
  {
    "imports": {
      "lit": "https://esm.run/lit",
      "@lit/task": "https://esm.run/@lit/task"
    }
  }
</script>

Add jsonresume-component

unpkg points directly to the lightly-bundled web component file, which does not include lit.

<script type="module">
  import 'https://unpkg.com/jsonresume-component'
</script>

Use the web component by giving it your gist ID

<json-resume gist_id="54682f0aa17453d46cdc74bdef3172a3"></json-resume>

The web component accepts a resume.json url

<json-resume json_url="https://gist.githubusercontent.com/scottnath/54682f0aa17453d46cdc74bdef3172a3/raw/resume.json"></json-resume>

Options

A modified JSON Resume schema

The JSON structure follows an extension of the JSON Resume schema with added schema structure for microdata itemtype on some content types, basics.pronouns, and meta.themeOptions which allows changing the content of the resume section titles, colors, and other theme opts. See the jsonresume-theme-microdata README for details on this adjusted structure.

class: JsonResumeUI, json-resume-ui

Fields

NamePrivacyTypeDefaultDescriptionInherited From
labelpublicstringThe aria-label for the `div` containing the resume. Defaults to `${basics.name}'s resume`
resumejsonpublicobjectProperty accepts a JSON Resume object
stylesheetpublicstringAccepts a string containing styles **WARNING** Completely deletes and overrides internal component styles

CSS Properties

NameDefaultDescription
--color-background-lightBackground color, light theme
--color-dimmed-lightDimmed background color, light theme
--color-primary-lightPrimary color, light theme
--color-secondary-lightSecondary color, light theme
--color-link-lightLink color, light theme
--color-background-darkBackground color, dark theme
--color-dimmed-darkDimmed background color, dark theme
--color-primary-darkPrimary color, dark theme
--color-secondary-darkSecondary color, dark theme
--color-link-darkLink color, dark theme
--font-sizeComponent font size, basis for many `em`-based styles
--font-familyComponent font family

CSS Parts

NameDescription
jsonresumeresume container
resumeresume main article
basicsstyle the `basics` section
nameperson's name, h1
labelperson's title/label, h2
imageperson's image
summaryperson's summary
contactcontacts/locations list within basics
profilesprofiles list within basics
section-titlestyles the `h3` title of all sections
workstyle the `work` section
volunteerstyle the `volunteer` section
educationstyle the `education` section
awardsstyle the `awards` section
certificatesstyle the `certificates` section
publicationsstyle the `publications` section
skillsstyle the `skills` section
languagesstyle the `languages` section
interestsstyle the `interests` section
referencesstyle the `references` section
projectsstyle the `projects` section
metastyle the `meta` section

Slots

NameDescription
basicsReplace the entire `basics` HTML section
workReplace the entire `work` HTML section
volunteerReplace the entire `volunteer` HTML section
educationReplace the entire `education` HTML section
awardsReplace the entire `awards` HTML section
certificatesReplace the entire `certificates` HTML section
publicationsReplace the entire `publications` HTML section
skillsReplace the entire `skills` HTML section
languagesReplace the entire `languages` HTML section
interestsReplace the entire `interests` HTML section
referencesReplace the entire `references` HTML section
projectsReplace the entire `projects` HTML section
metaReplace the entire `meta` HTML section

Exports

KindNameDeclarationModulePackage
jsJsonResumeUIJsonResumeUIsrc/ui.js
custom-element-definitionjson-resume-uiJsonResumeUIsrc/ui.js

class: JsonResume, json-resume

Fields

NamePrivacyTypeDefaultDescriptionInherited From
gist_idpublicstringGitHub gist ID. When present, calls the GitHub rest API to fetch a resume.json gist's content. Checked first, if gist is present and has a resume.json, `json_url` and `local_file` will be ignored.
json_urlpublicstringURL to a JSON file. When present, used to fetch a resume.json file from the URL. Checked second or if gist_id does not have a resume.json, `local_file` will be ignored.
preorderedpublicbooleanWhen true, sections of resume (basic, work, etc) will be injected according to their order in resume.json
labelpublicstringThe aria-label for the `div` containing the resume. Defaults to `${basics.name}'s resume`JsonResumeUI
resumejsonpublicobjectProperty accepts a JSON Resume objectJsonResumeUI
stylesheetpublicstringAccepts a string containing styles **WARNING** Completely deletes and overrides internal component stylesJsonResumeUI

CSS Properties

NameDefaultDescription
--color-background-lightBackground color, light theme
--color-dimmed-lightDimmed background color, light theme
--color-primary-lightPrimary color, light theme
--color-secondary-lightSecondary color, light theme
--color-link-lightLink color, light theme
--color-background-darkBackground color, dark theme
--color-dimmed-darkDimmed background color, dark theme
--color-primary-darkPrimary color, dark theme
--color-secondary-darkSecondary color, dark theme
--color-link-darkLink color, dark theme
--font-sizeComponent font size, basis for many `em`-based styles
--font-familyComponent font family

CSS Parts

NameDescription
jsonresumeresume container
resumeresume main article
basicsstyle the `basics` section
nameperson's name, h1
labelperson's title/label, h2
imageperson's image
summaryperson's summary
contactcontacts/locations list within basics
profilesprofiles list within basics
section-titlestyles the `h3` title of all sections
workstyle the `work` section
volunteerstyle the `volunteer` section
educationstyle the `education` section
awardsstyle the `awards` section
certificatesstyle the `certificates` section
publicationsstyle the `publications` section
skillsstyle the `skills` section
languagesstyle the `languages` section
interestsstyle the `interests` section
referencesstyle the `references` section
projectsstyle the `projects` section
metastyle the `meta` section

Slots

NameDescription
basicsReplace the entire `basics` HTML section
workReplace the entire `work` HTML section
volunteerReplace the entire `volunteer` HTML section
educationReplace the entire `education` HTML section
awardsReplace the entire `awards` HTML section
certificatesReplace the entire `certificates` HTML section
publicationsReplace the entire `publications` HTML section
skillsReplace the entire `skills` HTML section
languagesReplace the entire `languages` HTML section
interestsReplace the entire `interests` HTML section
referencesReplace the entire `references` HTML section
projectsReplace the entire `projects` HTML section
metaReplace the entire `meta` HTML section

Exports

KindNameDeclarationModulePackage
jsJsonResumeJsonResumesrc/index.js
custom-element-definitionjson-resumeJsonResumesrc/index.js
0.3.0

1 year ago

0.3.1

12 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.0-next.2

1 year ago

0.2.0-next.1

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.1.0-next.7

1 year ago

0.1.0-next.6

1 year ago

0.1.0-next.5

1 year ago

0.1.0-next.4

1 year ago

0.1.0-next.3

1 year ago