Basic UsageΒΆ

This is a tiny basic example. Such a code is sufficient to generate an html page.

Passing target file location to Yawrap constructor is mandatory, although the file will be not generated until Yawrap.render() is called. Title is optional.

from yawrap import Yawrap


def hello_yawrap(out_file_path):

    jawrap = Yawrap(out_file_path, "The title")

    with jawrap.tag('h2'):                       # add a header
        jawrap.text('Hello yawrap!')

    with jawrap.tag('p'):                        # add a paragraph
        jawrap.text('Could it be simpler?')      # and its content

    jawrap.render()                              # that creates html file (under out_file_path)


Will create such an page:

Which looks like this: