(The include Plugin is new since PyLucid v0.9.0.0810)
With the include Plugin, you can include local and remote files into a cms page.
The included content can be:
Basic example:
Note:
You can only include a file which is stored in the path specified with settings.PYLUCID_INCLUDE_BASEPATH
The default PYLUCID_INCLUDE_BASEPATH is settings.MEDIA_ROOT
Be careful for setup this basepath!
Highlight a file with pygments:
Apply markup to a file:
Basic example:
Highlight a file with pygments:
Apply markup to a file:
Shared arguments for include.local_file and include.remote:
| parameter | default | description |
|---|---|---|
| encoding | "utf-8" | content charset |
| markup | None | Name of the Markup to apply (e.g.: "creole", "rest") |
| highlight | None | File extensions for pygments or True for autodetection (e.g.: "py", "html+django") |
| strip_html | True | Cut html tags out from content? |
You can combine markup and highlight. Result is pygmentised html code ;)
if not markup and not highlight, the result would be strip_html (optional) and then escaped.
Optional arguments for include.remote to overwrite preferences:
| parameter | description |
|---|---|
| remote_template | template filename for render the result |
| socket_timeout | socket timeout in seconds for getting remote data |
| cache_timeout | number of seconds to cache remote data |
django-processinfo: 6.0 ms of 377.5 ms (1.6%)