Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kjdev/apache-mod-hoedown

mod_hoedown is Markdown handler module for Apache HTTPD Server
https://github.com/kjdev/apache-mod-hoedown

Last synced: about 1 month ago
JSON representation

mod_hoedown is Markdown handler module for Apache HTTPD Server

Awesome Lists containing this project

README

        

# mod_hoedown

mod_hoedown is Markdown handler module for Apache HTTPD Server.

## Dependencies

* [hoextdown](https://github.com/kjdev/hoextdown.git)

## Build

```
% git clone --recursive --depth=1 https://github.com/kjdev/apache-mod-hoedown.git
% cd apache-mod-hoedown
% ./autogen.sh (or autoreconf -i)
% ./configure [OPTION]
% make
% make install
```

### Build options

Incorporation of external file.

* --enable-hoedown-url-support

access: `http://localhost/none.md?url=https://raw.github.com/kjdev/apache-mod-hoedown/master/README.md`

apache path.

* --with-apxs=PATH
* --with-apr=PATH
* --with-apreq2=PATH

## Configration

httpd.conf:

```
LoadModule hoedown_module modules/mod_hoedown.so

AddHandler hoedown .md
#
# SetHandler hoedown
#
Header
```

---

### Extension options

Markdown extension support (default: Off).

#### HoedownExtSpaceHeaders

```
# hoge
#foo
```

Enable:

```

hoge


#foo


```

Disable:

```

hoge


foo


```

#### HoedownExtTables

```
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cel
```

Enable:

```

First Header
Second Header

Content Cell
Content Cell

Content Cell
Content Cel

```

Disable:

```

First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cel


```

#### HoedownExtFencedCode

```php
echo "hello world";
```

Enable:

```

echo "hello world";


```

Disable:

```

php
echo "hello world";


```

#### HoedownExtFootnotes

```
Footnotes[^1] have a label[^label] and a definition[^!DEF].

[^1]: This is a footnote
[^label]: A footnote on "label"
[^!DEF]: The definition of a footnote.
```

Enable:

```

Footnotes1 have a label2 and a definition3.


```

* footer

```






  1. This is a footnote 




  2. A footnote on "label" 




  3. The definition of a footnote. 





```

Disable:

```

Footnotes[^1] have a label[^label] and a definition[^!DEF].

[^1]: This is a footnote
[^label]: A footnote on "label"
[^!DEF]: The definition of a footnote.


```

#### HoedownExtAutolink

```
https://github.com/kjdev
```

Enable:

```

https://github.com/kjdev


```

Disable:

```

https://github.com/kjdev


```

#### HoedownExtStrikethrough

```
this is ~~good~~ bad.
```

Enable:

```

this is good bad.


```

Disable:

```

this is ~~good~~ bad.


```

#### HoedownExtUnderline

```
this is _good_ bad.
```

Enable:

```

this is good bad.


```

Disable:

```

this is good bad.


```

#### HoedownExtHighlight

```
this is ==good== bad.
```

Enable:

```

this is good bad.


```

Disable:

```

this is ==good== bad.


```

#### HoedownExtQuote

```
this is "good" bad.
```

Enable:

```

this is good bad.


```

Disable:

```

this is "good" bad.


```

#### HoedownExtSuperscript

```
hoge^(fuga)
hoge ^fuga
hoge ^fu^ga
```

Enable:

```

hogefuga
hoge fuga
hoge fuga


```

Disable:

```

hoge^(fuga)
hoge ^fuga
hoge ^fu^ga


```

#### HoedownExtLaxSpacing

?

#### HoedownExtNoIntraEmphasis

```
hoge_fuga_foo
```

Enable:

```

hoge_fuga_foo


```

Disable:

```

hogefugafoo


```

#### HoedownExtDisableIndentedCode

```
echo "hoge"
```

Enable:

```

echo "hoge"


```

Disable:

```

echo "hoge"


```

#### HoedownExtSpecialAttribute

```
# header {.head #id1}

[kjdev](https://github.com/kjdev){#id2 .link .github}

* item1 {#item1 .item}
* item2 {.hoge #item2 .item}
```

Enable:

```

header

kjdev


  • item1

  • item2


```

Disable:

```

header {.head #id1}

kjdev{#id2 .link .github}


  • item1 {#item1 .item}

  • item2 {.hoge #item2 .item}


```

---

### HTML Render options

HTML render option (default: Off).

#### HoedownRenderSkipHtml

```
hogefoo
```

Enable:

```

hogefoo


```

Disable:

```

hogefoo


```

#### HoedownRenderSkipStyle

```
hogefoo
```

Enable:

```

hogefoo


```

Disable:

```

hogefoo


```

#### HoedownRenderSkipImages

```
Image:
```

Enable:

```

Image:


```

Disable:

```

Image:


```

#### HoedownRenderSkipLinks

```
Link: here
```

Enable:

```

Link: here


```

Disable:

```

Link: here


```

#### HoedownRenderExpandTabs

Does not use.

#### HoedownRenderSafelink

```
[github](https://github.com/kjdev)
[file](file:///local.file)
```

Enable:

```

github
[file](file:///local.file)


```

Disable:

```

github
file


```

#### HoedownRenderToc

```
## header2-1
## header2-2
```

Enable:

```

header2-1


header2-2


```

* toc render:

```


```

Disable:

```

header2-1


header2-2


```

#### HoedownRenderHardWrap

```
hoge
foo
```

Enable:

```

hoge

foo


```

Disable:

```

hoge
foo


```

#### HoedownRenderUseXhtml

```
---
```

Enable:

```



```

Disable:

```



```

#### HoedownRenderEscape

```
here
```

Enable:

```

<a href="#">here</a>


```

Disable:

```

here


```

#### HoedownRenderUseTaskList

```
* [ ] task1
* [x] task2
* [ ] task3
```

Enable:

```


  • task1

  • task2

  • task3


```

Disable:

```


  • [ ] task1

  • [x] task2

  • [ ] task3


```

#### HoedownRenderLineContinue

```
hoge
foo
huga
```

Enable:

```

hoge foo huga


```

Disable:

```

hoge
foo
huga


```

### Table of Contents options

Required HoedownRenderToc option.

View the table of contents as a header and footer.

#### HoedownTocHeader

Table of contents header.

#### HoedownTocFooter

Table of contents footer.

View the table of contents as a HoedownTocEnd from HoedownTocBegin.

#### HoedownTocBegin

Table of contents begin level (default: 2).

#### HoedownTocEnd

Table of contents end level (default: 6).

```
# header1
## header2
### header3
#### header4
##### header5
###### header6
```

#### Example

default:

```


```

conf: `HoedownTocBegin 1`, `HoedownTocEnd 3`

```


```

conf: `HoedownTocHeader '

'`, `HoedownTocFooter '
'`

```


```

You can change the toc range by specifying the toc parameters.

* `http://localhot/markdown.md?toc=3`

Same as HoedownTocBegin = 3, HoedownTocEnd = 3.

* `http://localhot/markdown.md?toc=3:5`

Same as HoedownTocBegin = 3, HoedownTocEnd = 5.

#### HoedownRenderTocUnescape

Table of contents escapel flags.

Required HoedownRenderToc option.

```
## `Hoge`
## `Foo`
```

Enable:

```

Hoge


Foo


```

* toc render:

```


```

Disable:

```

Hoge


Foo


```

* toc render:

```


```

### Class options

Set the class attribute of the list.

#### HoedownClassUl

ul tag class attribute.

```
* a
```

default:

```


  • a


```

conf: `HoedownClassUl ul-list`

```


  • a


```

#### HoedownClassOl

ol tag class attribute.

```
1. a
```

default:

```


  1. a


```

conf: `HoedownClassUl ol-list`

```


  1. a


```

#### HoedownClassTask

Required HoedownRenderUseTaskList option.

Class attribute of the task list (ex: `* [ ]` or `* [x]`).

```
* [ ] a
```

default:

```


  • a


```

conf: `HoedownClassUl task-list`

```


  • a


```

### Style options

Set the style layout file.

#### HoedownStylePath

Set the style layout file directory path (default: httpd Document root).

#### HoedownStyleDefault

Set the style layout file name.

#### HoedownStyleExtension

Set the style layout file extension (default: .html).

#### Example

/var/www/style/default.html:

```

Markdown Layout

```

conf:

```
HoedownStylePath /var/www/style
HoedownStyleDefault default
HoedownStyleExtension .html
```

This will expand the markdown file next to the line
with the `` of style.html.

#### Example multiple style

* /var/www/style/style.html
* /var/www/style/style-2.html

You can change the layout file by specifying the layout parameters.

* `http://localhot/markdown.md`

use style: /var/www/style/default.html

* `http://localhot/markdown.md?style=style`

use style: /var/www/style/style.html

* `http://localhot/markdown.md?style=style-2`

use style: /var/www/style/style-2.html

## Post Markdown

You can also send a markdown Markdown content parameter. (Send to POST)

```
POST http://localhot/markdown.md
```

form:

```


```

none.md does not exists.

### Order

Load the content in order.

1. A local file
2. Markdown Parameters
3. URL parameters

Output together.