a CKAN extension creating previews for markdown files
Compatibility with core CKAN versions:
CKAN version | Compatible? |
---|---|
2.9 and arlier | not tested |
2.10 | yes |
2.11 | yes |
- "yes"
- "not tested" - I can't think of a reason why it wouldn't work
- "not yet" - there is an intention to get it working
- "no"
To install the extension:
- Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
- Use pip to install package
pip install ckanext-markdown_view
-
Add
markdown_view
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini
). -
Restart CKAN. For example, if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
You can set the default formats to preselected for upload by setting the formats,
CKANINI__CKANEXT__MARKDOWN__FORMATS = 'text/markdown'
else it will react to the listed formats by default
Each resource can be rendered by highlighting some markdown passage. The markdown content to highlight must be passed as post to the /highlight url, for example:
curl -X POST 'https://<ckan_url>/dataset/<dataset_d>/resource/<res_id>/highlight' -F highlight="<markdown code to highlight>"