目次のプレビューができるように#331
Conversation
|
Please add one of the following labels: fix, bugfix, enhancement, feature, chore, release |
| ], | ||
| "devDependencies": { | ||
| "lerna": "^4.0.0" | ||
| "lerna": "^5.4.3" |
There was a problem hiding this comment.
| "@material-ui/core": "^4.11.4", | ||
| "@material-ui/icons": "^4.11.2", | ||
| "@material-ui/core": "^4.12.4", | ||
| "@material-ui/icons": "^4.11.3", |
There was a problem hiding this comment.
[note] ついでにバージョンアップ。どこかで バージョン5 にあげたい。
| @@ -0,0 +1,256 @@ | |||
| import { parseToc } from '../src/utils/toc'; | |||
There was a problem hiding this comment.
[note] 目次のパースを zenn-markdown-html に移します。のでテストも追加。
| @@ -0,0 +1,3 @@ | |||
| import { parseToc } from './toc'; | |||
|
|
|||
| export { parseToc }; | |||
There was a problem hiding this comment.
[help] 結局、re-export したほうがいいのかどうなのかわかってないです。アドバイスおねがいします 🙏
There was a problem hiding this comment.
node.js のライブラリなので、そのままでも大丈夫だと思います!
これが webpack や vite でバンドルされるようなライブラリなら "zenn-markdown-html/parseToc" のように一つの機能ごとにファイルにした方が Tree Shaking しやすいのでいいと思いますが、今回はそれは想定していないので大丈夫です。
There was a problem hiding this comment.
なるほど、そうなのですね、ありがとうございます!
| @@ -0,0 +1,47 @@ | |||
| import * as cheerio from 'cheerio'; | |||
There was a problem hiding this comment.
[note] 既存コードからのコピペです。
| @@ -0,0 +1,3 @@ | |||
| import { parseToc } from './toc'; | |||
|
|
|||
| export { parseToc }; | |||
There was a problem hiding this comment.
node.js のライブラリなので、そのままでも大丈夫だと思います!
これが webpack や vite でバンドルされるようなライブラリなら "zenn-markdown-html/parseToc" のように一つの機能ごとにファイルにした方が Tree Shaking しやすいのでいいと思いますが、今回はそれは想定していないので大丈夫です。
|
バージョンアップ作業がやや大掛かりになってきたため、別PRで対応します。
|
📑 Summary
記事やチャプターに対して、目次のプレビューができるようにします。
refs zenn-dev/zenn-community#399
これの一環。まずはフラッグシップ的に zenn-cli で試します。
📋 Tasks
プルリクエストを作成いただく際、お手数ですが以下の内容についてご確認をお願いします。
canaryブランチに対するプルリクエストである