MoinMoin 㧠Markdown (Github Flavored Markdown) ã使ã
Markdown ã®ã¡ã¢å¸³ã¨ã㦠kobito ã使ã£ã¦ãããã ãã© Qiita ã«æ°è¦æ稿ãã§ããªãããéå»ã®æ稿ã¯ç·¨éã§ãããã©åå¾ã¯ã§ããªã(ã¤ã¾ãæ¸ããè¨äºããã¤ã®ã¾ã«ãå·»ãæ»ããã¦ãã)ã¨ããç¶æ ã«é »ç¹ã«ãªãã®ã§ä½¿ãã®ãããã¾ããããªããªãã ãå«ããããã
ããå æ¸ããããã®ã§ Qiita ã§æ¸ãã¦ãããã®ã®ãã¡ãéå ¬éã«ãã¦ãããã®ãèªåã§ç®¡çãã¦ãã MoinMoin Wiki ã«è¨äºã移è¡ãããã¨ã«ãã¾ãããå ¬éãã¦ãããã®ã¯ãã®ããã°ã«æã£ã¦ãããã¨ã«ãã¾ãã
ãã¦ãQiita 㯠Markdown ã§ãMoinMoin ã¯ç¬èªè¨æ³ãªã®ã§åç´ã«èããã¨å¤æãæ¸ããå¿ è¦ããããã¨æãããå®ã¯ãããªå¿ è¦ã¯ãªããMoinMoin ã® parser ã¯ãã©ã¬ãã«ã«ãªã£ã¦ãã¦èªåã§è¿½å ãã§ããã®ã§èªå㧠Markdown ãã¼ãµã¼ãæ¸ãã¦ããã° OKã MoinMoin ã®å ¬å¼ã® Wiki ã«ã¯ Python ã® Markdown ã©ã¤ãã©ãªãç¨ããæ¹æ³ãç´¹ä»ããã¦ãã¾ãã
ããã使ã£ã¦ã¿ãã Qiita 㯠Github Flavored Markdown (ã®äºç¨®ï¼)ãªã®ã§ã³ã¼ããããã¯ãªã©ã Markdown ã©ã¤ãã©ãªã ã¨ãã¾ãã¬ã³ããªã³ã°ã§ãã¾ããã§ãããGithub Flavored Markdown ãæ±ããã©ã¤ãã©ãªãæ¢ãã¦ããã dart-lang ã®äººãã¡ããªãã python ã§å®è£ ãã¦ãã py-gfm ã¨ããã®ãæãã¦ãããã¾ããã
ã¨ããããã§ã¾ã py-gfm ãã¤ã³ã¹ãã¼ã«ãã¾ãã
$ git clone https://github.com/dart-lang/py-gfm.git $ cd py-gfm $ python setup.py install
ãã㧠Markdown ã©ã¤ãã©ãªã§ GFM æ¡å¼µã使ããããã«ãªãã®ã§ãããã使ã£ã¦ GFM ãã©ã°ã¤ã³ãæ¸ãã¾ãã
# coding: utf-8 from markdown import markdown import json Dependencies = ['user'] class Parser: def __init__(self, raw, request, **kw): self.raw = raw self.request = request def format(self, formatter): output_html = markdown(self.raw, extensions=['gfm']) try: self.request.write(formatter.rawHTML(output_html)) except: self.request.write(formatter.escapedText(output_html))
ããããããã¼ã§ããããã㧠GFM ãã©ã°ã¤ã³ã®å®æã§ããç°¡åã§ããã text_markdown.py ã¨ããåå㧠MoinMoin ã® plugin/parser ãã£ã¬ã¯ããªã«å ¥ãã¦ããã¾ãããã
2015/02/10 追è¨
åå ã¯è¿½ã£ã¦ãªããã©æè¿ py-gfm ãåä½ããªããªã£ãã®ã§ Markdown ã® extension ãçµã¿åããã¦ã»ã¼ GFM ã£ã½ãæãã«ãã¦ã¾ããããã ãã§ååããããªã«ãäºææ§å£ããã®ããªã¼ã
# coding: utf-8 from markdown import markdown import json Dependencies = ['user'] class Parser: def __init__(self, raw, request, **kw): self.raw = raw self.request = request def format(self, formatter): output_html = markdown( self.raw, extensions=[ 'markdown.extensions.fenced_code', 'markdown.extensions.toc', 'markdown.extensions.codehilite', 'markdown.extensions.wikilinks', 'markdown.extensions.tables', 'markdown.extensions.def_list', 'markdown.extensions.nl2br', 'markdown.extensions.headerid', ]) try: self.request.write(formatter.rawHTML(output_html)) except: self.request.write(formatter.escapedText(output_html))
Markdown 㧠Wiki ã¨ã³ããªã追å ãã
markdown 㧠Wiki ã«ã¨ã³ããªã追å ãããã¨ãã¯ãæ¸ãåºãã
#format text_markdown (空è¡)
ã«ããã° Markdown ã¨ãã¦è§£éãã¦ãããããã«ãªãã¾ãã
ããã§ã¬ã³ããªã³ã°ãå´©ãããã¨ã¯ãªããªãã¾ããããCSS ãå½ãã£ã¦ãã¾ããã CSS ã¯ã©ãã«è¿½å ããã®ãæµåãªãã§ãããããããããããªãã®ã§æ¬ä½ã® common.css ã« https://github.com/johnmdonahue/git_marked ããæåããã®ãçªã£è¾¼ãã§ãã¾ãã¾ããã
.c{color:#998;font-style:italic;} .err{color:#a61717;background-color:#e3d2d2;} .k{font-weight:bold;} .o{font-weight:bold;} .cm{color:#998;font-style:italic;} .cp{color:#999;font-weight:bold;} .c1{color:#998;font-style:italic;} .cs{color:#999;font-weight:bold;font-style:italic;} .gd{color:#000;background-color:#fdd;} .gd .x{color:#000;background-color:#faa;} .ge{font-style:italic;} .gr{color:#a00;} .gh{color:#999;} .gi{color:#000;background-color:#dfd;} .gi .x{color:#000;background-color:#afa;} .go{color:#888;} .gp{color:#555;} .gs{font-weight:bold;} .gu{color:#800080;font-weight:bold;} .gt{color:#a00;} .kc{font-weight:bold;} .kd{font-weight:bold;} .kn{font-weight:bold;} .kp{font-weight:bold;} .kr{font-weight:bold;} .kt{color:#458;font-weight:bold;} .m{color:#099;} .s{color:#d14;} .na{color:#008080;} .nb{color:#0086B3;} .nc{color:#458;font-weight:bold;} .no{color:#008080;} .ni{color:#800080;} .ne{color:#900;font-weight:bold;} .nf{color:#900;font-weight:bold;} .nn{color:#555;} .nt{color:#000080;} .nv{color:#008080;} .ow{font-weight:bold;} .w{color:#bbb;} .mf{color:#099;} .mh{color:#099;} .mi{color:#099;} .mo{color:#099;} .sb{color:#d14;} .sc{color:#d14;} .sd{color:#d14;} .s2{color:#d14;} .se{color:#d14;} .sh{color:#d14;} .si{color:#d14;} .sx{color:#d14;} .sr{color:#009926;} .s1{color:#d14;} .ss{color:#990073;} .bp{color:#999;} .vc{color:#008080;} .vg{color:#008080;} .vi{color:#008080;} .il{color:#099;}
ãã£ã¤ãæãããã§ãããã¨ãããããã㧠MoinMoin 㧠Github Flavored Markdown ã使ããããã«ãªãã¾ããããã§ããã