Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Microdata semantic markups support for Sphinx Documentation Generator.

This plugin is derived from pelican-microdata.

Written by Fabrice Salvaire.

Installation

See sphinx-contrib for more details.

To install the plugin, you have to run these commands:

python setup.py build
python setup.py install

The PySpice source code is hosted at https://github.com/FabriceSalvaire/sphinx-microdata

To clone the Git repository, run this command in a terminal:

git clone git@github.com:FabriceSalvaire/sphinx-microdata

Usage

To load the plugin, you have to add it in your conf.py file.

extensions = [
  ...
  'sphinxcontrib.microdata',
  ]

Directives

Microdata plugin provides two directives:

  • itemscope, a block directive allowing to declare an itemscope block:

    .. itemscope:: <Schema type>
        :tag: element type (default: div)
        :itemprop: optionnal itemprop attribute
        :compact: optionnal
    
        Nested content
  • itemprop, an inline directive/role allowing to annotate some text with an itemprop attribute.

    :itemprop:`Displayed text <itemprop name>`
    :itemprop:`Displayed text <itemprop name:http://some.url/>`

Example

This reStructuredText document:

.. itemscope: Person
    :tag: p

    My name is :itemprop:`Bob Smith <name>`
    but people call me :itemprop:`Smithy <nickanme>`.
    Here is my home page:
    :itemprop:`www.exemple.com <url:http://www.example.com>`
    I live in Albuquerque, NM and work as an :itemprop:`engineer <title>`
    at :itemprop:`ACME Corp <affiliation>`.

will result in:

<p itemscope itemtype="http://data-vocabulary.org/Person">
    My name is <span itemprop="name">Bob Smith</span>
    but people call me <span itemprop="nickname">Smithy</span>.
    Here is my home page:
    <a href="http://www.example.com" itemprop="url">www.example.com</a>
    I live in Albuquerque, NM and work as an <span itemprop="title">engineer</span>
    at <span itemprop="affiliation">ACME Corp</span>.
</p>

This reStructuredText document using nested itemscope:

.. itemscope:: Person

    My name is :itemprop:`John Doe <name>`

    .. itemscope:: Address
        :tag: p
        :itemprop: address

        I live in :itemprop:`Albuquerque <name>`

will result in:

<div itemscope itemtype="http://data-vocabulary.org/Person">
<p>
My name is <span itemprop="name">John Doe</span>
</p>
<p itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
I live in <span itemprop="name">Albuquerque</span>'
</p>
</div>

This reStructuredText document using nested and compact itemscope:

.. itemscope:: Person
    :tag: p
    :compact:

    My name is :itemprop:`John Doe <name>`

    .. itemscope:: Address
        :tag: span
        :itemprop: address

        I live in :itemprop:`Albuquerque <name>`

will result in:

<p itemscope itemtype="http://data-vocabulary.org/Person">
My name is <span itemprop="name">John Doe</span>
<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
I live in <span itemprop="name">Albuquerque</span>
</span>
</p>

Metadata

Release files for sphinxcontrib-microdata 0.1dev-20140921

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib-microdata 0.1dev-20140921
File Size Uploaded
sphinxcontrib-microdata-0.1dev-20140921.tar.gz 9.2 kB Details

Release files / sphinxcontrib-microdata-0.1dev-20140921.tar.gz

Download URL sphinxcontrib-microdata-0.1dev-20140921.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f9aa8b8eab00bddf8cfcc60441d66e8f777b1cb7516a31d3e160ec906c5bf1
BLAKE2b-256 checksum
How to use checksums
28b9657a0cd61816e59c204009ebc48f990c39d740c835df2d105f7dcfa89699
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1dev-20140921 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page