Skip to main content

htmldoom rendering library plugin for Pyramid

Project description


htmldoom rendering library plugin for Pyramid



pip install pyramid_htmldoom

Plug into Pyramid

from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.view import view_config

@view_config(route_name="hello_htmldoom", renderer="")
def hello_htmldoom_view(request):
    """htmldoom rendered view"""
    return {"data": "Hello htmldoom"}

if __name__ == "__main__":
    with Configurator() as config:

        config.add_route("hello_htmldoom", "/")

        app = config.make_wsgi_app()
    server = make_server("localhost", 8080, app)


from htmldoom import elements as e

from .layout import Layout

class Template(Layout):
    """Hello view renderer"""

    def content(self):
        return e.Div()(


from htmldoom import elements as e
from htmldoom.layouts import BaseLayout

class Layout(BaseLayout):
    def title(self):
        return e.Title()(self["data"])

    def body(self):
        return e.Body()(e.Div(**{"id": "main"})(self.content))

    def content(self):
        """To be implemented by renderers."""
        raise NotImplementedError()


Find demo and examples here

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyramid-htmldoom, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pyramid_htmldoom-0.1.1-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pyramid_htmldoom-0.1.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page