Pagd

Template. Context. Page.

native – Native content parser

Module contents

class pagd.contents.native.Native(pa, *args, **kwargs)[source]

Bases: pluggdapps.plugin.Plugin

Plugin that can translate different content formats into html format using python native modules. Uses function APIs defined under pagd.contents module, except for ttl2html.

Supports reStructuredText, Markdown, plain-text, plain-html, tayra-templates text.

Note that in case of a TTL file, it is interpreted as page content and not as template for this or any other page-contents.

articles(page)[source]

For page, an instance of Page class, using its contentfiles attribute, translate each file’s text to html and return a corresponding list of articles. Where each element in the article is a tuple of,

( article's fpath, dictionary-of-metadata, html-text )
ttl2html(fpath, page)[source]

fpath is identified as a file containing tayra template text. If generated html contains <meta> tag elements, it will be used as source of meta-data information.

And return a tuple of (metadata, content). Content is HTML text.