Skip to content

Commit ea258b6

Browse files
Create more_options.txt
1 parent b095ff3 commit ea258b6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Diff for: more_options.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
https://blog.gitea.com/render-jupyter-notebooks/
2+
3+
4+
How to render Jupyter Notebooks on Gitea
5+
6+
1) pip3 install nbconvert
7+
8+
2) cd /etc/gitea/app.ini
9+
10+
3) nano app.ini
11+
12+
4) add the following text:
13+
14+
; Gitea looks for markup.xxxxx and will apply both "markup" and "xxxxx" as a class to the parent <div>
15+
[markup.jupyter]
16+
ENABLED = true
17+
; all the file extensions we want to convert, comma separated.
18+
FILE_EXTENSIONS = .ipynb
19+
; Lets use out nbconvert command from earlier - making to sure to convert to HTML and to output to stdout
20+
RENDER_COMMAND = "jupyter nbconvert --stdout --to html --template full "
21+
; nbconvert accepts a path to a file and not stdin
22+
IS_INPUT_FILE = true
23+
24+
; the name after sanitizer doesn't really matter
25+
[markup.sanitizer.jupyter0]
26+
; Jupyter chiefly uses divs
27+
ELEMENT = div
28+
; we will need access to html classes later
29+
ALLOW_ATTR = class
30+
; we don't mind which classes we keep, so let's keep all of them
31+
REGEXP =
32+
33+
5) systemctl restart gitea

0 commit comments

Comments
 (0)