adbird(広告鳥) 備忘録

Geanyエディタのマークダウンプレビュー

プラグインのインストール

Ubuntu16.04の場合、

$ sudo apt-get install geany-plugin-markdown

プラグインをインストール。

ツール>プラグインマネージャ で「Markdownプラグインにチェックを入れて、設定をすればOK。

プレビュー画面を自分好みに設定

デフォルトのままだと見出しのフォントが大きすぎるなど、いまいちなので、

.config/geany/plugins/markdown/

に入っている template.html のcss部分をいじって、自分好みに設定する。

また、プレビュー画面(サイドバー)と編集画面を左右を入れ替えるには、

編集>設定>インターフェイス>サイドバー の、「位置」で左右好きな方に設定すればよい。

template.html の例

ちなみに現在の僕の template.html は以下のような感じ。

<html>
<head>
    <style type="text/css">
        body{
        background-color: @@bg_color@@;
        color: @@fg_color@@;
        }

    h1::before {
        content: counter(chapter) ".";}

        h1{font-family: @@font_name@@;
        font-size: @@font_point_size@@pt;
        font-weight:bold;
        line-height:1.5;
        text-align: justify;
        counter-increment: chapter;
        counter-reset:section;
        }

        h2{font-family: @@font_name@@;
        font-size: @@font_point_size@@pt;
        font-weight:bold;
        }

        p{font-family: @@font_name@@;
        font-size: @@font_point_size@@pt;
        line-height:1.5;
        }

        code {
        font-family: @@code_font_name@@;
        font-size: @@code_font_point_size@@pt;
        }

        /*リスト*/
        ul{list-style-type:circle;}

        /*数字リストをカタカナに*/
        ol {
        list-style-type: katakana;
        }

        li{font-family: @@font_name@@;
        font-size: @@font_point_size@@pt;
        line-height:1.5;}

        /*強調*/
        em {
        font-weight:bold;
        font-style:normal;
        }

    </style>
</head>
<body>
    @@markdown@@
</body>
</html>