{"id":24203616,"url":"https://github.com/tsutsu3/markdown-it-named-code-blocks","last_synced_at":"2026-02-28T13:20:06.078Z","repository":{"id":57161933,"uuid":"304099217","full_name":"tsutsu3/markdown-it-named-code-blocks","owner":"tsutsu3","description":"Named code block plugin for markdown-it.","archived":false,"fork":false,"pushed_at":"2025-12-16T10:36:57.000Z","size":705,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-19T23:50:26.012Z","etag":null,"topics":["markdown","markdown-it","markdown-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/markdown-it-named-code-blocks","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsutsu3.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-14T18:16:35.000Z","updated_at":"2025-12-16T10:36:54.000Z","dependencies_parsed_at":"2024-06-18T13:12:38.690Z","dependency_job_id":"270a2be9-a7e0-47de-b8b5-9670b462ea1e","html_url":"https://github.com/tsutsu3/markdown-it-named-code-blocks","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tsutsu3/markdown-it-named-code-blocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsutsu3%2Fmarkdown-it-named-code-blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsutsu3%2Fmarkdown-it-named-code-blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsutsu3%2Fmarkdown-it-named-code-blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsutsu3%2Fmarkdown-it-named-code-blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsutsu3","download_url":"https://codeload.github.com/tsutsu3/markdown-it-named-code-blocks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsutsu3%2Fmarkdown-it-named-code-blocks/sbom","scorecard":{"id":901223,"data":{"date":"2025-08-11","repo":{"name":"github.com/tsutsu3/markdown-it-named-code-blocks","commit":"af609d47b1fa208f3104d6c5df5aa4bf514a5923"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/8 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":"Maintained","score":4,"reason":"5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/tsutsu3/markdown-it-named-code-blocks/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/tsutsu3/markdown-it-named-code-blocks/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/tsutsu3/markdown-it-named-code-blocks/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/tsutsu3/markdown-it-named-code-blocks/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/tsutsu3/markdown-it-named-code-blocks/ci.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:33"],"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":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: all commits (25) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T15:38:46.008Z","repository_id":57161933,"created_at":"2025-08-24T15:38:46.008Z","updated_at":"2025-08-24T15:38:46.008Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29933021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["markdown","markdown-it","markdown-plugin"],"created_at":"2025-01-13T22:36:41.077Z","updated_at":"2026-02-28T13:20:06.024Z","avatar_url":"https://github.com/tsutsu3.png","language":"TypeScript","readme":"# markdown-it-named-code-blocks\n\nA [markdown-it](https://github.com/markdown-it/markdown-it#readme) plugin to create named code blocks.\n\n[![CI](https://github.com/tsutsu3/markdown-it-named-code-blocks/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/tsutsu3/markdown-it-named-code-blocks/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/markdown-it-named-code-blocks.svg?style=flat)](https://www.npmjs.org/package/markdown-it-named-code-blocks)\n[![Code Climate](https://codeclimate.com/github/tsutsu3/markdown-it-named-code-blocks/badges/gpa.svg)](https://codeclimate.com/github/tsutsu3/markdown-it-named-code-blocks)\n[![codecov](https://codecov.io/gh/tsutsu3/markdown-it-named-code-blocks/graph/badge.svg?token=RCS2WCEGWP)](https://codecov.io/gh/tsutsu3/markdown-it-named-code-blocks)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/tsutsu3/markdown-it-named-code-blocks/LICENSE)\n\n## 🧐 About\n\nWith this plugin you can create named code blocks like:\n\n````txt\n```js:hello.js\nconsole.log(\"Hello World!\")\n```\n````\n\nRendered as:\n\n```html\n\u003cpre class=\"named-fence-block\"\u003e\u003ccode class=\"language-js\"\u003econsole.log(\u0026quot;Hello World!\u0026quot;);\n\u003c/code\u003e\u003cdiv class=\"named-fence-filename\"\u003ehello.js\u003c/div\u003e\u003c/pre\u003e\n```\n\nAfter applying the css, it looks like this:\n\n![Rendered markdown](image/named_code_blocks.png)\n\n## 🏁 Getting Started\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/)\n\n### Installing\n\n```bash\nnpm install markdown-it-named-code-blocks\n```\n\n## 🎈 Usage\n\nUse this same as a normal markdown-it plugin:\n\n```js\nconst md = require(\"markdown-it\");\nconst hljs = require(\"highlight.js\");\nconst namedCodeBlocks = require(\".\");\n\nconst parser = md({\n  highlight: function (str, lang) {\n    if (lang \u0026\u0026 hljs.getLanguage(lang)) {\n      return (\n        '\u003cpre class=\"hljs\"\u003e\u003ccode\u003e' +\n        hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +\n        \"\u003c/code\u003e\u003c/pre\u003e\"\n      );\n    }\n\n    return (\n      '\u003cpre class=\"hljs\"\u003e\u003ccode\u003e' + md.utils.escapeHtml(str) + \"\u003c/code\u003e\u003c/pre\u003e\"\n    );\n  }\n}).use(namedCodeBlocks);\n\nconst str = '```js:hello.js\\nconsole.log(\"Hello World!\");\\n```';\n\nconst result = parser.render(str);\n\nconsole.log(result);\n```\n\nOutput:\n\n```html\n\u003cpre class=\"hljs named-fence-block\"\u003e\u003ccode\u003e\u003cspan class=\"hljs-variable language_\"\u003econsole\u003c/span\u003e.\u003cspan class=\"hljs-title function_\"\u003elog\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026quot;Hello World!\u0026quot;\u003c/span\u003e);\n\u003c/code\u003e\u003cdiv class=\"named-fence-filename\"\u003ehello.js\u003c/div\u003e\u003c/pre\u003e\n```\n\nApply CSS like this:\n\n```css\n.named-fence-block {\n  position: relative;\n  padding-top: 2em;\n}\n\n.named-fence-filename {\n  position: absolute;\n  top: 0;\n  left: 0;\n  padding: 0 4px;\n  font-weight: bold;\n  color: #000000;\n  background: #c0c0c0;\n  opacity: 0.6;\n}\n```\n\nRendered:\n\n![Rendered markdown](image/named_code_blocks.png)\n\nIf you want to enable inline CSS:\n\n```js\nconst parser = md().use(namedCodeBlocks, {isEnableInlineCss: true});\n```\n\nOutput:\n\n```html\n\u003cpre class=\"hljs named-fence-block\" style=\"position: relative; padding-top: 2em;\"\u003e\u003ccode\u003e\u003cspan class=\"hljs-variable language_\"\u003econsole\u003c/span\u003e.\u003cspan class=\"hljs-title function_\"\u003elog\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026quot;Hello World!\u0026quot;\u003c/span\u003e);\n\u003c/code\u003e\u003cdiv class=\"named-fence-filename\" style=\"position: absolute; top: 0; left: 0; padding: 0 4px; font-weight: bold; color: #000000; background: #c0c0c0; opacity: .6;\"\u003ehello.js\u003c/div\u003e\u003c/pre\u003e\n```\n\n## 🎉 License\n\nDistributed under the `MIT` License. See [LICENSE](https://github.com/tsutsu3/markdown-it-named-code-blocks/blob/master/LICENSE) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsutsu3%2Fmarkdown-it-named-code-blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsutsu3%2Fmarkdown-it-named-code-blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsutsu3%2Fmarkdown-it-named-code-blocks/lists"}