• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

hamano/apache-mod-markdown: Markdown filter module for Apache HTTPD Server

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

hamano/apache-mod-markdown

开源软件地址(OpenSource Url):

https://github.com/hamano/apache-mod-markdown

开源编程语言(OpenSource Language):

C 86.0%

开源软件介绍(OpenSource Introduction):

mod_markdown

Build Status

mod_markdown is Markdown filter module for Apache HTTPD Server.

Dependencies

For Debian/Ubuntu:

# apt install build-essential libtool automake autoconf
# apt install libmarkdown2-dev apache2 apache2-dev

Build

% autoreconf -f -i
% ./configure --with-apxs=<APXS_PATH> --with-discount=<DISCOUNT_DIR>
% make
% make install

Note: <DISCOUNT_DIR> is the directory that contains the include directory that contains mkdio.h Probably you need to specify --with-discount=/usr or --with-discount=/usr/local

Configuration

in httpd.conf:

LoadModule markdown_module modules/mod_markdown.so

You need to specify full path on debian or ubuntu.

LoadModule markdown_module /usr/lib/apache2/modules/mod_markdown.so
<Location />
    AddHandler markdown .md

    # If you want to use stylesheet.
    # MarkdownCss style.css
    # MarkdownHeader "<p>Header</p>"
    # MarkdownFooter "<p>Footer</p>"
</Location>

Or:

<Directory /var/www>
    AddHandler markdown .md
    DirectoryIndex index.md
</Directory>

Configuration Options

MarkdownWrapper

You can also disable HTML wrapper generation (basically <html><head></head><body> and </body></html> surrounding your actual markdown fragment) with this code :

<Directory /var/www>
    AddHandler markdown .md
    MarkdownWrapper Off
</Directory>

MarkdownCss

<Location />
    AddHandler markdown .md
    MarkdownCss style.css
</Location>

MarkdownDoctype

MarkdownDoctype HTML_4_01_TRANSITIONAL
  • HTML_4_01_TRANSITIONAL (default option)
  • HTML_5
  • XHTML_5
  • XHTML_1_0_STRICT
  • XHTML_1_0_TRANSITIONAL
  • XHTML_1_0_FRAMESET
  • XHTML_1_1
  • HTML_4_01_STRICT
  • HTML_4_01_FRAMESET
  • XHTML_BASIC_1_0
  • XHTML_BASIC_1_1

MarkdownHeader

MarkdownHeader "<p>Header</p>"

MarkdownFooter

MarkdownFooter "<p>Footer</p>"

MarkdownHeaderFile

MarkdownHeaderFile header.html

MarkdownFooterFile

MarkdownFooterFile footer.html

MarkdownFlags

MarkdownFlags 0x02005000
default: MKD_TOC | MKD_AUTOLINK | MKD_FENCEDCODE

Flag | Value | Description
--- | --- | ---
MKD_FENCEDCODE   | 0x02000000 | enabled fenced code blocks
MKD_AUTOLINK     | 0x00004000 | make http://foo.com link even without &lt;&gt;s
MKD_TOC          | 0x00001000 | do table-of-contents processing
 |  |
MKD_1_COMPAT     | 0x00002000 | compatibility with MarkdownTest_1.0
MKD_CDATA        | 0x00000080 | generate code for xml ![CDATA[...]]
MKD_EMBED       MKD_NOLINKS|MKD_NOIMAGE|MKD_TAGTEXT
MKD_EXPLICITLIST  | 0x80000000 |        don't combine numbered/bulletted lists
MKD_EXTRA_FOOTNOTE  | 0x00200000 |      enable markdown extra-style footnotes
MKD_GITHUBTAGS   | 0x08000000 | allow dash and underscore in element names
MKD_IDANCHOR     | 0x04000000 | use id= anchors for TOC links
MKD_LATEX        | 0x40000000 | handle embedded LaTeX escapes
MKD_NOALPHALIST  | 0x00080000 | forbid alphabetic lists
MKD_NODIVQUOTE   | 0x00040000 | forbid >%class% blocks
MKD_NODLDISCOUNT  | 0x00800000 |        disable discount-style definition lists
MKD_NODLIST      | 0x00100000 | forbid definition lists
MKD_NO_EXT       | 0x00000040 | don't allow pseudo-protocols
MKD_NOHEADER     | 0x00010000 | don't process header blocks
MKD_NOHTML       | 0x00000008 | don't allow raw html through AT ALL
MKD_NOIMAGE      | 0x00000002 | don't do image processing, block &lt;img&gt;
MKD_NOLINKS      | 0x00000001 | don't do link processing, block &lt;a&gt; tags
MKD_NOPANTS      | 0x00000004 | don't run smartypants()
MKD_NORELAXED    | 0x00000200 | emphasis happens /everywhere/
MKD_NOSTRIKETHROUGH  | 0x00000800 |     forbid ~~strikethrough~~
MKD_NOSTYLE      | 0x00400000 | don't extract &lt;style&gt; blocks
MKD_NOSUPERSCRIPT  | 0x00000100 |       no A^B
MKD_NOTABLES     | 0x00000400 | disallow tables
MKD_SAFELINK     | 0x00008000 | paranoid check for link protocol
MKD_STRICT       | 0x00000010 | disable SUPERSCRIPT, RELAXED_EMPHASIS
MKD_TABSTOP      | 0x00020000 | expand tabs to 4 spaces
MKD_TAGTEXT      | 0x00000020 | process text inside an html tag; no
MKD_URLENCODEDANCHOR  | 0x10000000 | urlencode non-identifier chars instead of replacing with dots



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap