mcanouil / quarto-badge

Badge is an extension for Quarto to provide a shortcode to display software version or anything as a badge.

Home Page:http://m.canouil.dev/quarto-badge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Badge Extension For Quarto

badge is an extension for Quarto to provide a shortcode to display software version.

Installing

quarto add mcanouil/quarto-badge

This will install the extension under the _extensions subdirectory. If you're using version control, you will want to check in this directory.

Using

The shortcode {{< badge <key> <value> >}} will display a badge with the given version number.

You can provide any number of badges by specifying an array under the badge key in the _quarto.yml file or in the front matter of the document.

badge:
  - key: current
    colour: firebrick
  - key: future
    class: bg-danger
    href: https://github.com/mcanouil/quarto-version-badge
  - key: old
    class: bg-warning
    href: https://github.com/mcanouil/quarto-version-badge/releases/tag/{{value}}
  • {{value}} will be replaced by the value of the badge.
  • You can use colour or color to specify the colour of the badge.
  • You can also use class to specify a class to add to the badge.
{{< badge current 1.0.0 >}}
{{< badge future 2.0.0 >}}
{{< badge old 0.1.0 >}}

Caution

The href attribute is optional and currently breaks the table of contents links when used in headers.

Example

Here is the source code for a minimal example: example.qmd.

About

Badge is an extension for Quarto to provide a shortcode to display software version or anything as a badge.

http://m.canouil.dev/quarto-badge/

License:MIT License


Languages

Language:Lua 88.4%Language:CSS 11.6%