Grok source renderers
First take on making the zope.app.render classes available from Grok templates.
RestructuredText: template files with ‘.rst’ extension
renders a complete HTML page, including embedded stylesheet (default) or with a configurable external stylesheet
Installation
Add ‘megrok.rendersource’ to the ‘install_requires’ list in your packages ‘setup.py’. Run buildout again. Template reloading is available in developer mode only: add ‘devmode on’ to the ‘zope.conf = ‘ line in your buildout.cfg
Configuration
To configure the stylesheet used with your template, add a method ‘namespace’ to your view class:
class Overview(grok.View):
def namespace(self):
# compute the stylesheet path to the file inside the 'static' folder,
# eg. 'grok.css'
stylesheet=self.static['grok.css']()
# enable absolut URL handling, disable embedding
return {'settings_overrides': {'stylesheet': stylesheet,
'stylesheet_path': None,
'embed_stylesheet': 0,
'input_encoding': 'utf-8',
'output_encoding': 'utf-8',
}}
Other docutils related options can be added to the ‘settings_overrides’ dictionary. CF grok_overview.txt for more info on the namespace method.
Changes
0.5.1 (2010-03-10)
added the long description…
0.5 (2010-03-10)
upgrade to grok version 1.1rc1
changed the project namespace from d2m.rendersource to megrok.rendersource
Metadata
Release files for megrok.rendersource 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| megrok.rendersource-0.5.1.tar.gz | 9.1 kB | Without provenance | Details for megrok.rendersource-0.5.1.tar.gz |
Release files / megrok.rendersource-0.5.1.tar.gz
| Download URL | megrok.rendersource-0.5.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fde5e8db3801d2ed95cc9812624401c71e41f801fe3899e525e524f1b2b431c2
|
|
BLAKE2b-256 checksum How to use checksums |
59ebbc65ac8f05c11a138a08973eeb5c655e0f6aa8106ce5457d5c55b7acfb00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for megrok.rendersource 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.