Skip to main content

A markdown extension to add bioschemas markup to rendered html

Project description

Adding bioschemas to mkdocs

A small markdown extension to add bioschemas to mkdocs. It requires a yaml or json file with bioschemas markup, and adds it to the rendered html.

Installation

pip install addbioschemas

To use the plugin simply add addbioschemas to the list of plugins in mkdocs.yml:

markdown_extensions:
  - addbioschemas

Usage

Option 1: add the bioschemas file name to the markdown file

Simply add [add-bioschemas file='path/to/yaml/metadata.yaml'] to the markdown file where you want to add the bioschemas. This method supports multiple metadata files.

A markdown snippet of a page where you want to add bioschemas to:

# awesome title
[add-bioschemas file='path/to/yaml/metadata.yaml']
I started with some YAML and turned it into JSON-LD

Important: If you are using mkdocs-material, make sure there is markdown before the insertion of [add-bioschemas]. Otherwise, other plugins will add incorrect tags to the json-LD chunk.

The contents of path/to/yaml/metadata.yaml use the bioschemas properties:

"@context": https://schema.org/
"@type": LearningResource
"@id": https://elixir-europe-training.github.io/ELIXIR-TrP-LessonTemplate-MkDocs/
http://purl.org/dc/terms/conformsTo:
  "@type": CreativeWork
  "@id": https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE
description: Template for ELIXIR lessons
keywords: FAIR, OPEN, Bioinformatics, Teaching
name: ELIXIR Training Lesson template
# lookup at https://spdx.org/licenses/
license: CC-BY-4.0
author:
- "@type": Person
  name: Geert van Geest
  email: geert.vangeest@sib.swiss
  github: GeertvanGeest
  orcid: 0000-0002-1561-078X
- "@type": Person
  name: Elin Kronander
  github: elinkronander
  orcid: 0000-0003-0280-6318

addbioschemas also supports the json format.

Option 2: add the bioschemas file name to mkdocs.yml

Specify the path to the yaml file in mkdocs.yml. This method only supports one metadata file.

Add to mkdocs.yml:

markdown_extensions:
  - addbioschemas:
      metadata: 'path/to/yaml/metadata.yaml'

A markdown snippet of a page where you want to add bioschemas to:

# awesome title
[add-bioschemas]
I started with some YAML and turned it into JSON-LD

Important: If you are using mkdocs-material, make sure there is markdown before the insertion of [add-bioschemas]. Otherwise, other plugins will add incorrect tags to the json-LD chunk.

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

addbioschemas-1.0.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

addbioschemas-1.0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file addbioschemas-1.0.2.tar.gz.

File metadata

  • Download URL: addbioschemas-1.0.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for addbioschemas-1.0.2.tar.gz
Algorithm Hash digest
SHA256 d651f739b10b188b101f4cc265027fe354edfd1fd5e1c62d686dac79c11bc1b9
MD5 e0c5b232671c0a407cd2821c29f008ed
BLAKE2b-256 53c141f05f557d7d9f940fdf9bf242ed380c63fe27a56aab82f4543a22f545be

See more details on using hashes here.

File details

Details for the file addbioschemas-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for addbioschemas-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 948cb55043318c93b179bb94b4c18fb440144801287485846e08e744d5481f9f
MD5 9fe565732c426cd7aa53a925c2970a51
BLAKE2b-256 7723ba7aab5528ef35aa5ed70f007c51438be70e4a40cf84bce222dccdefc2fa

See more details on using hashes here.

Supported by

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