下準備
まずはNode.jsを入れるところから。
> brew install nodebrew Warning: nodebrew 1.0.1 is already installed and up-to-date To reinstall 1.0.1, run `brew reinstall nodebrew`
あれ?
> nodebrew -v nodebrew 1.0.1 Usage: nodebrew help Show this message (以下略) > nodebrew list v10.15.3 v12.2.0 current: none
あー。
> nodebrew use v12.2.0 use v12.2.0 > nodebrew list v10.15.3 v12.2.0 current: v12.2.0
とりあえず、これで。気が向いたら更新する。
> node -v v12.2.0 > npm -v 6.9.0
下準備はOK
Quick start
docsify.js.org をやってみる。
> npm install docsify-cli -g /Users/tambara/.nodebrew/node/v12.2.0/bin/docsify -> /Users/tambara/.nodebrew/node/v12.2.0/lib/node_modules/docsify-cli/bin/docsify > fsevents@1.2.9 install /Users/tambara/.nodebrew/node/v12.2.0/lib/node_modules/docsify-cli/node_modules/fsevents > node install node-pre-gyp WARN Using needle for node-pre-gyp https download [fsevents] Success: "/Users/tambara/.nodebrew/node/v12.2.0/lib/node_modules/docsify-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" is installed via remote > core-js@2.6.9 postinstall /Users/tambara/.nodebrew/node/v12.2.0/lib/node_modules/docsify-cli/node_modules/core-js > node scripts/postinstall || echo "ignore" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) > docsify@4.9.4 postinstall /Users/tambara/.nodebrew/node/v12.2.0/lib/node_modules/docsify-cli/node_modules/docsify > opencollective postinstall Thanks for installing docsify 🙏 Please consider donating to our open collective to help us maintain this package. Number of contributors: 140 Number of backers: 12 Annual budget: US$ 158 Current balance: US$ 257 👉 Donate: https://opencollective.com/docsify/donate + docsify-cli@4.3.0 added 456 packages from 207 contributors in 24.511s
自分の日記の場所で初期化する。
> docsify init ./diary Initialization succeeded! Please run docsify serve ./diary
> cd diary/ > ls -la total 16 drwxr-xr-x 7 tambara staff 224 9 28 08:13 . drwxr-xr-x@ 8 tambara staff 256 9 23 13:28 .. -rw-r--r-- 1 tambara staff 0 10 26 1985 .nojekyll drwxr-xr-x 14 tambara staff 448 5 8 23:22 2018 drwxr-xr-x 12 tambara staff 384 9 2 10:23 2019 -rw-r--r-- 1 tambara staff 34 10 26 1985 README.md -rw-r--r-- 1 tambara staff 612 9 28 08:13 index.html
以下の3つのファイルが出来てる。
- index.html
- README.md
- .nojekyll
カレントディレクトリに戻って起動してみる。
> docsify serve diary Serving /Users/tambara/diary now. Listening at http://localhost:3000
何にもないページが出る
しばらくmarkdownで作業のメモを作るようにしていたので、過去に書いたメモはURLを指定すれば読める。
diary/2018/12/20181224.md というファイルを表示してみる。
なるほど。
とりあえず、動いてる。いったん、ここまで。次はディレクトリにあるファイルの一覧をブラウザで取れるようにしてみよう。