.ipynb)refers to render-jupyter-notebooks
exec command below to extract styles for jupyter notebook
jupyter nbconvert --to html --template basic path/to/some/test/notebook.ipynb
open the generated html file(*.html), and copy the styles to jupyter.less(must strip out all of style sheets, such as <style></style>)
wrap the styles with .markup.jupyter {} in jupyter.less:
.markup.jupyter {
/* styles */
}
put the jupyter.less to custom/public/assets/css/jupyter.less directory:

add the following configuration to custom/templates/header.tmpl:
<link rel="stylesheet/less" type="text/css" href="/assets/css/jupyter.less" />
<script src="//cdn.jsdelivr.net/npm/less" ></script>
add the following configuration to app.ini:
; Gitea looks for markup.xxxxx and will apply both "markup" and "xxxxx" as a class to the parent <div>
[markup.jupyter]
ENABLED = true
; all the file extensions we want to convert, comma separated.
FILE_EXTENSIONS = .ipynb
; Lets use out nbconvert command from earlier - making to sure to convert to HTML and to output to stdout
RENDER_COMMAND = "jupyter nbconvert --stdout --to html --template basic "
; nbconvert accepts a path to a file and not stdin
IS_INPUT_FILE = true
; the name after sanitizer doesn't really matter
[markup.sanitizer.jupyter0]
; Jupyter chiefly uses divs
ELEMENT = div
; we will need access to html classes later
ALLOW_ATTR = class
; we don't mind which classes we keep, so let's keep all of them
REGEXP =
Content type
Image
Digest
sha256:50f93f297…
Size
269.1 MB
Last updated
almost 2 years ago
docker pull homqyy/gitea