fraudTech commited on
Commit
22754e5
·
1 Parent(s): c42fdfa

Add LaTeX rendering with KaTeX: Install remark-math, rehype-katex, and add custom styling

Browse files
Files changed (4) hide show
  1. web/package-lock.json +342 -1
  2. web/package.json +4 -1
  3. web/src/App.css +49 -0
  4. web/src/App.tsx +5 -0
web/package-lock.json CHANGED
@@ -9,10 +9,13 @@
9
  "version": "0.1.0",
10
  "dependencies": {
11
  "axios": "^1.6.2",
 
12
  "react": "^18.2.0",
13
  "react-dom": "^18.2.0",
14
  "react-markdown": "^9.0.1",
15
- "react-syntax-highlighter": "^15.5.0"
 
 
16
  },
17
  "devDependencies": {
18
  "@types/react": "^18.2.43",
@@ -1148,6 +1151,12 @@
1148
  "@types/unist": "*"
1149
  }
1150
  },
 
 
 
 
 
 
1151
  "node_modules/@types/mdast": {
1152
  "version": "4.0.4",
1153
  "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
@@ -1409,6 +1418,15 @@
1409
  "url": "https://github.com/sponsors/wooorm"
1410
  }
1411
  },
 
 
 
 
 
 
 
 
 
1412
  "node_modules/convert-source-map": {
1413
  "version": "2.0.0",
1414
  "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
@@ -1504,6 +1522,18 @@
1504
  "dev": true,
1505
  "license": "ISC"
1506
  },
 
 
 
 
 
 
 
 
 
 
 
 
1507
  "node_modules/es-define-property": {
1508
  "version": "1.0.1",
1509
  "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
@@ -1793,6 +1823,148 @@
1793
  "node": ">= 0.4"
1794
  }
1795
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1796
  "node_modules/hast-util-parse-selector": {
1797
  "version": "2.2.5",
1798
  "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
@@ -1830,6 +2002,22 @@
1830
  "url": "https://opencollective.com/unified"
1831
  }
1832
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1833
  "node_modules/hast-util-whitespace": {
1834
  "version": "3.0.0",
1835
  "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
@@ -2027,6 +2215,22 @@
2027
  "node": ">=6"
2028
  }
2029
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2030
  "node_modules/longest-streak": {
2031
  "version": "3.1.0",
2032
  "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",
@@ -2106,6 +2310,25 @@
2106
  "url": "https://opencollective.com/unified"
2107
  }
2108
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2109
  "node_modules/mdast-util-mdx-expression": {
2110
  "version": "2.0.1",
2111
  "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz",
@@ -2304,6 +2527,25 @@
2304
  "micromark-util-types": "^2.0.0"
2305
  }
2306
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2307
  "node_modules/micromark-factory-destination": {
2308
  "version": "2.0.1",
2309
  "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
@@ -2755,6 +2997,18 @@
2755
  "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",
2756
  "license": "MIT"
2757
  },
 
 
 
 
 
 
 
 
 
 
 
 
2758
  "node_modules/picocolors": {
2759
  "version": "1.1.1",
2760
  "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -3011,6 +3265,41 @@
3011
  "node": ">=6"
3012
  }
3013
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3014
  "node_modules/remark-parse": {
3015
  "version": "11.0.0",
3016
  "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
@@ -3210,6 +3499,20 @@
3210
  "url": "https://opencollective.com/unified"
3211
  }
3212
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3213
  "node_modules/unist-util-is": {
3214
  "version": "6.0.1",
3215
  "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
@@ -3236,6 +3539,20 @@
3236
  "url": "https://opencollective.com/unified"
3237
  }
3238
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3239
  "node_modules/unist-util-stringify-position": {
3240
  "version": "4.0.0",
3241
  "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
@@ -3323,6 +3640,20 @@
3323
  "url": "https://opencollective.com/unified"
3324
  }
3325
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3326
  "node_modules/vfile-message": {
3327
  "version": "4.0.3",
3328
  "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
@@ -3397,6 +3728,16 @@
3397
  }
3398
  }
