{"id":21296529,"url":"https://github.com/yakima-teng/gitbook-plugin-theme-code","last_synced_at":"2025-09-12T06:42:38.076Z","repository":{"id":79105444,"uuid":"131724264","full_name":"Yakima-Teng/gitbook-plugin-theme-code","owner":"Yakima-Teng","description":"🌱 A gitbook theme for websites focusing on code","archived":false,"fork":false,"pushed_at":"2018-07-13T03:30:11.000Z","size":909,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-20T05:54:08.266Z","etag":null,"topics":["gitbook","gitbook-plugin","gitbook-theme"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gitbook-plugin-theme-code","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/Yakima-Teng.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}},"created_at":"2018-05-01T14:42:53.000Z","updated_at":"2020-06-17T03:18:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d8bef44-b8c6-4160-a46d-3220e15e0735","html_url":"https://github.com/Yakima-Teng/gitbook-plugin-theme-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yakima-Teng/gitbook-plugin-theme-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakima-Teng%2Fgitbook-plugin-theme-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakima-Teng%2Fgitbook-plugin-theme-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakima-Teng%2Fgitbook-plugin-theme-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakima-Teng%2Fgitbook-plugin-theme-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yakima-Teng","download_url":"https://codeload.github.com/Yakima-Teng/gitbook-plugin-theme-code/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yakima-Teng%2Fgitbook-plugin-theme-code/sbom","scorecard":{"id":154155,"data":{"date":"2025-08-11","repo":{"name":"github.com/Yakima-Teng/gitbook-plugin-theme-code","commit":"0f8413a9dee670d1764c942c7fcc10ccd36459bd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":-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":"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":"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: 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 'master'"],"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":"Vulnerabilities","score":0,"reason":"38 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-hc9w-4p87-j549","Warn: Project is vulnerable to: GHSA-wg6g-ppvx-927h","Warn: Project is vulnerable to: GHSA-wxhq-pm8v-cw75","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-6c3j-c64m-qhgq","Warn: Project is vulnerable to: GHSA-gxr4-xjj5-5px2","Warn: Project is vulnerable to: GHSA-jpcq-cgw6-v4j6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj"],"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-16T11:20:07.733Z","repository_id":79105444,"created_at":"2025-08-16T11:20:07.733Z","updated_at":"2025-08-16T11:20:07.733Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274770378,"owners_count":25346210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gitbook","gitbook-plugin","gitbook-theme"],"created_at":"2024-11-21T14:27:47.130Z","updated_at":"2025-09-12T06:42:38.062Z","avatar_url":"https://github.com/Yakima-Teng.png","language":"JavaScript","readme":"# GitBook Theme - for websites focusing on code\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://npmcharts.com/compare/gitbook-plugin-theme-code?minimal=true\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/gitbook-plugin-theme-code.svg\" alt=\"Downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/gitbook-plugin-theme-code\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/gitbook-plugin-theme-code.svg\" alt=\"Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/gitbook-plugin-theme-code\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/gitbook-plugin-theme-code.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis is based on the default theme for GitBook since version `3.0.0`. Currently there are no big changes but some bug fixes and a site title added to the top of the sidebar.\n\nAn example snapshot:\n\n![Image](./preview.png)\n\nExample configuration (book.json):\n\n```json\n{\n  \"title\": \"Site Title\",\n  \"author\": \"Author Name\",\n  \"authorHomepage\": \"http://www.example.com\",\n  \"baiduStatisticsCode\": \"\",\n  \"description\": \"site description\",\n  \"language\": \"zh-hans\",\n  \"copyright\": \"All Rights Reserved\",\n  \"variables\": {\n    \"homePage\": \"/\"\n  },\n  \"plugins\": [\n    \"theme-code\",\n    \"splitter\",\n    \"prism\",\n    \"folding-chapters\",\n    \"-sharing\"\n  ],\n  \"pluginsConfig\": {\n    \"theme-default\": {\n      \"showLevel\": true\n    }\n  }\n}\n```\n\n## To developers\n\nIf you want to develop GitBook theme and publish it to npm repository, you should name your package to somewhat like `gitbook-plugin-theme-themename`. For details, please refer to the [official online document](https://toolchain.gitbook.com/). Here are some tips for you.\n\n\n### Tip 1: Test your plugin locally\n\nIn the plugin's folder, run:\n\n```bash\nnpm link\n```\n\nThen in your book's folder:\n\n```bash\nnpm link gitbook-plugin-plugin-name\n```\n\n### Tip 2: build on base of default official theme for GitBook\n\nActually, this project is also built on base of the [GitBook Default Theme](https://github.com/GitbookIO/theme-default). However, if you want to use the default theme, you should remember to fix two bugs showed bellow (At first I would like to send a pull request to the author of that project, but when I open its github page, I found many PR unhandled, so I planned not to waste my time -_-):\n\nIn the file `src/js/theme/navigation.js`, you could find code like this:\n\n```javascript\n// Get current page summary chapters\n$chapters = $('.book-summary .summary .chapter')\n    .filter(function() {\n        var $link = $(this).children('a'),\n            href  = null;\n    \n        // Chapter doesn't have a link\n        if (!$link.length) {\n            return false;\n        }\n        else {\n            href = $link.attr('href').split('#')[0];\n        }\n    \n        var resolvedRef = url.resolve(window.location.pathname, href);\n        return window.location.pathname == resolvedRef;\n    });\n```\n\nYou should replace the code `window.location.pathname == resolvedRef;` to `decodeURIComponent(window.location.pathname) == decodeURIComponent(resolvedRef)`.\n\nThe bug can be repeated if your url in the browser contains special characters such as Chinese, because equality judgement in the code will fail in that case: `window.location.pathname` will get the encoded characters, while `$link.attr('href')` will get the original characters.\n\nHere is another bug, in `_layouts/website/summary.html`:\n\n```html\n{% if article.path or article.url %}\n    \u003c/a\u003e\n{% else %}\n    \u003c/span\u003e\n{% endif %}\n```\n\nThe code above should be replaced by the code below:\n\n```html\n{% if (article.path and getPageByPath(article.path)) or article.url %}\n    \u003c/a\u003e\n{% else %}\n    \u003c/span\u003e\n{% endif %}\n```\n\nOtherwise, you will find sometime the HTML tag `SPAN` is closed by tag `A`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakima-teng%2Fgitbook-plugin-theme-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyakima-teng%2Fgitbook-plugin-theme-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakima-teng%2Fgitbook-plugin-theme-code/lists"}