Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrovich committed Apr 30, 2020
1 parent 4b4f7e8 commit 0aac568
Show file tree
Hide file tree
Showing 23 changed files with 187 additions and 1 deletion.
1 change: 1 addition & 0 deletions .nyc_output/33ca4abe-2ab9-4df2-b262-e01f3ab05fb5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseComponent.js":{"path":"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseComponent.js","statementMap":{"0":{"start":{"line":1,"column":16},"end":{"line":1,"column":34}},"1":{"start":{"line":2,"column":14},"end":{"line":2,"column":30}},"2":{"start":{"line":3,"column":22},"end":{"line":3,"column":45}},"3":{"start":{"line":4,"column":27},"end":{"line":4,"column":64}},"4":{"start":{"line":5,"column":25},"end":{"line":5,"column":54}},"5":{"start":{"line":6,"column":19},"end":{"line":6,"column":40}},"6":{"start":{"line":7,"column":10},"end":{"line":7,"column":27}},"7":{"start":{"line":8,"column":23},"end":{"line":8,"column":50}},"8":{"start":{"line":9,"column":18},"end":{"line":9,"column":48}},"9":{"start":{"line":11,"column":0},"end":{"line":30,"column":1}},"10":{"start":{"line":12,"column":17},"end":{"line":12,"column":32}},"11":{"start":{"line":14,"column":25},"end":{"line":18,"column":20}},"12":{"start":{"line":19,"column":21},"end":{"line":19,"column":56}},"13":{"start":{"line":21,"column":4},"end":{"line":21,"column":61}},"14":{"start":{"line":22,"column":22},"end":{"line":22,"column":41}},"15":{"start":{"line":24,"column":4},"end":{"line":26,"column":5}},"16":{"start":{"line":25,"column":8},"end":{"line":25,"column":19}},"17":{"start":{"line":28,"column":22},"end":{"line":28,"column":84}},"18":{"start":{"line":29,"column":4},"end":{"line":29,"column":20}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":17},"end":{"line":11,"column":18}},"loc":{"start":{"line":11,"column":31},"end":{"line":30,"column":1}},"line":11}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":4},"end":{"line":26,"column":5}},"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":26,"column":5}},{"start":{"line":24,"column":4},"end":{"line":26,"column":5}}],"line":24}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":6,"11":6,"12":6,"13":6,"14":6,"15":6,"16":2,"17":4,"18":4},"f":{"0":6},"b":{"0":[2,4]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"be09b971d38be9da243192a116daa078c3c32919","contentHash":"c26653e734515662c5566364e8d65f9258f0fa295a35393c4a9ecf7fe2cf924b"},"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseSpecimens.js":{"path":"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseSpecimens.js","statementMap":{"0":{"start":{"line":1,"column":14},"end":{"line":1,"column":41}},"1":{"start":{"line":2,"column":25},"end":{"line":2,"column":47}},"2":{"start":{"line":3,"column":10},"end":{"line":3,"column":27}},"3":{"start":{"line":4,"column":30},"end":{"line":4,"column":64}},"4":{"start":{"line":5,"column":24},"end":{"line":5,"column":52}},"5":{"start":{"line":6,"column":14},"end":{"line":6,"column":40}},"6":{"start":{"line":7,"column":17},"end":{"line":7,"column":46}},"7":{"start":{"line":9,"column":0},"end":{"line":41,"column":1}},"8":{"start":{"line":9,"column":23},"end":{"line":41,"column":1}},"9":{"start":{"line":10,"column":27},"end":{"line":10,"column":29}},"10":{"start":{"line":12,"column":4},"end":{"line":34,"column":6}},"11":{"start":{"line":13,"column":37},"end":{"line":13,"column":69}},"12":{"start":{"line":15,"column":8},"end":{"line":17,"column":9}},"13":{"start":{"line":16,"column":12},"end":{"line":16,"column":18}},"14":{"start":{"line":19,"column":22},"end":{"line":19,"column":54}},"15":{"start":{"line":20,"column":28},"end":{"line":20,"column":56}},"16":{"start":{"line":21,"column":22},"end":{"line":21,"column":38}},"17":{"start":{"line":22,"column":24},"end":{"line":22,"column":43}},"18":{"start":{"line":23,"column":22},"end":{"line":29,"column":10}},"19":{"start":{"line":30,"column":8},"end":{"line":30,"column":34}},"20":{"start":{"line":32,"column":8},"end":{"line":32,"column":26}},"21":{"start":{"line":33,"column":8},"end":{"line":33,"column":28}},"22":{"start":{"line":36,"column":22},"end":{"line":39,"column":16}},"23":{"start":{"line":38,"column":39},"end":{"line":38,"column":83}},"24":{"start":{"line":40,"column":4},"end":{"line":40,"column":35}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":9,"column":17},"end":{"line":9,"column":18}},"loc":{"start":{"line":9,"column":23},"end":{"line":41,"column":1}},"line":9},"1":{"name":"(anonymous_1)","decl":{"start":{"line":9,"column":23},"end":{"line":9,"column":24}},"loc":{"start":{"line":9,"column":39},"end":{"line":41,"column":1}},"line":9},"2":{"name":"(anonymous_2)","decl":{"start":{"line":12,"column":24},"end":{"line":12,"column":25}},"loc":{"start":{"line":12,"column":34},"end":{"line":34,"column":5}},"line":12},"3":{"name":"(anonymous_3)","decl":{"start":{"line":38,"column":13},"end":{"line":38,"column":14}},"loc":{"start":{"line":38,"column":39},"end":{"line":38,"column":83}},"line":38}},"branchMap":{"0":{"loc":{"start":{"line":15,"column":8},"end":{"line":17,"column":9}},"type":"if","locations":[{"start":{"line":15,"column":8},"end":{"line":17,"column":9}},{"start":{"line":15,"column":8},"end":{"line":17,"column":9}}],"line":15},"1":{"loc":{"start":{"line":19,"column":38},"end":{"line":19,"column":53}},"type":"binary-expr","locations":[{"start":{"line":19,"column":38},"end":{"line":19,"column":47}},{"start":{"line":19,"column":51},"end":{"line":19,"column":53}}],"line":19}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":6,"9":6,"10":6,"11":12,"12":12,"13":2,"14":10,"15":10,"16":10,"17":10,"18":10,"19":10,"20":10,"21":10,"22":6,"23":4,"24":6},"f":{"0":6,"1":6,"2":12,"3":4},"b":{"0":[2,10],"1":[10,6]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"1a15011a7b2a1ef776f0b9694b2f10b1e89ff71c","contentHash":"87b46e7f4ca2e33689ebde2735880b64d51879d899482458fb2fc4b2b7134cea"},"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockNameAndType.js":{"path":"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockNameAndType.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}},"1":{"start":{"line":2,"column":20},"end":{"line":2,"column":55}},"2":{"start":{"line":3,"column":25},"end":{"line":3,"column":56}},"3":{"start":{"line":4,"column":4},"end":{"line":4,"column":23}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}},"loc":{"start":{"line":1,"column":29},"end":{"line":5,"column":1}},"line":1}},"branchMap":{"0":{"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":54}},"type":"binary-expr","locations":[{"start":{"line":2,"column":42},"end":{"line":2,"column":48}},{"start":{"line":2,"column":52},"end":{"line":2,"column":54}}],"line":2},"1":{"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":56}},"type":"cond-expr","locations":[{"start":{"line":3,"column":35},"end":{"line":3,"column":51}},{"start":{"line":3,"column":54},"end":{"line":3,"column":56}}],"line":3}},"s":{"0":1,"1":12,"2":12,"3":12},"f":{"0":12},"b":{"0":[12,1],"1":[10,2]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"c5ed49f9a7658c662177485b7e8a6759661eefd6","contentHash":"8a63314bcde4e0482f2692157e2ac766185e8e810a4718e0e1a4610e0b66004b"},"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockFlags.js":{"path":"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockFlags.js","statementMap":{"0":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}},"1":{"start":{"line":3,"column":0},"end":{"line":6,"column":1}},"2":{"start":{"line":4,"column":18},"end":{"line":4,"column":53}},"3":{"start":{"line":5,"column":4},"end":{"line":5,"column":16}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":17},"end":{"line":3,"column":18}},"loc":{"start":{"line":3,"column":29},"end":{"line":6,"column":1}},"line":3}},"branchMap":{},"s":{"0":1,"1":1,"2":10,"3":10},"f":{"0":10},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"a6a132a81758c2a46f811be907e2dcafd166b863","contentHash":"75b6ffaa5a3f3c0b0622805b34606149bb283c1db2f6cd404304229378445102"}}
1 change: 1 addition & 0 deletions .nyc_output/af1ec70e-963f-4773-bcd3-ad17a7378c43.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .nyc_output/df1c8578-58f2-4e7d-9c98-c2aebdbce40a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/extractCommentBlocks.js":{"path":"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/extractCommentBlocks.js","statementMap":{"0":{"start":{"line":1,"column":17},"end":{"line":1,"column":53}},"1":{"start":{"line":3,"column":0},"end":{"line":8,"column":1}},"2":{"start":{"line":4,"column":4},"end":{"line":4,"column":44}},"3":{"start":{"line":5,"column":20},"end":{"line":5,"column":66}},"4":{"start":{"line":6,"column":26},"end":{"line":6,"column":66}},"5":{"start":{"line":6,"column":57},"end":{"line":6,"column":65}},"6":{"start":{"line":7,"column":4},"end":{"line":7,"column":24}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":17},"end":{"line":3,"column":18}},"loc":{"start":{"line":3,"column":30},"end":{"line":8,"column":1}},"line":3},"1":{"name":"(anonymous_1)","decl":{"start":{"line":6,"column":46},"end":{"line":6,"column":47}},"loc":{"start":{"line":6,"column":57},"end":{"line":6,"column":65}},"line":6}},"branchMap":{},"s":{"0":1,"1":1,"2":4,"3":4,"4":4,"5":7,"6":4},"f":{"0":4,"1":7},"b":{},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"7fbd248147c7a65784245319f75ede3c9813302a","contentHash":"fab386fd76ca3e3e9583769ebbae78e394efcd05cba09e8e4ca11cf77480bcad"}}
1 change: 1 addition & 0 deletions .nyc_output/eb0a8760-104d-45d2-8bd9-ef46de4d7c59.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .nyc_output/eb58b80b-ece6-4556-816f-cebf2bf9289f.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":"eb58b80b-ece6-4556-816f-cebf2bf9289f","pid":16042,"argv":["/Users/mpetrovich/.nvm/versions/node/v10.20.1/bin/node","/Users/mpetrovich/Code/stylemark/stylemark/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/mpetrovich/Code/stylemark/stylemark","time":1588218614109,"ppid":16039,"coverageFilename":"/Users/mpetrovich/Code/stylemark/stylemark/.nyc_output/33ca4abe-2ab9-4df2-b262-e01f3ab05fb5.json","externalId":"","uuid":"33ca4abe-2ab9-4df2-b262-e01f3ab05fb5","files":["/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseComponent.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseSpecimens.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockNameAndType.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockFlags.js"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":null,"pid":16025,"argv":["/Users/mpetrovich/.nvm/versions/node/v10.20.1/bin/node","/Users/mpetrovich/Code/stylemark/stylemark/node_modules/.bin/nyc","ava"],"execArgv":[],"cwd":"/Users/mpetrovich/Code/stylemark/stylemark","time":1588218611776,"ppid":16024,"coverageFilename":"/Users/mpetrovich/Code/stylemark/stylemark/.nyc_output/af1ec70e-963f-4773-bcd3-ad17a7378c43.json","externalId":"","uuid":"af1ec70e-963f-4773-bcd3-ad17a7378c43","files":["/Users/mpetrovich/Code/stylemark/stylemark/src/compile/compileComponent.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/insertSpecimenNodes.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/removeBlockNames.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/removeHiddenBlocks.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/specimenNodeToHtmlTree.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/extractCommentBlocks.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockFlags.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockNameAndType.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseComponent.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseSpecimens.js"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":"eb58b80b-ece6-4556-816f-cebf2bf9289f","pid":16041,"argv":["/Users/mpetrovich/.nvm/versions/node/v10.20.1/bin/node","/Users/mpetrovich/Code/stylemark/stylemark/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/mpetrovich/Code/stylemark/stylemark","time":1588218614073,"ppid":16039,"coverageFilename":"/Users/mpetrovich/Code/stylemark/stylemark/.nyc_output/df1c8578-58f2-4e7d-9c98-c2aebdbce40a.json","externalId":"","uuid":"df1c8578-58f2-4e7d-9c98-c2aebdbce40a","files":["/Users/mpetrovich/Code/stylemark/stylemark/src/parse/extractCommentBlocks.js"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":"eb58b80b-ece6-4556-816f-cebf2bf9289f","pid":16040,"argv":["/Users/mpetrovich/.nvm/versions/node/v10.20.1/bin/node","/Users/mpetrovich/Code/stylemark/stylemark/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/mpetrovich/Code/stylemark/stylemark","time":1588218614083,"ppid":16039,"coverageFilename":"/Users/mpetrovich/Code/stylemark/stylemark/.nyc_output/eb0a8760-104d-45d2-8bd9-ef46de4d7c59.json","externalId":"","uuid":"eb0a8760-104d-45d2-8bd9-ef46de4d7c59","files":["/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseComponent.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseSpecimens.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockNameAndType.js","/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockFlags.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/compileComponent.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/removeHiddenBlocks.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/removeBlockNames.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/insertSpecimenNodes.js","/Users/mpetrovich/Code/stylemark/stylemark/src/compile/specimenNodeToHtmlTree.js"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"parent":null,"pid":16039,"argv":["/Users/mpetrovich/.nvm/versions/node/v10.20.1/bin/node","/Users/mpetrovich/Code/stylemark/stylemark/node_modules/.bin/ava"],"execArgv":[],"cwd":"/Users/mpetrovich/Code/stylemark/stylemark","time":1588218613358,"ppid":16025,"coverageFilename":"/Users/mpetrovich/Code/stylemark/stylemark/.nyc_output/eb58b80b-ece6-4556-816f-cebf2bf9289f.json","externalId":"","uuid":"eb58b80b-ece6-4556-816f-cebf2bf9289f","files":[]}
1 change: 1 addition & 0 deletions .nyc_output/processinfo/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"processes":{"33ca4abe-2ab9-4df2-b262-e01f3ab05fb5":{"parent":"eb58b80b-ece6-4556-816f-cebf2bf9289f","children":[]},"af1ec70e-963f-4773-bcd3-ad17a7378c43":{"parent":null,"children":[]},"df1c8578-58f2-4e7d-9c98-c2aebdbce40a":{"parent":"eb58b80b-ece6-4556-816f-cebf2bf9289f","children":[]},"eb0a8760-104d-45d2-8bd9-ef46de4d7c59":{"parent":"eb58b80b-ece6-4556-816f-cebf2bf9289f","children":[]},"eb58b80b-ece6-4556-816f-cebf2bf9289f":{"parent":null,"children":["33ca4abe-2ab9-4df2-b262-e01f3ab05fb5","df1c8578-58f2-4e7d-9c98-c2aebdbce40a","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"]}},"files":{"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseComponent.js":["33ca4abe-2ab9-4df2-b262-e01f3ab05fb5","af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseSpecimens.js":["33ca4abe-2ab9-4df2-b262-e01f3ab05fb5","af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockNameAndType.js":["33ca4abe-2ab9-4df2-b262-e01f3ab05fb5","af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/parseBlockFlags.js":["33ca4abe-2ab9-4df2-b262-e01f3ab05fb5","af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/compile/compileComponent.js":["af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/compile/insertSpecimenNodes.js":["af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/compile/removeBlockNames.js":["af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/compile/removeHiddenBlocks.js":["af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/compile/specimenNodeToHtmlTree.js":["af1ec70e-963f-4773-bcd3-ad17a7378c43","eb0a8760-104d-45d2-8bd9-ef46de4d7c59"],"/Users/mpetrovich/Code/stylemark/stylemark/src/parse/extractCommentBlocks.js":["af1ec70e-963f-4773-bcd3-ad17a7378c43","df1c8578-58f2-4e7d-9c98-c2aebdbce40a"]},"externalIds":{}}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stylemark   [![npm version](https://badge.fury.io/js/stylemark.svg)](https://badge.fury.io/js/stylemark) [![Build Status](https://travis-ci.org/nextbigsoundinc/stylemark.svg?branch=master)](https://travis-ci.org/nextbigsoundinc/stylemark)

**A living style guide generator for everything.** CSS, LESS, SASS, JS, React, Angular, Ember—you name it.
**Generate interactive style guides from Markdown.**

Document your style guide components in code comments or Markdown files, and Stylemark will generate a static HTML site with live, interactive components.

Expand Down
51 changes: 51 additions & 0 deletions dist/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const stylemark = {}

stylemark.findSpecimenType = (specimen) => {
const normalizedTypes = stylemark.specimenTypes.map((item) => (Array.isArray(item) ? item : [item, {}]))
const match = normalizedTypes.find(([typeConfig, options]) => typeConfig.test(specimen, options))
if (!match) {
return null
}
const [typeConfig, options] = match
const resolvedOptions = Object.assign({}, typeConfig.defaultOptions, options)
return [typeConfig, resolvedOptions]
}

stylemark.renderSpecimen = (specimen) => {
const host = document.currentScript.parentElement
const shadowRoot = host.attachShadow({ mode: "open" })
const [typeConfig, options] = stylemark.findSpecimenType(specimen)

if (!typeConfig) {
console.error("No typeConfig found for specimen", specimen)
return
}

const html = typeConfig.html ? typeConfig.html(specimen, options) : null
const css = typeConfig.css ? typeConfig.css(specimen, options) : null
const js = typeConfig.js ? typeConfig.js(specimen, options) : null

if (html) {
shadowRoot.innerHTML += html
}

if (css) {
const style = document.createElement("style")
style.type = "text/css"
style.textContent = css
shadowRoot.appendChild(style)
}

if (js) {
const script = document.createElement("script")
script.type = "text/javascript"
script.textContent = `(function() {
const scripts = window.document.getElementsByTagName("script");
const document = scripts[scripts.length - 1].parentNode.shadowRoot;
${js}
})()`
shadowRoot.appendChild(script)
}
}

window.stylemark = stylemark
1 change: 1 addition & 0 deletions dist/external-body.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("external body script")
1 change: 1 addition & 0 deletions dist/external-head.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("external head script")
Binary file added dist/images/a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/images/b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/images/stylemark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0aac568

Please sign in to comment.