Skip to main content

An Attribute class to be used with pandocfilters

Project description

This is a simple parser / emitter for pandoc block attributes, intended for use with pandocfilters.

It can read and write attributes in any of these formats: - markdown - html - dictionary - pandoc


pip install pandoc-attributes


from pandocattributes import PandocAttributes

attrs = '#id .class1 .class2 key=value'
attributes = PandocAttributes(attrs, format='markdown')

>>> '{#id .class1 .class2 key=value}'

>>> {'id': 'id', 'classes': ['class1', 'class2'], 'key'='value'}

>>> id="id" class="class1 class2" key='value'

>>> ['id', ['class1', 'class2'], [['key', 'value']]]
>>> 'id'

>>> ['class1', 'class2']

>>> OrderedDict([('key', 'value')])

Project details

Download files

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

Files for pandoc-attributes, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size pandoc-attributes-0.1.2.tar.gz (1.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page