feat: shortcode for Jupyter Notebook (#337)
Some checks are pending
Deploy Hugo site to Pages / build (push) Waiting to run
Deploy Hugo site to Pages / deploy (push) Blocked by required conditions

* feat: shortcode for Jupyter Notebook

* chore: update generated CSS files

* chore: add example Jupyter Notebook file

* chore: update doc

* chore: enhance jupyter notebook styling

- use raw markdown for contents like code block and markdown text

* feat: support load notebook from assets and remote

- update docs accordingly
- add example notebook file

* chore: rename example file
This commit is contained in:
Xin
2024-09-14 14:29:55 +01:00
committed by GitHub
parent d1c3c40a95
commit 2af73b3d7e
10 changed files with 433 additions and 7 deletions

View File

@ -2532,30 +2532,30 @@ nav .search-wrapper {
.hamburger-menu svg.open > g:nth-of-type(2) path {
transform: translate3d(0, -4px, 0);
}
.hextra-scrollbar {
.hextra-scrollbar, .hextra-scrollbar * {
scrollbar-width: thin; /* Firefox */
scrollbar-color: oklch(55.55% 0 0 / 40%) transparent; /* Firefox */
scrollbar-gutter: stable;
}
.hextra-scrollbar::-webkit-scrollbar {
.hextra-scrollbar::-webkit-scrollbar, .hextra-scrollbar *::-webkit-scrollbar {
height: 0.75rem;
width: 0.75rem;
}
.hextra-scrollbar::-webkit-scrollbar-track {
.hextra-scrollbar::-webkit-scrollbar-track, .hextra-scrollbar *::-webkit-scrollbar-track {
background-color: transparent;
}
.hextra-scrollbar::-webkit-scrollbar-thumb {
.hextra-scrollbar::-webkit-scrollbar-thumb, .hextra-scrollbar *::-webkit-scrollbar-thumb {
border-radius: 10px;
}
.hextra-scrollbar:hover::-webkit-scrollbar-thumb {
.hextra-scrollbar:hover::-webkit-scrollbar-thumb, .hextra-scrollbar *:hover::-webkit-scrollbar-thumb {
border: 3px solid transparent;
background-color: var(--tw-shadow-color);
background-clip: content-box;
--tw-shadow-color: rgb(115 115 115 / 0.2);
--tw-shadow: var(--tw-shadow-colored);
}
.hextra-scrollbar:hover::-webkit-scrollbar-thumb:hover {
.hextra-scrollbar:hover::-webkit-scrollbar-thumb:hover, .hextra-scrollbar *:hover::-webkit-scrollbar-thumb:hover {
--tw-shadow-color: rgb(115 115 115 / 0.4);
--tw-shadow: var(--tw-shadow-colored);
}

View File

@ -0,0 +1,29 @@
.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;
}

View File

@ -1,4 +1,4 @@
.hextra-scrollbar {
.hextra-scrollbar, .hextra-scrollbar * {
scrollbar-width: thin; /* Firefox */
scrollbar-color: oklch(55.55% 0 0 / 40%) transparent; /* Firefox */