ipypublish.postprocessors.reveal_serve module

serve HTML page TODO the RevealServer setting should be available at front end

class ipypublish.postprocessors.reveal_serve.ProxyHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]

Bases: tornado.web.RequestHandler

handler the proxies requests from a local prefix to a CDN

get(prefix, url)[source]

proxy a request to a CDN

class ipypublish.postprocessors.reveal_serve.RevealServer(*args, **kwargs)[source]

Bases: ipypublish.postprocessors.base.IPyPostProcessor

Post processor designed to serve files

Proxies reveal.js requests to a CDN if no local reveal.js is present

property allowed_mimetypes

override in subclasses

return a list of allowed mime types if None, then all are allowed

Text based mime-types include: text/plain, text/latex, text/restructuredtext, text/html, text/x-python, application/json, text/markdown, text/asciidoc, text/yaml

ip

A trait for unicode strings.

property logger_name

override in subclass

open_in_browser

A boolean (True, False) trait.

port

An int trait.

property requires_path

override in subclasses

whether the prostprocessor requires the supplied filepath to have an existing parent directory

if True and filepath is None, will raise an IOError, otherwise, will try to make the directory if it doesn’t exist

reveal_cdn

A trait for unicode strings.

reveal_prefix

A trait for unicode strings.

run_postprocess(stream, mimetype, filepath, resources)[source]

Serve the build directory with a webserver.