0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitBookでAnkerを使ったLinkのURLを使えるようにする

0
Posted at

内容の構築が遅延でされるから。
http://hostname/path#hash
のようなURLにリンクされない。

gitbook-plugin-anker-enable

これを作ったので

package.json
"devDependencies": {
  "eslint": "^1.5.1",
  "eslint-plugin-markdown": "git+ssh://git@github.com/sifue/eslint-plugin-markdown.git",
  "gitbook-cli": "^0.3.6",
  "textlint": "^3.6.0",
  "textlint-rule-max-ten": "^1.1.1",
  "textlint-rule-prh": "^1.1.0",
  "gitbook-plugin-anker-enable": "^0.0.3"
},

こんな感じでgitbookのpackage.jsonに"gitbook-plugin-anker-enable": "^0.0.3"書き加えて

npm install

その後、

book.json
{
    "plugins": [
        "gitbook-plugin-anker-enable"
    ]
}

として、

node_modules/.bin/gitbook build

これでOK。

これで300msec以内にロードされるようなコンテンツであればAnkerにジャンプできるようになる。正直、gitbookの作り方的にしかたないところもあるけれど、あまりにDirty Hackなのは許してほしい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?