Skip to content
Snippets Groups Projects
Commit f4d03e3b authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Mathjax is now self hosted

parent 9a4e487d
No related branches found
No related tags found
1 merge request!203Resolve "load mathjax from the sever instead of cdn.jsdelivr.net"
Pipeline #114633 passed
...@@ -11,11 +11,10 @@ services: ...@@ -11,11 +11,10 @@ services:
- 6543:5432 - 6543:5432
grady: grady:
image: docker.gitlab.gwdg.de/j.michal/grady:master build: .
command: > command: >
sh -c "sleep 2 && sh -c "sleep 2 &&
./manage.py migrate --noinput && ./manage.py migrate --noinput &&
./manage.py maketestdata &&
./deploy.sh" ./deploy.sh"
depends_on: depends_on:
- postgres - postgres
......
...@@ -4,23 +4,24 @@ ...@@ -4,23 +4,24 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> <title>Grady</title>
<script id="MathJax-script" async src="https://grady.informatik.uni-goettingen.de/static/mathjax/es5/tex-mml-chtml.js"></script>
<script> <script>
MathJax = { MathJax = {
options: { options: {
skipHtmlTags: [ // HTML tags that won't be searched for math skipHtmlTags: [ // HTML tags that won't be searched for math
'script', 'noscript', 'style', 'textarea', 'pre', 'script', 'noscript', 'style', 'textarea', 'pre',
'code', 'annotation', 'annotation-xml' 'code', 'annotation', 'annotation-xml'
], ],
includeHtmlTags: { // HTML tags that can appear within math includeHtmlTags: { // HTML tags that can appear within math
br: '\n', wbr: '', '#comment': '' br: '\n', wbr: '', '#comment': ''
}, },
ignoreHtmlClass: 'tex2jax_ignore', // class that marks tags not to search ignoreHtmlClass: 'tex2jax_ignore', // class that marks tags not to search
processHtmlClass: 'latex', // class that marks tags that should be searched processHtmlClass: 'latex', // class that marks tags that should be searched
} }
}; };
</script> </script>
<title>Grady</title>
</head> </head>
<body class="tex2jax_ignore"> <body class="tex2jax_ignore">
<noscript> <noscript>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div id="app"> <div id="app">
<v-app :dark="darkMode"> <v-app :dark="darkMode">
<notifications /> <notifications />
<notifications <notifications
group="msg" group="msg"
position="bottom left" position="bottom left"
/> />
......
import fileinput import fileinput
import sys import sys
import re
file = 'core/templates/index.html' file = 'core/templates/index.html'
STATIC_FILES_REGEX = re.compile("=/static/(.*?)([ >])")
SUB_PATTERN = r"={% static '\1' %}\2"
with open(file, "r+") as f: with open(file, "r+") as f:
s = f.read() s = f.read()
f.seek(0) f.seek(0)
f.write("{% load static %}\n" + s) f.write("{% load static %}\n" + s)
for i, line in enumerate(fileinput.input(file, inplace=1)): for line in fileinput.input(file, inplace=1):
sys.stdout.write(line.replace('/static/', "{% static '")) sys.stdout.write(STATIC_FILES_REGEX.sub(SUB_PATTERN, line))
for i, line in enumerate(fileinput.input(file, inplace=1)):
sys.stdout.write(line.replace('.css', ".css' %}"))
for i, line in enumerate(fileinput.input(file, inplace=1)):
sys.stdout.write(line.replace('.js', ".js' %}"))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment