From 5aa5f18b386929772132989f219b12edde59fb9e Mon Sep 17 00:00:00 2001 From: Liam Keegan Date: Wed, 8 May 2024 16:48:27 +0200 Subject: [PATCH] add header via custom nbconvert template --- dist/ssc-logo.svg | 750 +++++++++++++++++++++++ index.ipynb | 3 - jupyter_nbconvert_config.py | 4 +- jupyter_nbconvert_template/conf.json | 6 + jupyter_nbconvert_template/index.html.j2 | 19 + 5 files changed, 777 insertions(+), 5 deletions(-) create mode 100644 dist/ssc-logo.svg create mode 100644 jupyter_nbconvert_template/conf.json create mode 100644 jupyter_nbconvert_template/index.html.j2 diff --git a/dist/ssc-logo.svg b/dist/ssc-logo.svg new file mode 100644 index 0000000..4a10317 --- /dev/null +++ b/dist/ssc-logo.svg @@ -0,0 +1,750 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.ipynb b/index.ipynb index 15cfbb6..9173293 100644 --- a/index.ipynb +++ b/index.ipynb @@ -904,9 +904,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" - }, - "reveal": { - "header": "  Part 1 | Part 2 | Part 3 | GitHub repository" } }, "nbformat": 4, diff --git a/jupyter_nbconvert_config.py b/jupyter_nbconvert_config.py index ed30fab..1d59c88 100644 --- a/jupyter_nbconvert_config.py +++ b/jupyter_nbconvert_config.py @@ -1,8 +1,8 @@ c = get_config() # noqa c.ExecutePreprocessor.enabled = True c.NbConvertApp.export_format = "slides" -# c.SlidesExporter.extra_template_paths = [] +c.SlidesExporter.extra_template_paths = ["."] c.SlidesExporter.file_extension = ".html" c.SlidesExporter.reveal_transition = "convex" c.SlidesExporter.reveal_scroll = True -# c.SlidesExporter.template_file = None +c.SlidesExporter.template_name = "jupyter_nbconvert_template" diff --git a/jupyter_nbconvert_template/conf.json b/jupyter_nbconvert_template/conf.json new file mode 100644 index 0000000..dcb6dfb --- /dev/null +++ b/jupyter_nbconvert_template/conf.json @@ -0,0 +1,6 @@ +{ + "base_template": "reveal", + "mimetypes": { + "text/html": true + } +} diff --git a/jupyter_nbconvert_template/index.html.j2 b/jupyter_nbconvert_template/index.html.j2 new file mode 100644 index 0000000..88b17bb --- /dev/null +++ b/jupyter_nbconvert_template/index.html.j2 @@ -0,0 +1,19 @@ +{%- extends 'reveal/index.html.j2' -%} + +{%- block body_header -%} + +
+
+
+
+

  +Home | +Part 1 | +Part 2 | +Part 3 +

+
+ +
+
+{%- endblock body_header -%}