remark-file-tree

remark-file-tree

#

TypeScript

#

Remark

ツリー構造のコードブロックを生成するRemarkプラグイン

##概要

ディレクトリ構造の​コードブロックを​生成する​ Remark↗️ プラグインです。​当サイトでも​使用しています。
アイコンは​ Nerd Fonts↗️ で​表示しています。

##機能

下のような​コードブロックを​書いた​際に、​ディレクトリ構造を​綺麗に​表示してくれます。

```tree
web/
index.html # ← リネーム
about.html
contact.html
images/
logo.png
style/
styles.css
```
web/
index.html ← リネーム
about.html
contact.html
images/
logo.png
style/
styles.css

##インストール

Terminal window
npm install remark-file-tree

##使い方

当サイトでも​実際に​使っている​ Astro での​設定例です。​設定の​詳細は​ GitHub リポジトリ↗️ の​ README.md を​確認してください。

import { defineConfig } from "astro/config";
import remarkFileTree from "remark-file-tree";
export default defineConfig({
markdown: {
remarkPlugins: [
[remarkFileTree, { iconThemeMode = "theme" }]
],
},
});

##リンク

Discussion