3399
  },
 
 
 
 
 
 
 
 
 
 
3400
  "node_modules/xtend": {
3401
  "version": "4.0.2",
3402
  "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
 
9
  "version": "0.1.0",
10
  "dependencies": {
11
  "axios": "^1.6.2",
12
+ "katex": "^0.16.27",
13
  "react": "^18.2.0",
14
  "react-dom": "^18.2.0",
15
  "react-markdown": "^9.0.1",
16
+ "react-syntax-highlighter": "^15.5.0",
17
+ "rehype-katex": "^7.0.1",
18
+ "remark-math": "^6.0.0"
19
  },
20
  "devDependencies": {
21
  "@types/react": "^18.2.43",
 
1151
  "@types/unist": "*"
1152
  }
1153
  },
1154
+ "node_modules/@types/katex": {
1155
+ "version": "0.16.7",
1156
+ "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.7.tgz",
1157
+ "integrity": "sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==",
1158
+ "license": "MIT"
1159
+ },
1160
  "node_modules/@types/mdast": {
1161
  "version": "4.0.4",
1162
  "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
 
1418
  "url": "https://github.com/sponsors/wooorm"
1419
  }
1420
  },
1421
+ "node_modules/commander": {
1422
+ "version": "8.3.0",
1423
+ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
1424
+ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
1425
+ "license": "MIT",
1426
+ "engines": {
1427
+ "node": ">= 12"
1428
+ }
1429
+ },
1430
  "node_modules/convert-source-map": {
1431
  "version": "2.0.0",
1432
  "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
 
1522
  "dev": true,
1523
  "license": "ISC"
1524
  },
1525
+ "node_modules/entities": {
1526
+ "version": "6.0.1",
1527
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
1528
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
1529
+ "license": "BSD-2-Clause",
1530
+ "engines": {
1531
+ "node": ">=0.12"
1532
+ },
1533
+ "funding": {
1534
+ "url": "https://github.com/fb55/entities?sponsor=1"
1535
+ }
1536
+ },
1537
  "node_modules/es-define-property": {
1538
  "version": "1.0.1",
1539
  "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
 
1823
  "node": ">= 0.4"
1824
  }
1825
  },
