Built-in Requests¶
create_doc_requests¶
- chisel.create_doc_requests(requests=None, root_path='/doc', api=True, app=True, markdown_up=None)¶
Yield a series of requests for use with
add_requests()
comprising the Chisel documentation application. By default, the documenation application is hosted at “/doc/”.- Parameters:
requests (list(Request)) – A list of requests or None to use the application’s requests
root_path (str) – The documentation application URL root path. The default is “/doc”.
api (bool) – If True, include the documentation APIs. Two documentation APIs are added, “/doc/doc_index” and “/doc/doc_request”.
app (bool) – If True, include the documentation client application.
markdown_up (str) – Optional, the relative path to the MarkdownUp application.
- Returns:
Generator of
Request
RedirectRequest¶
- class chisel.RedirectRequest(urls, redirect_url, permanent=True, name=None, doc=None, doc_group='Redirects')¶
Bases:
Request
A redirect reqeust
- Parameters:
urls (list(tuple)) – The list of URL method/path tuples. The first value is the HTTP request method (e.g. ‘GET’) or None to match any. The second value is the URL path or None to use the default path.
redirect_url (str) – The redirectd URL
permanent (bool) – If True, this is a permanent redirect
name (str) – The request name. By default the name is “redirect_<redirect_url>”.
doc (str or list(str)) – The documentation markdown text lines
doc_group (str) – The documentation group
StaticRequest¶
- class chisel.StaticRequest(name, content, content_type=None, urls=None, doc=None, doc_group='Statics')¶
Bases:
Request
A static resource request
- Parameters:
name (str) – The request name. The default name is the callback function’s name.
content (bytes) – The static content
content_type (str) – Optional content type string. If None, the content type is auto-determined.
urls (list(tuple)) – The list of URL method/path tuples. The first value is the HTTP request method (e.g. ‘GET’) or None to match any. The second value is the URL path or None to use the default path.
doc (str or list(str)) – The documentation markdown text lines
doc_group (str) – The documentation group