Introduction

Sphinx Bioschemas extension allows authors to embed a Bioschemas and any Schema.org structured metadata in their Sphinx content.

This was originally designed for embedding Bioschemas structured metadata following the recommendations of the ELIXIR FAIR Training Handbook.

Installation

  1. Install the extension:

    $ pip install sphinx-bioschemas
    
  2. After setting up Sphinx to build your docs, enable it in the Sphinx conf.py file:

    # conf.py
    
    # Add sphinx-bioschemas to the extensions list
    extensions = ['sphinx_bioschemas']
    

Usage

To include the Bioschemas markup in your Sphinx documentation, add the following directive to your reStructuredText file:

.. bioschemas::
   :format: yaml

   "@context": https://schema.org/
   "@type": LearningResource
   "@id": https://biocorecrg.github.io/sphinx-bioschemas/
   "http://purl.org/dc/terms/conformsTo":
   - "@type": CreativeWork
     "@id": "https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE"
   about:
     - "@id": https://schema.org
     - "@id": https://edamontology.org/topic_0089
   audience:
   - "@type": Audience
     name: (Markup provider, Markup consumer) WebMaster, people deploying GitHub pages
   name: Sphinx Bioschemas extension
   author:
   - "@type": Person
     name: "Toni Hermoso Pulido"
     "@id": https://orcid.org/0000-0003-2016-6465
     url: https://orcid.org/0000-0003-2016-6465
   - "@type": Organization
     name: "Centre for Genomic Regulation"
     "@id": https://ror.org/03wyzt892
     url: https://www.crg.eu
   dateModified: 2025-08-20
   description: This guide will show you how to do add Schema.org markup to documentation based on Sphinx
   keywords: "schemaorg, Bioschemas, FAIR, GitHub pages"
   license: MIT

Instead of embedding the code, you can also refer to an existing file in either YAML or JSON format.

With YAML files:

.. bioschemas:: bioschemas.yaml

With JSON files:

.. bioschemas:: bioschemas.json

Resources