The ngx_markdown_filter_module
module is a filter that transforms markdown files to html format.
This module utilizes the cmark library.
location ~ \.md {
markdown_filter on;
markdown_template html/template.html;
}
This works on proxy locations as well.
Syntax: markdown_filter on;
Context: location
Syntax: markdown_template html/template.html;
Context: location
-
Clone this repo
-
Install
cmark
lib with development headers
dnf install cmark-devel
-
Download nginx src archive and unpack it
-
Run
configure
script (see nginx src) and build nginx
> ./configure --add-module=/path/to/ngx_markdown_filter_module
> make
- Apply markdown directives to nginx conf and run it
Original cmark library doesn't support tables. But there is cmark-gfm fork with table extension, supported by Github.
-
Clone this repo
-
Rename
config_gfm
toconfig
-
Install
cmark-gfm
lib -
Download nginx src archive and unpack it
-
Run
configure
script (see nginx src) and build nginx
> ./configure --add-module=/path/to/ngx_markdown_filter_module --with-cc-opt=-DWITH_CMARK_GFM=1
> make
- Apply markdown directives to nginx conf and run it