Skip to main content

Extension to automate mapping of csvw meta data documents to knowledge graphs and run automatic pipelines by testing for compatible mapping present in ckan, uses mat-o-lab tools MaptoMethod and RDFConverter.

Project description

Tests

ckanext-markdown_view

a CKAN extension creating previews for markdown files

Requirements

Purpose

Notes:

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"

Installation

To install the extension:

  1. Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
  1. Use pip to install package
pip install ckanext-markdown_view
  1. Add markdown_view to the ckan.plugins setting in your CKAN    config file (by default the config file is located at    /etc/ckan/default/ckan.ini).

  2. Restart CKAN. For example, if you've deployed CKAN with Apache on Ubuntu:

sudo service apache2 reload

Config settings

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

Features

List-Aware Markdown Rendering

This extension overrides CKAN's core render_markdown helper to automatically handle list/tuple data structures. This is particularly useful when using ckanext-scheming with the multiple_text preset, which stores field values as lists.

Problem Solved: When scheming fields use both preset: multiple_text and display_snippet: markdown.html, the core CKAN helper would crash with AttributeError: 'list' object has no attribute 'strip'.

Solution: The custom render_markdown helper automatically converts lists to newline-separated strings before rendering as markdown, providing seamless compatibility with scheming's multiple_text fields.

Example field that now works correctly:

- field_name: rights
  label: Rights
  form_snippet: markdown.html
  display_snippet: markdown.html
  preset: multiple_text
  validators: ignore_missing scheming_multiple_text

Highlight View

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>"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext_markdown_view-1.0.3.tar.gz (991.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_markdown_view-1.0.3-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file ckanext_markdown_view-1.0.3.tar.gz.

File metadata

  • Download URL: ckanext_markdown_view-1.0.3.tar.gz
  • Upload date:
  • Size: 991.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ckanext_markdown_view-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c2f62ded37957cd05d10104ff180ba183fbf4a084c9e2e5b76c75b7ef19f2e4d
MD5 51af8cc709888152775eb7859fc26400
BLAKE2b-256 947e64b18fec0a244e0fb8b16921d3f26fc7402ca7d2cedbfd125c752feb2f71

See more details on using hashes here.

Provenance

The following attestation bundles were made for ckanext_markdown_view-1.0.3.tar.gz:

Publisher: pypi.yml on Mat-O-Lab/ckanext-markdown_view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ckanext_markdown_view-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_markdown_view-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c10a53c6fee287ac49f7ae3db913e7a0a81bced304406222203bd01da107368c
MD5 12f0e2aa557c51148606fdad321a2534
BLAKE2b-256 c553999280f53283daad0c32fc627b709aef554e58994b5734da20545f7b3c20

See more details on using hashes here.

Provenance

The following attestation bundles were made for ckanext_markdown_view-1.0.3-py3-none-any.whl:

Publisher: pypi.yml on Mat-O-Lab/ckanext-markdown_view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page