diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-07-06 11:36:40 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-07-06 11:36:40 +0800 |
| commit | 689c6d7f4ec1aeee3d0f9950a21571e04c913786 (patch) | |
| tree | dbc4956131998dc71e60494dc91fee098a9adca7 /index.html | |
| parent | 5e796e8c200e98eed6d7d79d6f3b6b59ae7c8ce4 (diff) | |
markdown support done
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 58 |
1 files changed, 56 insertions, 2 deletions
@@ -7,6 +7,15 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="/src/style.css"> <title>altaf-files</title> + + <!-- KaTeX --> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.17.0/dist/katex.min.css" integrity="sha384-vlBdW0r3AcZO/HboRPznQNowvexd3fY8qHOWkBi5q7KGgqJ+F48+DceybYmrVbmB" crossorigin="anonymous"> + <!-- The loading of KaTeX is deferred to speed up page rendering --> + <script defer src="https://cdn.jsdelivr.net/npm/katex@0.17.0/dist/katex.min.js" integrity="sha384-AtrdNsnxl/75rvBneBVH7DtOvCxSVahR2zWqle1coBKd8DEmLoviqNeJSx64gNAs" crossorigin="anonymous"></script> + <!-- To automatically render math in text elements, include the auto-render extension: --> + <script defer src="https://cdn.jsdelivr.net/npm/katex@0.17.0/dist/contrib/auto-render.min.js" integrity="sha384-bjyGPfbij8/NDKJhSGZNP/khQVgtHUE5exjm4Ydllo42FwIgYsdLO2lXGmRBf5Mz" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script> + <!-- https://github.com/KaTeX/KaTeX/blob/main/contrib/mhchem/README.md --> + <script defer src="https://cdn.jsdelivr.net/npm/katex@0.17.0/dist/contrib/mhchem.min.js" integrity="sha384-fB8BH//9nBzROkMUsu/Dr35jWHIbnKesUo9rW0hfEgw8mZGnkAyBAjKX9F98OVuo" crossorigin="anonymous"></script> </head> <body> <div class="sidebar"> @@ -14,14 +23,59 @@ <span class="sidebar-text">altaf-files</span> </div> <div class="content"> - <section> + <section id="breadcrumb-container-section"> <div class="div-sizing" id="breadcrumb-container"> </div> </section> - <section> + <section id="list-container-section"> <div class="list-container" id="list-container"> </div> </section> + <section id="file-content-section"> + <div id="file-content" class="div-sizing"> + </div> + </section> </div> + <!-- https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/ --> + <script> +(function () { +'use strict'; + +var katexMath = (function () { + var maths = document.querySelectorAll('.arithmatex'), + tex; + + for (var i = 0; i < maths.length; i++) { + tex = maths[i].textContent || maths[i].innerText; + if (tex.startsWith('\\(') && tex.endsWith('\\)')) { + katex.render(tex.slice(2, -2), maths[i], {'displayMode': false}); + } else if (tex.startsWith('\\[') && tex.endsWith('\\]')) { + katex.render(tex.slice(2, -2), maths[i], {'displayMode': true}); + } + } +}); + +(function () { + var onReady = function onReady(fn) { + if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", fn); + } else { + document.attachEvent("onreadystatechange", function () { + if (document.readyState === "interactive") { + fn(); + } + }); + } + }; + + onReady(function () { + if (typeof katex !== "undefined") { + katexMath(); + } + }); +})(); + +}()); + </script> </body> </html> |
