Exemplo n.º 1
0
will be

    <!--Copyright: ML--><html><br/> content. </html>

"""

from lexor import init, load_aux

INFO = init(
    version=(0, 0, 1, 'final', 0),
    lang='html',
    type='writer',
    description='Writes HTML files to minimize the file size.',
    url='http://jmlopez-rod.github.io/lexor-lang/html-writer-min',
    author='Manuel Lopez',
    author_email='*****@*****.**',
    license='BSD License',
    path=__file__
)
MOD = load_aux(INFO)['nw']
DEFAULTS = {
    'comment': '',
}
MAPPING = {
    '#text': MOD.TextNW,
    '#comment': MOD.CommentNW,
    '#doctype': MOD.DoctypeNW,
    '#cdata-section': MOD.CDataNW,
    '__default__': MOD.DefaultNW,
}
Exemplo n.º 2
0
DEFAULTS = {
    'inline': 'off',
}
INFO = init(
    version=(0, 0, 1, 'rc', 9),
    lang='lexor',
    type='parser',
    description='Parse Markdown and LaTeX elements. ',
    url='http://jmlopez-rod.github.io/lexor-lang/lexor-parser-default',
    author='Manuel Lopez',
    author_email='*****@*****.**',
    license='BSD License',
    path=__file__
)
MOD = load_aux(INFO)
REPOSITORY = [
    MOD['auto'].AutoLinkNP,
    MOD['auto'].AutoMailNP,
    MOD['cdata'].CDataNP,
    MOD['comment'].CommentNP,
    MOD['code'].CodeInlineNP,
    MOD['code'].CodeBlockNP,
    MOD['define'].MacroNP,
    MOD['doctype'].DocumentTypeNP,
    MOD['element'].ElementNP,
    MOD['empty'].EmptyNP,
    MOD['entity'].EntityNP,
    MOD['entity'].BreakNP,
    MOD['header'].AtxHeaderNP,
    MOD['header'].SetextHeaderNP,
Exemplo n.º 3
0
    type='writer',
    description='Writes files in the lexor format.',
    url='http://jmlopez-rod.github.io/lexor-lang/lexor-writer-default',
    author='Manuel Lopez',
    author_email='*****@*****.**',
    license='BSD License',
    path=__file__
)
DEFAULTS = {
    'width': '70',
    'add_block': '',
    'del_block': '',
    'header': 'setext',
    'hashheader': 'closed',
}
MOD = load_aux(INFO)
MAPPING = {
    'list_item': MOD['list'].LexorListItemNW,
    'ul': MOD['list'].ListNW,
    'ol': 'ul',
    'li': MOD['list'].ListItemNW,
    'a': MOD['nw'].AnchorNW,
    'em': MOD['inline'].EmNW,
    'i': 'em',
    'strong': MOD['inline'].StrongNW,
    'hr': MOD['nw'].HRuleNW,
    'h1': MOD['header'].HeaderNW,
    'p': MOD['paragraph'].ParagraphNW,
    '#document': MOD['nw'].DocumentNW,
    '#text': MOD['nw'].TextNW,
    '#entity': MOD['nw'].EntityNW,
Exemplo n.º 4
0
    lexor example.html to html~min@comment="Copyright:"~

will be

    <!--Copyright: ML--><html><br/> content. </html>

"""

from lexor import init, load_aux

INFO = init(version=(0, 0, 1, 'final', 0),
            lang='html',
            type='writer',
            description='Writes HTML files to minimize the file size.',
            url='http://jmlopez-rod.github.io/lexor-lang/html-writer-min',
            author='Manuel Lopez',
            author_email='*****@*****.**',
            license='BSD License',
            path=__file__)
MOD = load_aux(INFO)['nw']
DEFAULTS = {
    'comment': '',
}
MAPPING = {
    '#text': MOD.TextNW,
    '#comment': MOD.CommentNW,
    '#doctype': MOD.DoctypeNW,
    '#cdata-section': MOD.CDataNW,
    '__default__': MOD.DefaultNW,
}