clld-markdown-plugin
Render CLDF markdown in clld apps
Usage
Include (and configure the plugin) in your app's main function:
def main(global_config, **settings):
settings['clld_markdown_plugin'] = {
'model_map': {'ValueTable': common.ValueSet},
'function_map': {}
}
config = Configurator(settings=settings)
config.include('clld.web.app')
...
config.include('clld_markdown_plugin')
Then you can use clld_markdown_plugin.markup as follows in your templates:
<%! from clld_markdown_plugin import markdown %>
${markdown(req, '[x](LanguageTable#cldf:abad1241)')|n}
By default, links to objects in the CLDF dataset will be rendered as HTML links to the corresponding object's details page in the clld app.
Configuration
The plugin can be configured via the following four configuration options:
model_map: Adictmapping CLDF component names to DB model classes defined for the app. This allows for a flexible mapping between CLDF components and the clld DB classes.renderer_map: See below for details.extensions: A list of markdown extensions in dot notation, to be activated when calling themarkdownfunction.keep_link_labels: Abooleanindicating whether to keep link labels as they appear in the CLDF Markdown text. By default (False), labels will be substituted using the linked object's name.
Renderer callables
The renderer_map configuration option for clld_markdown_plugin accepts a dict mapping
CLDF component names to Python callables with the following signature:
import clld.web.app
def renderer(req: clld.web.app.ClldRequest, objid: str, table, session: clld.db.meta.DBSession, ids=None) -> str:
"""
The returned `str` is interpreted as Markdown, so it may also include HTML.
"""
Metadata
Release files for clld-markdown-plugin 1.0.0
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 |
|---|---|---|---|---|
| clld_markdown_plugin-1.0.0.tar.gz | 9.8 kB | Without provenance | Details for clld_markdown_plugin-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clld_markdown_plugin-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for clld_markdown_plugin-1.0.0-py3-none-any.whl |
Total release size: 19.1 kB
Release files / clld_markdown_plugin-1.0.0.tar.gz
| Download URL | clld_markdown_plugin-1.0.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5509fce00c072690f334a65165d104f2553594ba73e1fe603f11dd4e3245b251
|
|
BLAKE2b-256 checksum How to use checksums |
7850aa664341ea4693279d6b6cc163035a56c684c327a11387932c465748030c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / clld_markdown_plugin-1.0.0-py3-none-any.whl
| Download URL | clld_markdown_plugin-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b965be67527ac4498bb8561654986acf7a96f55feae60ff9465f81bce968b66f
|
|
BLAKE2b-256 checksum How to use checksums |
ff92236f26e4ad00e04651dbe5345f375219b719dfc80006cbf4a567808fde5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for clld-markdown-plugin 1.0.0
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.