wop commited on
Commit
0acba39
·
verified ·
1 Parent(s): dcd1453

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +29 -52
index.html CHANGED
@@ -1,63 +1,40 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
- <meta charset="UTF-8">
5
- <title>Deep Research Report (client‑side)</title>
6
- <style>
7
- body {font-family: sans-serif; margin: 2rem;}
8
- .mermaid {margin: 1rem 0;}
9
- </style>
10
- </head>
11
- <body>
 
12
 
13
- <h1>Deep Research Report</h1>
 
 
 
 
 
 
 
14
 
15
- <div id="report"></div>
 
 
16
 
17
- <!-- 1️⃣ Markdown → HTML (GitHub‑flavored) -->
18
- <script src="https://cdn.jsdelivr.net/npm/marked-gfm@2.0.0/dist/marked-gfm.min.js"></script>
19
 
20
- <!-- 2️⃣ Mermaid (renders diagrams) -->
21
- <script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
22
 
23
  <script>
24
- // --------------------------------------------------------------
25
- // 3️⃣ Fetch the raw markdown file
26
- // --------------------------------------------------------------
27
- const rawUrl = 'https://raw.githubusercontent.com/koo1140/AI-Research-papers-by-me/main/AGI%20papers/deep-research-report.md';
28
-
29
- fetch(rawUrl)
30
- .then(r => {
31
- if (!r.ok) throw new Error(`Failed to fetch ${rawUrl}: ${r.status}`);
32
- return r.text();
33
- })
34
- .then(markdown => {
35
- // ----------------------------------------------------------
36
- // 4️⃣ Convert markdown → HTML (tables, links, code fences …)
37
- // ----------------------------------------------------------
38
- const html = marked(markdown, {html: true});
39
-
40
- // ----------------------------------------------------------
41
- // 5️⃣ Replace Mermaid diagrams with a <div class="mermaid">
42
- // that Mermaid will render (no images, no extra markup)
43
- // ----------------------------------------------------------
44
- const mermaidHtml = html.replace(
45
- /!\[mermaid:([^]]+)\]\(([^)]+)\)/g,
46
- (_, raw, url) => {
47
- // The raw string is the Mermaid source, e.g. "graph TD; A--B"
48
- return `<div class="mermaid"><script async src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script><div class="mermaid-source">${url}</div></div>`;
49
- }
50
- );
51
-
52
- // ----------------------------------------------------------
53
- // 6️⃣ Insert the final HTML into the page
54
- // ----------------------------------------------------------
55
- document.getElementById('report').innerHTML = mermaidHtml;
56
- })
57
- .catch(err => {
58
- document.getElementById('report').innerHTML = `<p style="color:red;">Error: ${err.message}</p>`;
59
- });
60
  </script>
61
 
62
  </body>
63
- </html>
 
1
  <!DOCTYPE html>
2
+ <html>
3
  <head>
4
+ <meta charset="UTF-8">
5
+
6
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.5.1/github-markdown-light.min.css">
7
+
8
+ <style>
9
+ body{
10
+ background:#0d1117;
11
+ margin:0;
12
+ }
13
 
14
+ .markdown-body{
15
+ box-sizing:border-box;
16
+ min-width:200px;
17
+ max-width:980px;
18
+ margin:40px auto;
19
+ padding:45px;
20
+ }
21
+ </style>
22
 
23
+ </head>
24
+
25
+ <body>
26
 
27
+ <article id="content" class="markdown-body"></article>
 
28
 
29
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
 
30
 
31
  <script>
32
+ fetch("https://raw.githubusercontent.com/koo1140/AI-Reseach-papers-by-me/main/AGI%20papers/deep-research-report.md")
33
+ .then(r => r.text())
34
+ .then(md => {
35
+ document.getElementById("content").innerHTML = marked.parse(md);
36
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  </script>
38
 
39
  </body>
40
+ </html>