File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments