From b5fa74c7345c048ef4834691981f6fb847edbdfb Mon Sep 17 00:00:00 2001 From: Julie Kirsch Date: Wed, 27 Nov 2024 10:35:27 +0100 Subject: [PATCH] svg icon? --- book/features/custom-launch-button.md | 29 +++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/book/features/custom-launch-button.md b/book/features/custom-launch-button.md index 0c51753..66e67e2 100644 --- a/book/features/custom-launch-button.md +++ b/book/features/custom-launch-button.md @@ -1,15 +1,19 @@ -# Sphinx Extension: Custom Launch Button +# Sphinx extension: Custom Launch Button The custom launch button extension allows you to create a customizable button in the top right of your jupyter book. This may have many applications, one of them being that you can create different language versions of the book available for the user. -This section will explain how to create a "Languages" button, like you might be used to seeing on just about any website. The use of the button, however, is completey customizable and may be used in many different ways. +This section will explain how to create a "Languages" or + + button, like you might be used to seeing on just about any website. The use of the button, however, is completey customizable and may be used in many different ways. ## Installation 1. Install the Sphinx Launch Buttons extension from the GitHub repository. -`pip install git+https://github.com/TeachBooks/Sphinx-launch-buttons.git` +``` +pip install git+https://github.com/TeachBooks/Sphinx-launch-buttons.git +``` 2. To use the extension in your book, you need to include it in your `_config.yml` file. @@ -19,7 +23,7 @@ sphinx: - custom-launch-buttons ``` -3. Then you need to include a `_launch_buttons.yml` file in the same location as your `_config.yml` file. +3. Then you need to include a `_launch_buttons.yml` file in the same location as your `_config.yml` file. The following code cell shows the main structure of that file. ``` buttons: @@ -28,7 +32,7 @@ buttons: - type : button ``` -Where `buttons` is an array of launch buttons, each can be identified using 2 types: 'dropdown' or 'button'. The cell above shows 2 buttons, one of type `dropdown` and one of type `button`. +Here, `buttons` is an array of launch buttons, each can be identified using 2 types: 'dropdown' or 'button'. The cell above shows 2 buttons, one of type `dropdown` and one of type `button`. The button/dropdown can be visualised using either an [svg icon](https://icons.getbootstrap.com/#icons) or text. @@ -48,4 +52,17 @@ You will then need to translate the content in the dutch branch to dutch which c -## \ No newline at end of file +## Example + +``` +buttons: + - type: dropdown + icon: + + + items: + - label: English + url: https://teachbooks.github.io/files-and-folders/EN + - label: Nederlands + url: https://teachbooks.github.io/files-and-folders/NL +``` \ No newline at end of file