Docfile commited on
Commit
3cdafe6
·
verified ·
1 Parent(s): f92ef64

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +28 -19
templates/index.html CHANGED
@@ -4,42 +4,30 @@
4
  <title>Mariam AI</title>
5
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTL/LY/sVhVKg8tvkGTl/mmexC3wpUdSZvKYE2qX" crossorigin="anonymous">
6
  <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amWiwIj8VZkb9rmKa9b9lhVencyWv" crossorigin="anonymous"></script>
7
- <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
 
 
8
  <style>
9
  body {
10
  font-family: sans-serif;
11
  margin: 20px;
12
  }
13
  #navbar {
14
- background-color: #f0f0f0; /* Couleur de fond de la barre de navigation */
15
  padding: 10px;
16
  margin-bottom: 20px;
17
- border-radius: 5px; /* Coins arrondis */
18
-
19
  }
20
  #output {
21
- padding: 15px; /* Ajout de padding */
22
- border: 1px solid #ddd; /* Bordure légère */
23
  border-radius: 5px;
24
  }
25
  </style>
26
- <script>
27
- document.addEventListener("DOMContentLoaded", function() {
28
- renderMathInElement(document.body, {
29
- delimiters: [
30
- {left: "$$", right: "$$", display: true},
31
- {left: "$", right: "$", display: false},
32
- {left: "\\[", right: "\\]", display: true},
33
- ]
34
- });
35
- });
36
- </script>
37
-
38
  </head>
39
  <body>
40
  <div id="navbar">
41
  <h1>Mariam AI</h1>
42
- <!-- Vous pouvez ajouter d'autres éléments de navigation ici si nécessaire -->
43
  </div>
44
 
45
  <form method="POST" enctype="multipart/form-data">
@@ -49,5 +37,26 @@
49
  <div id="output">
50
  {{ e | safe }}
51
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </body>
53
  </html>
 
4
  <title>Mariam AI</title>
5
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTL/LY/sVhVKg8tvkGTl/mmexC3wpUdSZvKYE2qX" crossorigin="anonymous">
6
  <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amWiwIj8VZkb9rmKa9b9lhVencyWv" crossorigin="anonymous"></script>
7
+ <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"
8
+ onload="renderMathInElement(document.body);"></script>
9
+
10
  <style>
11
  body {
12
  font-family: sans-serif;
13
  margin: 20px;
14
  }
15
  #navbar {
16
+ background-color: #f0f0f0;
17
  padding: 10px;
18
  margin-bottom: 20px;
19
+ border-radius: 5px;
 
20
  }
21
  #output {
22
+ padding: 15px;
23
+ border: 1px solid #ddd;
24
  border-radius: 5px;
25
  }
26
  </style>
 
 
 
 
 
 
 
 
 
 
 
 
27
  </head>
28
  <body>
29
  <div id="navbar">
30
  <h1>Mariam AI</h1>
 
31
  </div>
32
 
33
  <form method="POST" enctype="multipart/form-data">
 
37
  <div id="output">
38
  {{ e | safe }}
39
  </div>
40
+
41
+
42
+ <script>
43
+ // Configuration KaTeX – à mettre APRÈS le chargement de la page et du contenu
44
+ window.addEventListener('load', function() { // Assurez-vous que le contenu est chargé
45
+ renderMathInElement(document.body, {
46
+ delimiters: [
47
+ {left: "$$", right: "$$", display: true},
48
+ {left: "$", right: "$", display: false},
49
+ {left: "\\[", right: "\\]", display: true},
50
+ {left: "\\(", right: "\\)", display: false}, // Ajouté
51
+ {left: "\\begin{equation}", right: "\\end{equation}", display: true},
52
+ {left: "\\begin{align}", right: "\\end{align}", display: true},
53
+ {left: "\\begin{alignat}", right: "\\end{alignat}", display: true},
54
+ {left: "\\begin{gather}", right: "\\end{gather}", display: true},
55
+ {left: "\\begin{CD}", right: "\\end{CD}", display: true},
56
+ ],
57
+ throwOnError: false // Important pour éviter les erreurs avec chemfig
58
+ });
59
+ });
60
+ </script>
61
  </body>
62
  </html>