blog/content/post/2013/06/29/2013-06-29-00001582.md

6.4 KiB
Raw Blame History

title author date url geo_latitude geo_longitude geo_public wordtwit_posted_tweets wordtwit_post_info categories
Github Flavored Markdown を Octopress で使用する kazu634 2013-06-29 /2013/06/29/_1796/
38.306229
141.022706
1
a:1:{i:0;i:1823;}
O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:1823;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}
インフラ

Github Flavored Markdown

備忘録として記録しておきます:

  1. Gemfilegem 'redcarpet', '~> 2.1.1'を追加する
  2. Gemfilegem 'albino', '~> 1.3.3'を追加する
  3. bundle install
  4. pluginディレクトリにredcarpet2_markdown.rbを追加する(Source Code)
  5. _config.ymlmarkdown: rdiscountを以下のように修正する

1
2
3
4
5
6
7
8
9
<span class='line'><span class="gd">-markdown: rdiscount</span>
</span><span class='line'><span class="gd">-rdiscount:</span>
</span><span class='line'><span class="gd">-  extensions:</span>
</span><span class='line'><span class="gd">-    - autolink</span>
</span><span class='line'><span class="gd">-    - footnotes</span>
</span><span class='line'><span class="gd">-    - smart</span>
</span><span class='line'><span class="gi">+markdown: redcarpet2</span>
</span><span class='line'><span class="gi">+redcarpet:</span>
</span><span class='line'><span class="gi">+  extentions: ["hard_wrap"]</span>
</span>

Pygment.rbの不具合

Snow Leopardだとなぜかこの問題に悩まされたため、この対応を実施しました:

@mattwildig thanks for posting your fix here. I was getting the same with Ruby 1.8, Pygments 0.5.0, and Python 2.6.1. Commenting out the relevant block in mentos.py fixed the issue for me (and now Jekyll works again see mojombo/jekyll#1181).

具体的にはpygments.rb/lib/pygments/mentos.py以下の行をコメントアウトしました:

1
2
3
4
5
<span class='line'><span class="k">for</span> <span class="n">fd</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span>  <span class="n">maxfd</span><span class="p">):</span>
</span><span class='line'>  <span class="k">try</span><span class="p">:</span>
</span><span class='line'>    <span class="n">os</span><span class="o">.</span><span class="n">close</span><span class="p">(</span><span class="n">fd</span><span class="p">)</span>
</span><span class='line'>  <span class="k">except</span><span class="p">:</span>
</span><span class='line'>    <span class="k">pass</span>
</span>

参考URL