Installation and Basic Usage

Installation

Installing mpiece with pip:

$ pip install mpiece

Basic Usage

from mpiece import markdown

text_md = "**Hello world**"
result = markdown(text_md)
print(result)
# output <p><strong>Hello world</strong></p>

MPiece core

mpiece.markdown(text, lexer=None, renderer=None)

Transform the markdown text easily.

Parameters:
Returns:

It depends of the renderer class.

Exception:

mpiece.core.RenderFunctionNotFoundException

Exception:

mpiece.core.ParseFunctionNotFoundException

Exception:

mpiece.core.RegexNotFoundException

Exception:

mpiece.core.InvalidDataException

class mpiece.Markdown

Class to transform the markdown text easily.

Example:
from mpiece import Markdown
from mpiece.lexer import Lexer
from mpiece.renderer import HtmlRenderer

markdown = Markdown()
markdown.lexer = Lexer()
markdown.renderer = HtmlRenderer()

result = markdown(text_markdown)
__call__(text, lexer=None, renderer=None)

Transform markdown text.

Parameters:
Returns:

It depends of the renderer class.

Exception:

mpiece.core.RenderFunctionNotFoundException

Exception:

mpiece.core.ParseFunctionNotFoundException

Exception:

mpiece.core.RegexNotFoundException

Exception:

mpiece.core.InvalidDataException