1826
+ "node_modules/hast-util-from-dom": {
1827
+ "version": "5.0.1",
1828
+ "resolved": "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.1.tgz",
1829
+ "integrity": "sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q==",
1830
+ "license": "ISC",
1831
+ "dependencies": {
1832
+ "@types/hast": "^3.0.0",
1833
+ "hastscript": "^9.0.0",
1834
+ "web-namespaces": "^2.0.0"
1835
+ },
1836
+ "funding": {
1837
+ "type": "opencollective",
1838
+ "url": "https://opencollective.com/unified"
1839
+ }
1840
+ },
1841
+ "node_modules/hast-util-from-dom/node_modules/hast-util-parse-selector": {
1842
+ "version": "4.0.0",
1843
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
1844
+ "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==",
1845
+ "license": "MIT",
1846
+ "dependencies": {
1847
+ "@types/hast": "^3.0.0"
1848
+ },
1849
+ "funding": {
1850
+ "type": "opencollective",
1851
+ "url": "https://opencollective.com/unified"
1852
+ }
1853
+ },
1854
+ "node_modules/hast-util-from-dom/node_modules/hastscript": {
1855
+ "version": "9.0.1",
1856
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz",
1857
+ "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==",
1858
+ "license": "MIT",
1859
+ "dependencies": {
1860
+ "@types/hast": "^3.0.0",
1861
+ "comma-separated-tokens": "^2.0.0",
1862
+ "hast-util-parse-selector": "^4.0.0",
1863
+ "property-information": "^7.0.0",
1864
+ "space-separated-tokens": "^2.0.0"
1865
+ },
1866
+ "funding": {
1867
+ "type": "opencollective",
1868
+ "url": "https://opencollective.com/unified"
1869
+ }
1870
+ },
1871
+ "node_modules/hast-util-from-html": {
1872
+ "version": "2.0.3",
1873
+ "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz",
1874
+ "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==",
1875
+ "license": "MIT",
1876
+ "dependencies": {
1877
+ "@types/hast": "^3.0.0",
1878
+ "devlop": "^1.1.0",
1879
+ "hast-util-from-parse5": "^8.0.0",
1880
+ "parse5": "^7.0.0",
1881
+ "vfile": "^6.0.0",
1882
+ "vfile-message": "^4.0.0"
1883
+ },
1884
+ "funding": {
1885
+ "type": "opencollective",
1886
+ "url": "https://opencollective.com/unified"
1887
+ }
1888
+ },
1889
+ "node_modules/hast-util-from-html-isomorphic": {
1890
+ "version": "2.0.0",
1891
+ "resolved": "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz",
1892
+ "integrity": "sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==",
1893
+ "license": "MIT",
1894
+ "dependencies": {
1895
+ "@types/hast": "^3.0.0",
1896
+ "hast-util-from-dom": "^5.0.0",
1897
+ "hast-util-from-html": "^2.0.0",
1898
+ "unist-util-remove-position": "^5.0.0"
1899
+ },
1900
+ "funding": {
1901
+ "type": "opencollective",
1902
+ "url": "https://opencollective.com/unified"
1903
+ }
1904
+ },
1905
+ "node_modules/hast-util-from-parse5": {
1906
+ "version": "8.0.3",
1907
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz",
1908
+ "integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==",
1909
+ "license": "MIT",
1910
+ "dependencies": {
1911
+ "@types/hast": "^3.0.0",
1912
+ "@types/unist": "^3.0.0",
1913
+ "devlop": "^1.0.0",
1914
+ "hastscript": "^9.0.0",
1915
+ "property-information": "^7.0.0",
1916
+ "vfile": "^6.0.0",
1917
+ "vfile-location": "^5.0.0",
1918
+ "web-namespaces": "^2.0.0"
1919
+ },
1920
+ "funding": {
1921
+ "type": "opencollective",
1922
+ "url": "https://opencollective.com/unified"
1923
+ }
1924
+ },
1925
+ "node_modules/hast-util-from-parse5/node_modules/hast-util-parse-selector": {
1926
+ "version": "4.0.0",
1927
+ "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
1928
+ "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==",
1929
+ "license": "MIT",
1930
+ "dependencies": {
1931
+ "@types/hast": "^3.0.0"
1932
+ },
1933
+ "funding": {
1934
+ "type": "opencollective",
1935
+ "url": "https://opencollective.com/unified"
1936
+ }
1937
+ },
1938
+ "node_modules/hast-util-from-parse5/node_modules/hastscript": {
1939
+ "version": "9.0.1",
1940
+ "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz",
1941
+ "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==",
1942
+ "license": "MIT",
1943
+ "dependencies": {
1944
+ "@types/hast": "^3.0.0",
1945
+ "comma-separated-tokens": "^2.0.0",
1946
+ "hast-util-parse-selector": "^4.0.0",
1947
+ "property-information": "^7.0.0",
1948
+ "space-separated-tokens": "^2.0.0"
1949
+ },
1950
+ "funding": {
1951
+ "type": "opencollective",
1952
+ "url": "https://opencollective.com/unified"
1953
+ }
1954
+ },
1955
+ "node_modules/hast-util-is-element": {
1956
+ "version": "3.0.0",
1957
+ "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz",
1958
+ "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==",
1959
+ "license": "MIT",
1960
+ "dependencies": {
1961
+ "@types/hast": "^3.0.0"
1962
+ },
1963
+ "funding": {
1964
+ "type": "opencollective",
1965
+ "url": "https://opencollective.com/unified"
1966
+ }
1967
+ },
1968
  "node_modules/hast-util-parse-selector": {
1969
  "version": "2.2.5",
1970
  "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
 
2002
  "url": "https://opencollective.com/unified"
2003
  }
2004
  },
