https://github.com/tylertemp/md-underline
underline plugin for python markdown
https://github.com/tylertemp/md-underline
Last synced: 3 months ago
JSON representation
underline plugin for python markdown
- Host: GitHub
- URL: https://github.com/tylertemp/md-underline
- Owner: TylerTemp
- License: mit
- Created: 2016-04-01T05:27:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-01T15:28:30.000Z (about 10 years ago)
- Last Synced: 2024-12-31T03:26:16.195Z (over 1 year ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# md-underline
underline plugin for python markdown
## Summary
This will render `__content__` as underline format `content`
## Usage
```python
import markdown
from underline import UnderlineExtension
markdown.markdown('__underline__', extensions=[UnderlineExtension()]
# underline
```
## Install
```bash
pip install get+git://github.com/TylerTemp/md-underline.git
```
## API
`UnderlineExtension` accepts:
1. `tag`: html tag name. use `u` by default
2. `cls`: add class to the underline element. Default: `''`
e.g.
```python
import markdown
from underline import UnderlineExtension
markdown.markdown(
'__underline__',
extensions=[UnderlineExtension(tag='strong', cls='under')]
# underline
```
Note: it's strongly suggest using css to change the style instead of using `` tag
because markdown is not designed for the style.
## Example
`__under__` -> `under`
`__*em*under__` -> `emunder`
`__*underem*__` -> `underem`
## Note
This plugin only work on:
1. underline alone, or combine with em. Won't work on ***__combine-3__***
2. When conbine with em, em can only use *, thus ___underline-with-em___
won't work