Help us understand the problem. What is going on with this article?

sublime text で githubのMarkdown記法を使う

More than 5 years have passed since last update.

Sublime Textで、Markdown書こうと思って調べてみると、
Markdown Previewプラグインというのがよく引っかかります。
これを入れればとりあえず、Markdownを書いてブラウザでプレビューすることができるようになります。

ですが、Markdown標準だとちょっと使いづらいです。
コードブロックの表示にシンタックスハイライトがないからです。

例えば、GitHub Flavored Markdownとかが使えると嬉しいです。
で、もう少し調べてみるとMarkdown Previewプラグインで"GitHub Flavored Markdown"が使えるらしい & 実際使えたのでメモしておきます。

https://github.com/revolunet/sublimetext-markdown-previewを見てみると

NOTE: If you choose the GitHub API for conversion (set parser: github in your settings), your code will be sent through https to github for live conversion. You'll have Github flavored markdown, syntax highlighting and EMOJI support for free . If you make more than 60 calls a day, be sure to set your GitHub API key in the settings :)

と書いてあります。

どっかで設定できるのかなーと探してみると

Preferences -> Package Settings -> Markdown Preview -> Settings - Default

にそれっぽい設定項目があります。

13行目付近

    /*
        Sets the default parser for converting markdown to html.
        Warning for github API : if you have a ST2 linux build, Python is not built with SSL o it may not work

        default - Use the builtin python-markdown2 parser
        github - User github API to convert markdown, so you can use GitHub flavored Markdown, see http://github.github.com/github-flavored-markdown/
    */
    "parser": "default",

38行目付近

    /*
        Uses an OAuth token to when parsing markdown with GitHub API. To create one for Markdown Preview, see https://help.github.com/articles/creating-an-oauth-token-for-command-line-use.
    */
    // "github_oauth_token": "secret"

この辺りを変更すれば良いようです。
github_oauth_tokenは、https://help.github.com/articles/creating-an-oauth-token-for-command-line-use に詳細が載っています。

以下のように設定することで無事にgithub形式のMarkdownがSublime Textでプレビューできるようになりました。

"parser": "github",
"github_oauth_token": "取得してきたキー",

以上です。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away