From 6ed502d51c98b84fbdf147d2bfac81d1ce7a9670 Mon Sep 17 00:00:00 2001 From: fruchti Date: Mon, 27 Nov 2023 11:02:18 +0100 Subject: [PATCH] Gitea: Disable Jupyter notebook rendering --- hosts/gitea.nix | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/hosts/gitea.nix b/hosts/gitea.nix index 9de795d..bb89abd 100644 --- a/hosts/gitea.nix +++ b/hosts/gitea.nix @@ -22,12 +22,13 @@ in contentDir = "/data/git/data/lfs"; }; settings = let + python = pkgs.python311; docutils = - pkgs.python310.withPackages (ps: with ps; [ + python.withPackages (ps: with ps; [ docutils # Provides rendering of ReStructured Text files pygments # Provides syntax highlighting ]); - nbconvert = pkgs.python310.withPackages (ps: with ps; [ + nbconvert = python.withPackages (ps: with ps; [ jupyter ipykernel nbconvert @@ -78,25 +79,25 @@ in RENDER_COMMAND = "${docutils}/bin/rst2html.py"; IS_INPUT_FILE = false; }; - "markup.jupyter" = { - ENABLED = true; - FILE_EXTENSIONS = ".ipynb"; - # RENDER_COMMAND = "\"${nbconvert}/bin/jupyter nbconvert --stdout --to html --template basic \""; - RENDER_COMMAND = "\"${cached_jupyter_preview} \""; - IS_INPUT_FILE = true; - # RENDER_CONTENT_MODE = "iframe"; - }; - "markup.sanitizer.jupyter.div" = { ELEMENT = "div"; ALLOW_ATTR = "class"; REGEXP = ""; }; - "markup.sanitizer.jupyter.span" = { ELEMENT = "span"; ALLOW_ATTR = "class"; REGEXP = ""; }; - "markup.sanitizer.jupyter.img" = { ELEMENT = "img"; ALLOW_ATTR = "class"; REGEXP = ""; ALLOW_DATA_URI_IMAGES = "true"; }; - "markup.sanitizer.jupyter.svg.width" = { ELEMENT = "svg"; ALLOW_ATTR = "width"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.height" = { ELEMENT = "svg"; ALLOW_ATTR = "height"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.viewbox" = { ELEMENT = "svg"; ALLOW_ATTR = "viewbox"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.use" = { ELEMENT = "use"; ALLOW_ATTR = "transform"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.g" = { ELEMENT = "g"; ALLOW_ATTR = "class"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.path.style" = { ELEMENT = "path"; ALLOW_ATTR = "style"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.path.d" = { ELEMENT = "path"; ALLOW_ATTR = "d"; REGEXP = ""; }; - "markup.sanitizer.jupyter.svg.path.transform" = { ELEMENT = "path"; ALLOW_ATTR = "transform"; REGEXP = ""; }; + # "markup.jupyter" = { + # ENABLED = true; + # FILE_EXTENSIONS = ".ipynb"; + # # RENDER_COMMAND = "\"${nbconvert}/bin/jupyter nbconvert --stdout --to html --template basic \""; + # RENDER_COMMAND = "\"${cached_jupyter_preview} \""; + # IS_INPUT_FILE = true; + # # RENDER_CONTENT_MODE = "iframe"; + # }; + # "markup.sanitizer.jupyter.div" = { ELEMENT = "div"; ALLOW_ATTR = "class"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.span" = { ELEMENT = "span"; ALLOW_ATTR = "class"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.img" = { ELEMENT = "img"; ALLOW_ATTR = "class"; REGEXP = ""; ALLOW_DATA_URI_IMAGES = "true"; }; + # "markup.sanitizer.jupyter.svg.width" = { ELEMENT = "svg"; ALLOW_ATTR = "width"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.height" = { ELEMENT = "svg"; ALLOW_ATTR = "height"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.viewbox" = { ELEMENT = "svg"; ALLOW_ATTR = "viewbox"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.use" = { ELEMENT = "use"; ALLOW_ATTR = "transform"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.g" = { ELEMENT = "g"; ALLOW_ATTR = "class"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.path.style" = { ELEMENT = "path"; ALLOW_ATTR = "style"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.path.d" = { ELEMENT = "path"; ALLOW_ATTR = "d"; REGEXP = ""; }; + # "markup.sanitizer.jupyter.svg.path.transform" = { ELEMENT = "path"; ALLOW_ATTR = "transform"; REGEXP = ""; }; }; };