diff --git a/assets/css/components/jupyter.css b/assets/css/components/jupyter.css new file mode 100644 index 0000000..4e977a4 --- /dev/null +++ b/assets/css/components/jupyter.css @@ -0,0 +1,31 @@ +.hextra-jupyter-code-cell { + * { + scrollbar-gutter: auto; + } + + @apply hx-mt-6; + + .hextra-jupyter-code-cell-source { + @apply hx-text-sm; + .chroma, + pre { + @apply hx-m-0; + } + } + + .hextra-jupyter-code-cell-outputs-container { + @apply hx-text-xs hx-overflow-hidden hx-border hx-border-t-0 hx-rounded-b-xl dark:hx-border-neutral-800; + + .hextra-jupyter-code-cell-outputs { + @apply hx-overflow-auto hx-max-h-[50vh]; + + pre { + @apply hx-p-4; + } + } + } +} + +.hextra-jupyter-code-cell:has(.hextra-jupyter-code-cell-outputs) .hextra-jupyter-code-cell-source .chroma { + @apply hx-rounded-b-none; +} diff --git a/assets/css/components/scrollbar.css b/assets/css/components/scrollbar.css index 7dc75e9..6699375 100644 --- a/assets/css/components/scrollbar.css +++ b/assets/css/components/scrollbar.css @@ -1,4 +1,4 @@ -.hextra-scrollbar { +.hextra-scrollbar, .hextra-scrollbar * { scrollbar-width: thin; /* Firefox */ scrollbar-color: oklch(55.55% 0 0 / 40%) transparent; /* Firefox */ diff --git a/assets/css/styles.css b/assets/css/styles.css index 3ef02b8..48cfc56 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -9,6 +9,7 @@ @import "components/navbar.css"; @import "components/scrollbar.css"; @import "components/code-copy.css"; +@import "components/jupyter.css"; html { @apply hx-text-base hx-antialiased; diff --git a/exampleSite/content/docs/test-jupyter/index.md b/exampleSite/content/docs/test-jupyter/index.md new file mode 100644 index 0000000..aa184f7 --- /dev/null +++ b/exampleSite/content/docs/test-jupyter/index.md @@ -0,0 +1,10 @@ +--- +title: Jupyter Notebook +math: true +--- + +{{< callout type="info" >}} + Experimental page to include Jupyter Notebooks in the site. +{{< /callout >}} + +{{< jupyter "Intro.ipynb" >}} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index dbb4fe4..026b344 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -60,12 +60,18 @@ {{- end -}}