2005
+ "node_modules/hast-util-to-text": {
2006
+ "version": "4.0.2",
2007
+ "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz",
2008
+ "integrity": "sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==",
2009
+ "license": "MIT",
2010
+ "dependencies": {
2011
+ "@types/hast": "^3.0.0",
2012
+ "@types/unist": "^3.0.0",
2013
+ "hast-util-is-element": "^3.0.0",
2014
+ "unist-util-find-after": "^5.0.0"
2015
+ },
2016
+ "funding": {
2017
+ "type": "opencollective",
2018
+ "url": "https://opencollective.com/unified"
2019
+ }
2020
+ },
2021
  "node_modules/hast-util-whitespace": {
2022
  "version": "3.0.0",
2023
  "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
 
2215
  "node": ">=6"
2216
  }
2217
  },
2218
+ "node_modules/katex": {
2219
+ "version": "0.16.27",
2220
+ "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.27.tgz",
2221
+ "integrity": "sha512-aeQoDkuRWSqQN6nSvVCEFvfXdqo1OQiCmmW1kc9xSdjutPv7BGO7pqY9sQRJpMOGrEdfDgF2TfRXe5eUAD2Waw==",
2222
+ "funding": [
2223
+ "https://opencollective.com/katex",
2224
+ "https://github.com/sponsors/katex"
2225
+ ],
2226
+ "license": "MIT",
2227
+ "dependencies": {
2228
+ "commander": "^8.3.0"
2229
+ },
2230
+ "bin": {
2231
+ "katex": "cli.js"
2232
+ }
2233
+ },
2234
  "node_modules/longest-streak": {
2235
  "version": "3.1.0",
2236
  "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",
 
2310
  "url": "https://opencollective.com/unified"
2311
  }
2312
  },
2313
+ "node_modules/mdast-util-math": {
2314
+ "version": "3.0.0",
2315
+ "resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz",
2316
+ "integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==",
2317
+ "license": "MIT",
2318
+ "dependencies": {
2319
+ "@types/hast": "^3.0.0",
2320
+ "@types/mdast": "^4.0.0",
2321
+ "devlop": "^1.0.0",
2322
+ "longest-streak": "^3.0.0",
2323
+ "mdast-util-from-markdown": "^2.0.0",
2324
+ "mdast-util-to-markdown": "^2.1.0",
2325
+ "unist-util-remove-position": "^5.0.0"
2326
+ },
2327
+ "funding": {
2328
+ "type": "opencollective",
2329
+ "url": "https://opencollective.com/unified"
2330
+ }
2331
+ },
2332
  "node_modules/mdast-util-mdx-expression": {
2333
  "version": "2.0.1",
2334
  "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz",
 
2527
  "micromark-util-types": "^2.0.0"
2528
  }
2529
  },
2530
+ "node_modules/micromark-extension-math": {
2531
+ "version": "3.1.0",
2532
+ "resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz",
2533
+ "integrity": "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==",
2534
+ "license": "MIT",
2535
+ "dependencies": {
2536
+ "@types/katex": "^0.16.0",
2537
+ "devlop": "^1.0.0",
2538
+ "katex": "^0.16.0",
2539
+ "micromark-factory-space": "^2.0.0",
2540
+ "micromark-util-character": "^2.0.0",
2541
+ "micromark-util-symbol": "^2.0.0",
2542
+ "micromark-util-types": "^2.0.0"
2543
+ },
2544
+ "funding": {
2545
+ "type": "opencollective",
2546
+ "url": "https://opencollective.com/unified"
2547
+ }
2548
+ },
2549
  "node_modules/micromark-factory-destination": {
2550
  "version": "2.0.1",
2551
  "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
 
2997
  "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",
2998
  "license": "MIT"
2999
  },
3000
+ "node_modules/parse5": {
3001
+ "version": "7.3.0",
3002
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
3003
+ "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
3004
+ "license": "MIT",
3005
+ "dependencies": {
3006
+ "entities": "^6.0.0"
3007
+ },
3008
+ "funding": {
3009
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
3010
+ }
3011
+ },
3012
  "node_modules/picocolors": {
3013
  "version": "1.1.1",
3014
  "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
 
3265
  "node": ">=6"
3266
  }
3267
  },
