Update index.html
Browse files- index.html +22 -12
index.html
CHANGED
|
@@ -25,41 +25,51 @@ body{
|
|
| 25 |
<article id="content" class="markdown-body"></article>
|
| 26 |
|
| 27 |
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| 28 |
-
|
| 29 |
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
| 30 |
|
| 31 |
<script>
|
| 32 |
mermaid.initialize({ startOnLoad:false });
|
| 33 |
|
| 34 |
-
fetch("
|
| 35 |
.then(r => r.text())
|
| 36 |
.then(md => {
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
|
|
|
|
|
|
| 40 |
document.getElementById("content").innerHTML = html;
|
| 41 |
|
| 42 |
-
//
|
| 43 |
document.querySelectorAll("code.language-mermaid").forEach(el=>{
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
});
|
| 50 |
|
| 51 |
mermaid.init();
|
| 52 |
|
| 53 |
// render math
|
| 54 |
MathJax.typeset();
|
| 55 |
-
|
| 56 |
});
|
| 57 |
</script>
|
| 58 |
|
| 59 |
-
<!-- MathJax -->
|
| 60 |
<script>
|
| 61 |
window.MathJax = {
|
| 62 |
-
tex: {
|
|
|
|
|
|
|
|
|
|
| 63 |
};
|
| 64 |
</script>
|
| 65 |
|
|
|
|
| 25 |
<article id="content" class="markdown-body"></article>
|
| 26 |
|
| 27 |
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
|
|
| 28 |
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
| 29 |
|
| 30 |
<script>
|
| 31 |
mermaid.initialize({ startOnLoad:false });
|
| 32 |
|
| 33 |
+
fetch("./deep-research-report.md") // same HF space
|
| 34 |
.then(r => r.text())
|
| 35 |
.then(md => {
|
| 36 |
|
| 37 |
+
// remove weird research citation artifacts
|
| 38 |
+
md = md.replace(/【.*?†.*?】/g, "");
|
| 39 |
+
|
| 40 |
+
// auto-detect formulas like (WM_t = WM_{t-1} \cup {C_t})
|
| 41 |
+
md = md.replace(/\(([A-Za-z0-9_\-\s\\{}=+\cup]+)\)/g, (m,p)=>{
|
| 42 |
+
if(p.includes("_") || p.includes("\\") || p.includes("="))
|
| 43 |
+
return `$(${p})$`;
|
| 44 |
+
return m;
|
| 45 |
+
});
|
| 46 |
|
| 47 |
+
// convert markdown → html
|
| 48 |
+
const html = marked.parse(md);
|
| 49 |
document.getElementById("content").innerHTML = html;
|
| 50 |
|
| 51 |
+
// convert mermaid blocks
|
| 52 |
document.querySelectorAll("code.language-mermaid").forEach(el=>{
|
| 53 |
+
const pre = el.parentElement;
|
| 54 |
+
const div = document.createElement("div");
|
| 55 |
+
div.className="mermaid";
|
| 56 |
+
div.textContent = el.textContent;
|
| 57 |
+
pre.replaceWith(div);
|
| 58 |
});
|
| 59 |
|
| 60 |
mermaid.init();
|
| 61 |
|
| 62 |
// render math
|
| 63 |
MathJax.typeset();
|
|
|
|
| 64 |
});
|
| 65 |
</script>
|
| 66 |
|
|
|
|
| 67 |
<script>
|
| 68 |
window.MathJax = {
|
| 69 |
+
tex: {
|
| 70 |
+
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
| 71 |
+
displayMath: [['$$','$$']]
|
| 72 |
+
}
|
| 73 |
};
|
| 74 |
</script>
|
| 75 |
|