frontmatter/__init__.py
def loads(text, encoding='utf-8', handler=None, **defaults):
    """
    Parse text (binary or unicode) and return a :py:class:`post <frontmatter.Post>`.

    ::

        >>> with open('tests/hello-world.markdown') as f:
        ...     post = frontmatter.loads(f.read())

    """
    text = u(text, encoding)
    handler = handler or detect_format(text, handlers)
    metadata, content = parse(text, encoding, handler, **defaults)
    return Post(content, handler, **metadata)
def loads(text, encoding='utf-8', handler=None, **defaults):
    """
    Parse text (binary or unicode) and return a :py:class:`post <frontmatter.Post>`.

    ::

        >>> with open('tests/hello-world.markdown') as f:
        ...     post = frontmatter.loads(f.read())

    """
    text = u(text, encoding)
    handler = handler or detect_format(text, handlers)
    metadata, content = parse(text, encoding, handler, **defaults)
    return Post(content, handler, **metadata)
Parse text (binary or unicode) and return a :py:class:`post <frontmatter.Post>`.

    ::

        >>> with open('tests/hello-world.markdown') as f:
        ...     post = frontmatter.loads(f.read())