3268
+ "node_modules/rehype-katex": {
3269
+ "version": "7.0.1",
3270
+ "resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-7.0.1.tgz",
3271
+ "integrity": "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==",
3272
+ "license": "MIT",
3273
+ "dependencies": {
3274
+ "@types/hast": "^3.0.0",
3275
+ "@types/katex": "^0.16.0",
3276
+ "hast-util-from-html-isomorphic": "^2.0.0",
3277
+ "hast-util-to-text": "^4.0.0",
3278
+ "katex": "^0.16.0",
3279
+ "unist-util-visit-parents": "^6.0.0",
3280
+ "vfile": "^6.0.0"
3281
+ },
3282
+ "funding": {
3283
+ "type": "opencollective",
3284
+ "url": "https://opencollective.com/unified"
3285
+ }
3286
+ },
3287
+ "node_modules/remark-math": {
3288
+ "version": "6.0.0",
3289
+ "resolved": "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz",
3290
+ "integrity": "sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==",
3291
+ "license": "MIT",
3292
+ "dependencies": {
3293
+ "@types/mdast": "^4.0.0",
3294
+ "mdast-util-math": "^3.0.0",
3295
+ "micromark-extension-math": "^3.0.0",
3296
+ "unified": "^11.0.0"
3297
+ },
3298
+ "funding": {
3299
+ "type": "opencollective",
3300
+ "url": "https://opencollective.com/unified"
3301
+ }
3302
+ },
3303
  "node_modules/remark-parse": {
3304
  "version": "11.0.0",
3305
  "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
 
3499
  "url": "https://opencollective.com/unified"
3500
  }
3501
  },
3502
+ "node_modules/unist-util-find-after": {
3503
+ "version": "5.0.0",
3504
+ "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz",
3505
+ "integrity": "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==",
3506
+ "license": "MIT",
3507
+ "dependencies": {
3508
+ "@types/unist": "^3.0.0",
3509
+ "unist-util-is": "^6.0.0"
3510
+ },
3511
+ "funding": {
3512
+ "type": "opencollective",
3513
+ "url": "https://opencollective.com/unified"
3514
+ }
3515
+ },
3516
  "node_modules/unist-util-is": {
3517
  "version": "6.0.1",
3518
  "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
 
3539
  "url": "https://opencollective.com/unified"
3540
  }
3541
  },
3542
+ "node_modules/unist-util-remove-position": {
3543
+ "version": "5.0.0",
3544
+ "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz",
3545
+ "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==",
3546
+ "license": "MIT",
3547
+ "dependencies": {
3548
+ "@types/unist": "^3.0.0",
3549
+ "unist-util-visit": "^5.0.0"
3550
+ },
3551
+ "funding": {
3552
+ "type": "opencollective",
3553
+ "url": "https://opencollective.com/unified"
3554
+ }
3555
+ },
3556
  "node_modules/unist-util-stringify-position": {
3557
  "version": "4.0.0",
3558
  "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
 
3640
  "url": "https://opencollective.com/unified"
3641
  }
3642
  },
3643
+ "node_modules/vfile-location": {
3644
+ "version": "5.0.3",
3645
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz",
3646
+ "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==",
3647
+ "license": "MIT",
3648
+ "dependencies": {
3649
+ "@types/unist": "^3.0.0",
3650
+ "vfile": "^6.0.0"
3651
+ },
3652
+ "funding": {
3653
+ "type": "opencollective",
3654
+ "url": "https://opencollective.com/unified"
3655
+ }
3656
+ },
3657
  "node_modules/vfile-message": {
3658
  "version": "4.0.3",
3659
  "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
 
3728
  }
3729
  }
3730
  },
3731
+ "node_modules/web-namespaces": {
3732
+ "version": "2.0.1",
3733
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
3734
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
3735
+ "license": "MIT",
3736
+ "funding": {
3737
+ "type": "github",
3738
+ "url": "https://github.com/sponsors/wooorm"
3739
+ }
3740
+ },
3741
  "node_modules/xtend": {
3742
  "version": "4.0.2",
3743
  "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
web/package.json CHANGED
@@ -9,11 +9,14 @@
9
  "preview": "vite preview"
10
  },
