Welcome to gitbook-plugin-icp 👋

npm:version npm:download npm:prerequisite github:documentation github:maintenance npm:license github:snodreams1006 微信公众号:雪之梦技术驿站-brightgreen.svg

gitbook plugin for adding icp info to footer

Usage

Step #1 - Update book.json file

  1. In you gitbook's book.json file, add icp to plugins list.
  2. In pluginsConfig,Set the number value to your own icp.
  3. In pluginsConfig,label or link value is NOT required.By default link url will be http://www.beian.miit.gov.cn/.

Here is simplest example :

{
    "plugins": ["icp"],
    "pluginsConfig": {
        "icp": {
            "number": "浙ICP备18042346号"
        }
    }
}

In addition, the supported configuration options are as follows :

"gitbook": {
  "properties": {
    "label": {
      "type": "string",
      "title": "icp label",
      "required": false
    },
    "number": {
      "type": "string",
      "title": "icp number",
      "required": true
    },
    "link": {
      "type": "string",
      "title": "link url",
      "required": false,
      "default": "http://www.beian.miit.gov.cn/"
    },
    "style": {
      "type": "object",
      "title": "icp number style",
      "required": false
    }
  }
}

Step #2 - gitbook commands

  1. Run 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
  1. Build your book (gitbook build) or serve (gitbook serve) as usual.
gitbook serve

Example

  • Sample book.json file
{
    "plugins": ["icp"],
    "pluginsConfig": {
        "icp": {
            "number": "YOUR OWN ICP NUMBER"
        }
    }
}

or you can add label to custom your label:

{
    "plugins": ["icp"],
    "pluginsConfig": {
        "icp": {
            "label": "YOUR OWN ICP LABEL",
            "number": "YOUR OWN ICP NUMBER"
        }
    }
}

or you can add link to custom your link:

{
    "plugins": ["icp"],
    "pluginsConfig": {
        "icp": {
            "label": "YOUR OWN ICP LABEL",
            "number": "YOUR OWN ICP NUMBER",
            "link":"YOUR OWN ICP LINK"
        }
    }
}

or you can add style to custom your style of number:

{
    "plugins": ["icp"],
    "pluginsConfig": {
        "icp": {
            "label": "YOUR OWN ICP LABEL",
            "number": "YOUR OWN ICP NUMBER",
            "link": "YOUR OWN ICP LINK",
            "style": {
              "color":  "#f72b07"
            }
        }
    }
}

Note: Above snippet can be used as complete book.json file, if your book doesn't have one yet.

Author

👤 snowdreams1006

Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a Star if this project helped you!

snowdreams1006-wechat-donate.jpg

Copyright © 2019 snowdreams1006.

This project is MIT licensed.

Author: 雪之梦技术驿站
Url: https://snowdreams1006.github.io/gitbook-plugin-icp/en/
Source: 雪之梦技术驿站
This article was originally published in「雪之梦技术驿站」,Reproduced please indicate the source, thank you for cooperation!

https://snowdreams1006.github.io/snowdreams1006-wechat-open.png

最后更新时间: 2024-08-15 14:41:15

results matching ""

    No results matching ""