
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
gitbook-plugin-icp
Advanced tools
Gitbook plugin add "edit this page" link, and intelligent recognition to
Github
orGitlab
source repository.
book.json
filebook.json
file, add icp
to plugins
list.pluginsConfig
, Set base
value which is base path to your github or gitlab or other code repo. Trailing slash is NOT required.label
.pluginsConfig
, Set defaultBase
value which is set as default base path to your github or gitlab or other code repo. Trailing slash is also NOT required.Here is simplest example :
{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book"
}
}
}
In addition, the supported configuration options are as follows :
"base": {
"type": [
"string",
"object"
],
"title": "Base for the edit redirection",
"required": true
},
"defaultBase": {
"type": "string",
"title": "Default base for the edit redirection",
"required": false
},
"label": {
"type": [
"string",
"object"
],
"title": "Label for the edit button",
"default": "Edit This Page",
"required": false
}
gitbook install
. It will automatically install icp
gitbook plugin for your book. This is needed only once.gitbook install
or you can run npm install gitbook-plugin-icp
to install locally.
npm install gitbook-plugin-icp
gitbook build
) or serve (gitbook serve
) as usual.gitbook serve
https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/docs/book.json
{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": {
"snowdreams1006.github.io":"https://github.com/snowdreams1006/gitbook-plugin-icp/edit/master/docs",
"snowdreams1006.gitlab.io":"https://gitlab.com/snowdreams1006/gitbook-plugin-icp/edit/master/docs",
"snowdreams1006.gitee.io":"https://gitee.com/snowdreams1006/gitbook-plugin-icp/edit/master/docs"
},
"defaultBase": "https://github.com/snowdreams1006/gitbook-plugin-icp/edit/master/docs",
"label": "Edit This Page"
}
}
}
https://github.com/snowdreams1006/gitbook-plugin-icp/blob/master/example/book.json
{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": "https://github.com/snowdreams1006/gitbook-plugin-icp/edit/master/example"
}
}
}
book.json
file{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book"
}
}
}
or you can add label
to custom your label:
{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"label": "点我反馈"
}
}
}
book.json
file for Multi-source base{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": {
"USER.github.io":"https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"USER.gitlab.io":"https://gitlab.com/USER/REPO/edit/BRANCH/path/to/book",
"USER.gitee.io":"https://gitee.com/USER/REPO/edit/BRANCH/path/to/book",
"CUSTOME DOMAIN":"https://github.com/snowdreams1006/gitbook-plugin-icp/edit/master/docs"
},
"defaultBase": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"label": "Edit This Page"
}
}
}
book.json
file for multilingual labels{
"plugins": ["icp"],
"pluginsConfig": {
"icp": {
"base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
"label": {
"en": "Edit This Page",
"zh": "编辑本页"
}
}
}
}
Note: Above snippet can be used as complete book.json
file, if your book doesn't have one yet.
Github/Gitlab: In string ...REPO/edit/BRANCH...
, you may replace edit
with tree
if you want source file to open in read-mode, rather than edit-mode directly on github/gitlab.
👤 snowdreams1006
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a Star if this project helped you!
Copyright © 2019 snowdreams1006.
This project is MIT licensed.
book.json
is valid. You can use this online tool - http://json.parser.online.fr/beta/FAQs
gitbook plugin for adding icp info to footer
The npm package gitbook-plugin-icp receives a total of 2 weekly downloads. As such, gitbook-plugin-icp popularity was classified as not popular.
We found that gitbook-plugin-icp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.