11
  "dependencies": {
 
 
12
  "react": "^18.2.0",
13
  "react-dom": "^18.2.0",
14
  "react-markdown": "^9.0.1",
15
  "react-syntax-highlighter": "^15.5.0",
16
- "axios": "^1.6.2"
 
17
  },
18
  "devDependencies": {
19
  "@types/react": "^18.2.43",
 
9
  "preview": "vite preview"
10
  },
11
  "dependencies": {
12
+ "axios": "^1.6.2",
13
+ "katex": "^0.16.27",
14
  "react": "^18.2.0",
15
  "react-dom": "^18.2.0",
16
  "react-markdown": "^9.0.1",
17
  "react-syntax-highlighter": "^15.5.0",
18
+ "rehype-katex": "^7.0.1",
19
+ "remark-math": "^6.0.0"
20
  },
21
  "devDependencies": {
22
  "@types/react": "^18.2.43",
web/src/App.css CHANGED
@@ -451,6 +451,55 @@ body {
451
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
452
  }
453
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  .tool-calls {
455
  margin-top: 1rem;
456
  padding-top: 1rem;
 
451
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
452
  }
453
 
454
+ /* KaTeX Math Rendering Styles */
455
+ .message-content .katex {
456
+ font-size: 1.1em;
457
+ color: #e8d4c0;
458
+ }
459
+
460
+ .message-content .katex-display {
461
+ margin: 1rem 0;
462
+ padding: 1rem;
463
+ background: #1a1614;
464
+ border: 1px solid #3a342e;
465
+ border-radius: 6px;
466
+ overflow-x: auto;
467
+ }
468
+
469
+ .message-content .katex-display > .katex {
470
+ text-align: center;
471
+ color: #e8d4c0;
472
+ }
473
+
474
+ /* Inline math */
475
+ .message-content .katex-inline {
476
+ padding: 0 0.2rem;
477
+ }
478
+
479
+ /* Math operators and symbols */
480
+ .message-content .katex .mord,
481
+ .message-content .katex .mbin,
482
+ .message-content .katex .mrel,
483
+ .message-content .katex .mop {
484
+ color: #e8d4c0;
485
+ }
486
+
487
+ /* Fractions */
488
+ .message-content .katex .frac-line {
489
+ border-bottom-color: #a89784;
490
+ }
491
+
492
+ /* Math text and operators */
493
+ .message-content .katex .mathrm,
494
+ .message-content .katex .mathit {
495
+ color: #d4a574;
496
+ }
497
+
498
+ /* Ensure good contrast for all math elements */
499
+ .message-content .katex * {
500
+ color: inherit;
501
+ }
502
+
503
  .tool-calls {
504
  margin-top: 1rem;
505
  padding-top: 1rem;
web/src/App.tsx CHANGED
@@ -1,6 +1,9 @@
1
  import React, { useState, useRef, useEffect } from 'react';
2
  import ReactMarkdown from 'react-markdown';
3
  import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
 
 
 
4
  import Login from './Login';
5
  import './App.css';
6
 
@@ -471,6 +474,8 @@ function App() {
471
  </div>
472
  <div className="message-content">
473
  <ReactMarkdown
 
 
474
  components={{
475
  code({ className, children, ...props }: any) {
476
  const match = /language-(\w+)/.exec(className || '');
 
1
  import React, { useState, useRef, useEffect } from 'react';
2
  import ReactMarkdown from 'react-markdown';
3
  import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
4
+ import remarkMath from 'remark-math';
5
+ import rehypeKatex from 'rehype-katex';
6
+ import 'katex/dist/katex.min.css';
7
  import Login from './Login';
8
  import './App.css';
9
 
 
474
  </div>
475
  <div className="message-content">
476
  <ReactMarkdown
477
+ remarkPlugins={[remarkMath]}
478
+ rehypePlugins={[rehypeKatex]}
479
  components={{
480
  code({ className, children, ...props }: any) {
481
  const match = /language-(\w+)/.exec(className || '');