1
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 3 years have passed since last update.

VS Code で Re:view のアウトラインを表示する方法

Posted at

前置き

Re:view の長文を Visual Code Studio で書くにあたり、アウトラインが無いと文章の構造を把握することが難しい。
そのため、アウトラインを表示させる方法を探し、ひとまず使えるレベルのアウトライン表示ができるようになったので、備忘録代わりに方法をメモしておく。

設定

Re:view のアウトライン表示のプラグインは見当たらないので、CodeMap - Visual Studio Marketplace を使ってアウトライン表示を実現する。

方法は、settings.json に以下のコードを追加して codemap の設定を追加する。ここでは、見出しレベル5までアウトラインとして表示するよう設定している。

"codemap.re": [
        {
            "pattern": "^(\\s*)===== (.*)",
            "clear": "=====",
            "prefix": "===== ",
            "icon": "none"
        },
        {
            "pattern": "^(\\s*)==== (.*)",
            "clear": "====",
            "prefix": "==== ",
            "icon": "none"
        },
        {
            "pattern": "^(\\s*)=== (.*)",
            "clear": "===",
            "prefix": "=== ",
            "icon": "none"
        },
        {
            "pattern": "^(\\s*)== (.*)",
            "clear": "==",
            "prefix": "== ",
            "icon": "none"
        },
        {
            "pattern": "^(\\s*)= (.*)",
            "clear": "=",
            "prefix": "= ",
            "icon": "none"
        },
        {
            "pattern": "!\\[img\\]",
            "clear": "![img]",
            "prefix": "<img>",
            "icon": "none"
        },
    ]

結果

次のように、見出しに応じたアウトラインが表示されるようになった。

image.png

1
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
1
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?