{"id":15382388,"url":"https://github.com/sashafirsov/html-demo-element","last_synced_at":"2026-01-20T14:33:25.515Z","repository":{"id":57267327,"uuid":"341088615","full_name":"sashafirsov/html-demo-element","owner":"sashafirsov","description":"web component to showcase HTML rendered UI accompanied with syntax colored HTML source","archived":false,"fork":false,"pushed_at":"2024-11-06T06:08:50.000Z","size":312,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T00:34:57.876Z","etag":null,"topics":["source-preview"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sashafirsov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-22T05:22:11.000Z","updated_at":"2024-11-06T06:06:44.000Z","dependencies_parsed_at":"2022-09-02T05:40:51.816Z","dependency_job_id":null,"html_url":"https://github.com/sashafirsov/html-demo-element","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/sashafirsov/html-demo-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashafirsov%2Fhtml-demo-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashafirsov%2Fhtml-demo-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashafirsov%2Fhtml-demo-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashafirsov%2Fhtml-demo-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sashafirsov","download_url":"https://codeload.github.com/sashafirsov/html-demo-element/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sashafirsov%2Fhtml-demo-element/sbom","scorecard":{"id":801138,"data":{"date":"2025-08-11","repo":{"name":"github.com/sashafirsov/html-demo-element","commit":"e82a1912ac0021e5add255667acb57a0047ebef1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T10:30:33.379Z","repository_id":57267327,"created_at":"2025-08-23T10:30:33.380Z","updated_at":"2025-08-23T10:30:33.380Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28604925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["source-preview"],"created_at":"2024-10-01T14:31:42.465Z","updated_at":"2026-01-20T14:33:25.475Z","avatar_url":"https://github.com/sashafirsov.png","language":"JavaScript","readme":"# html-demo-element\nweb component inserts [prism JS syntax colored](https://prismjs.com/) HTML in demo-element before rendered UI for this HTML\n[![NPM version][npm-image]][npm-url] \n[![Published on webcomponents.org][wc-image]][wc-url] \n\nDependent prism script is located on unpkg.com CDN.\n\n## Sample\nThe code\n```html\n\u003chtml-demo-element legend=\"Error case\"\u003e\n    \u003cslotted-element src=\"https://badUrl.heck\"\u003e\n        \u003cp slot=\"loading\" hidden\u003eLoading... ⏳ \u003c/p\u003e\n        \u003cp slot=\"error\" hidden\u003eSomething went wrong. 😭 \u003c/p\u003e\n    \u003c/slotted-element\u003e\n\u003c/html-demo-element\u003e\n\n\u003cscript type=\"module\" src=\"https://unpkg.com/html-demo-element@1.0.12/html-demo-element.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"module\" src=\"https://unpkg.com/slotted-element@1.0.3/slotted-element.js\"\u003e\u003c/script\u003e\n```\n\nrenders following content:\n![screenshot](screenshot.png?raw=true \"screenshot\")\n\n# Use\nIf do not want to use template, include the script BEFORE inner content is modified. I.e. immediately after HTML and before scripts with components.\n\nThe use of `template` would defer the demo code injection after the source is rendered:\n```html\n\u003chtml-demo-element legend=\"Error case\"\u003e\n    \u003ctemplate\u003e\u003ci\u003eCandle 🕯️\u003c/i\u003e\u003c/template\u003e\n\u003c/html-demo-element\u003e\n```\n\nWhen you want to control where the source is located and where to render the code text, use slots:\n```html\n\u003chtml-demo-element\u003e\n    \u003ctemplate\u003eignored\u003c/template\u003e\n    \u003ctemplate slot=\"source\"\u003e \u003ci\u003eCroissant 🥐️ \u003c/i\u003e\u003c/template\u003e\n    \u003cp\u003e\u003ccode\u003eslot=\"source\"\u003c/code\u003e defines where to get code     \u003c/p\u003e\n\n    \u003cp\u003e\u003ccode\u003eslot=\"demo\"  \u003c/code\u003e inject the html from source:  \u003c/p\u003e\n    \u003cdiv slot=\"demo\"\u003e replaced with tasty demo \u003c/div\u003e\n\n    \u003cp\u003e\u003ccode\u003eslot=\"text\"  \u003c/code\u003e inject colored code text:     \u003c/p\u003e\n    \u003cdiv slot=\"text\"\u003e replaced with colored code \u003c/div\u003e\n    \n    \u003cdiv slot=\"description\"\u003e\u003c/div\u003e\n    \u003cdiv slot=\"legend\"\u003e\u003c/div\u003e\n\u003c/html-demo-element\u003e\n```\n\n# Live demo\n* https://unpkg.com/html-demo-element@1.0.12/demo/index.html\n* https://unpkg.com/html-demo-element@1.0.12/demo/advanced.html\n* https://unpkg.com/slotted-element@1.0.3/demo/index.html\n\n# API\n## Slots\n* `source` - the source code node. If omitted it would be taken either from embedded `template` content or\n  from embedded into `html-demo-element` dom.\n* `text` - placeholder where the highlighted code would be rendered. If omitted the text would be rendered on \n  top of template or top of `html-demo-element` content. \n* `demo` - placeholder where the code would be moved into for displaying live DOM( for HTML type ). \n  If omitted it would be placed beneath of `text` slot \n* `legend` - placeholder where the value of `legend` attribute would be rendered as H3. \n  When omitted, it would be placed on top.\n* `description` - placeholder where the value of `description` attribute would be rendered as dd. \n  When omitted, it would be placed on beneath of description.\n\n## Properties and attributes\n* `source` - the source code text. If the attribute is not defined, it would be initialized from `source` slot ^^\n* `type` - one of [prism js  supported languages](https://prismjs.com/#supported-languages) or `auto`. \n  `html`, `css`, `js` imported by default. When omitted, assumed `html`.\n* `legend` - optional heading for `html-demo-element`  \n* `description` - additional text in title, bellow the legend\n* `src` - optional url to retrieve the source. When `type` is omitted, it is detected from `content-type` or extension.\n\n[npm-image]:      https://img.shields.io/npm/v/html-demo-element.svg\n[npm-url]:        https://npmjs.org/package/html-demo-element\n[wc-image]:       https://img.shields.io/badge/webcomponents.org-published-blue.svg\n[wc-url]:         https://www.webcomponents.org/element/html-demo-element\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsashafirsov%2Fhtml-demo-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsashafirsov%2Fhtml-demo-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsashafirsov%2Fhtml-demo-element/lists"}