Skip to main content

add custom launch buttons to jupyter-book

Project description

custom launch buttons v1

First version of custom launch buttons for jupyter-book (https://jupyterbook.org/en/stable/interactive/launchbuttons.html). Install using

pip install git+https://github.com/TeachBooks/Sphinx-launch-buttons.git

to use in a jupyter-book, first include the extension in the _config.yml file

sphinx:
  extra_extensions:
    - custom-launch-buttons

then include a _launch_buttons.yml file along the _config.yml file. Buttons can be defined as follows:

buttons:
  - type: dropdown
    icon: <svg> </svg>
    items:
      - label: item 1
        url: https://linkone.com
      - label: item 2
        url: https://linktwo.com
  - type: dropdown
    label: languages
    items:
      - label: Dutch
        url: https://www.dutch.com
      - label: English
        url: https://www.english.com
      - label: French
        url: https://www.french.com

where buttons is an array of launch buttons, each which can be identified using 'dropdown' or 'button'.

buttons:
  - type : dropdown

  - type : button

The button/dropdown can be visualised using either an svg icon (https://icons.getbootstrap.com/#icons) or text.

buttons:
  - type : dropdown
    label: Language
  - type : button
    label : <svg></svg> 

Test icons using

  icon: <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-translate" viewBox="0 0 16 16">
            <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286zm1.634-.736L5.5 3.956h-.049l-.679 2.022z"/>
            <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zm7.138 9.995q.289.451.63.846c-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6 6 0 0 1-.415-.492 2 2 0 0 1-.94.31"/>
          </svg>

Then the same story goes for each of the items in the dropdown menu.

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

sphinx_launch_buttons-1.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_launch_buttons-1.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_launch_buttons-1.0.1.tar.gz.

File metadata

  • Download URL: sphinx_launch_buttons-1.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for sphinx_launch_buttons-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4cd0255ea988d1aa4ce779ee9e080995b180f37237a9e142d30d3dc167cce388
MD5 318f9561099779e72e8ca5df660aebd4
BLAKE2b-256 e5ef78f7db2145da3b12a14e30e3217c60670ea60db1cc1b39af1a62389d8803

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_launch_buttons-1.0.1.tar.gz:

Publisher: python-publish.yml on TeachBooks/Sphinx-launch-buttons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_launch_buttons-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_launch_buttons-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe72f345a155cbbab4fdfb7fc8aa928857434e1745377d7493aa9c93a15fcb15
MD5 616c6d1feb6468e24471a6ecac8290aa
BLAKE2b-256 8614d7db29f85c1ec9c8a038f2cb739bce83a8a74f2d245180fb05fc4647acd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_launch_buttons-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on TeachBooks/Sphinx-launch-buttons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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