index.html 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
  1. <!doctype html>
  2. <html>
  3. <markdown-html
  4. version="1.20.11"
  5. author="PJ568"
  6. repo="https://github.com/PJ-568/markdown.html"
  7. license="CC BY-SA 4.0 International"
  8. >
  9. </markdown-html>
  10. <head>
  11. <meta charset="utf-8" />
  12. <meta name="description" content="HTML read markdown" />
  13. <meta
  14. name="keywords"
  15. content="markdown, html, renderer, low-dependency, one-click deployment"
  16. />
  17. <meta name="author" content="PJ568" />
  18. <link
  19. rel="icon"
  20. type="image/svg+xml"
  21. href="data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDQ4IDQ4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cmVjdCB4PSI2IiB5PSI2IiB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHJ4PSIyLjI1IiBmaWxsPSIjMmU3ZDMyIiBzdHJva2U9IiMxYjVlMjAiIHN0cm9rZS13aWR0aD0iLjc1Ii8+CjxnIGZpbGw9IiNlOGY1ZTkiIHN0cm9rZS13aWR0aD0iLjA5Mzc1Ij4KPHJlY3QgeD0iOSIgeT0iMTIiIHdpZHRoPSIzMCIgaGVpZ2h0PSIxLjUiIHJ4PSIuMzc1Ii8+CjxyZWN0IHg9IjkiIHk9IjE1Ljc1IiB3aWR0aD0iMjYuMjUiIGhlaWdodD0iMS41IiByeD0iLjM3NSIvPgo8cmVjdCB4PSI5IiB5PSIxOS41IiB3aWR0aD0iMjIuNSIgaGVpZ2h0PSIxLjUiIHJ4PSIuMzc1Ii8+CjxyZWN0IHg9IjkiIHk9IjIzLjI1IiB3aWR0aD0iMzAiIGhlaWdodD0iMS41IiByeD0iLjM3NSIvPgo8cmVjdCB4PSI5IiB5PSIyNyIgd2lkdGg9IjI2LjI1IiBoZWlnaHQ9IjEuNSIgcng9Ii4zNzUiLz4KPHJlY3QgeD0iOSIgeT0iMzAuNzUiIHdpZHRoPSIyMi41IiBoZWlnaHQ9IjEuNSIgcng9Ii4zNzUiLz4KPHRleHQgeD0iMjQiIHk9IjM5LjM3NSIgZm9udC1mYW1pbHk9IidTYXJhc2EgVGVybSBTQyBOZXJkXFxcXFxcXFxcXFxcXFxcJycsICdNYXBsZSBNb25vIENOJywgVWJ1bnR1LCBSb2JvdG8sICdPcGVuIFNhbnMnLCAnTWljcm9zb2Z0IFlhSGVpJywgQXJpYWwsIHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNC41cHgiIGZvbnQtd2VpZ2h0PSJib2xkIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj4mbHQ7TUgmZ3Q7PC90ZXh0Pgo8L2c+Cjwvc3ZnPgo="
  22. />
  23. <meta name="viewport" content="width=256, initial-scale=1" />
  24. <script
  25. defer
  26. src="https://lib.baomitu.com/marked/4.0.2/marked.min.js"
  27. type="application/javascript"
  28. ></script>
  29. <script
  30. src="https://lib.baomitu.com/pjax/0.2.8/pjax.min.js"
  31. type="application/javascript"
  32. ></script>
  33. <script
  34. src="https://lib.baomitu.com/translate.js/3.17.0/translate.js"
  35. type="application/javascript"
  36. ></script>
  37. <script
  38. src="https://lib.baomitu.com/Darkmode.js/1.5.7/darkmode-js.min.js"
  39. type="application/javascript"
  40. ></script>
  41. <script
  42. src="https://lib.baomitu.com/mermaid/8.14.0/mermaid.min.js"
  43. type="application/javascript"
  44. ></script>
  45. <script
  46. src="https://lib.baomitu.com/highlight.js/11.4.0/highlight.min.js"
  47. type="application/javascript"
  48. ></script>
  49. <script>
  50. // 使用 IIFE 包裹以避免全局变量污染
  51. (function () {
  52. function getVersion() {
  53. const markdownElement = document.querySelector("markdown-html");
  54. if (markdownElement) {
  55. const version = markdownElement.getAttribute("version");
  56. return version;
  57. } else {
  58. return "未知";
  59. }
  60. }
  61. function getAbout() {
  62. return `
  63. # 关于
  64. ## MARKDOWN.HTML
  65. 版本:${getVersion()}
  66. 旨在提供低依赖、一键部署的 Markdown 网页渲染方案。
  67. ### 特性
  68. - **依赖少**:仅需一个 HTML 文件,即可完成 Markdown 网页渲染。
  69. - **Markdown 支持**:将 Markdown 文件渲染为 HTML。
  70. - **Mermaid 支持**:将 Markdown 中的 Mermaid 语法渲染为图表。
  71. - **多语言支持**:支持多种语言间的机器互译。
  72. - **深色模式**:支持浅色、深色、跟随系统。
  73. - **Pjax 支持**:支持无刷新页面跳转。
  74. 详情请访问 [GitHub](https://github.com/PJ-568/MARKDOWN.HTML) 或 [Gitee](https://gitee.com/PJ-568/MARKDOWN.HTML) 仓库。
  75. `;
  76. }
  77. // 加载动画相关
  78. var loadingState = {
  79. countLoading: 0,
  80. };
  81. Object.defineProperty(loadingState, "countLoading", {
  82. get: function () {
  83. return this._countLoading;
  84. },
  85. set: function (newValue) {
  86. if (newValue < 0) {
  87. newValue = 0;
  88. }
  89. const loadingBar = document.querySelector(".loading-bar");
  90. const progress = document.querySelector(".loading-bar .progress");
  91. if (this.countLoading === 0 && newValue > 0) {
  92. var loadingBarWidth = 20;
  93. var MAX_LOADING_WIDTH = 95;
  94. loadingBar.classList.add("loading");
  95. progress.style.width = loadingBarWidth + "%";
  96. clearInterval(timer);
  97. timer = setInterval(function () {
  98. loadingBarWidth += 3;
  99. if (loadingBarWidth > MAX_LOADING_WIDTH) {
  100. loadingBarWidth = MAX_LOADING_WIDTH;
  101. }
  102. progress.style.width = loadingBarWidth + "%";
  103. }, 500);
  104. } else if (this.countLoading > 0 && newValue === 0) {
  105. clearInterval(timer);
  106. progress.style.width = "100%";
  107. loadingBar.classList.remove("loading");
  108. setTimeout(function () {
  109. progress.style.width = 0;
  110. }, 400);
  111. }
  112. this._countLoading = newValue;
  113. },
  114. });
  115. loadingState.countLoading = 0;
  116. function startLoad() {
  117. loadingState.countLoading = loadingState.countLoading + 1;
  118. }
  119. function endLoad() {
  120. loadingState.countLoading = loadingState.countLoading - 1;
  121. }
  122. var timer = null;
  123. // 文档解析功能相关
  124. var notExistIndexPage = null; // 是否不存在索引页
  125. var pValue = null;
  126. async function getPValue() {
  127. if (pValue) {
  128. return pValue;
  129. } else {
  130. return await decodeMDPath(window.location.href);
  131. }
  132. }
  133. // PJAX 相关
  134. let PJAX;
  135. // 深色模式相关
  136. let darkmode;
  137. // 自定义 PJAX 相关
  138. const existPushState = history && history.pushState;
  139. var level = 1; // 当前页面的层级
  140. var lastLevel = 0;
  141. // 初始化 PJAX
  142. function initPJAX() {
  143. try {
  144. const Pjax =
  145. window.Pjax ||
  146. function () {
  147. console.warn("Pjax 不存在?");
  148. };
  149. PJAX = new Pjax({
  150. selectors: ["head title", ".markdown-body", ".pjax-reload"],
  151. switches: {
  152. ".markdown-body": Pjax.switches.sideBySide,
  153. },
  154. switchesOptions: {
  155. ".markdown-body": {
  156. classNames: {
  157. remove:
  158. "Animated Animated-remove Animated--reverse Animate--fast Animate--noDelay",
  159. add: "Animated",
  160. backward: "Animate--slideInRight",
  161. forward: "Animate--slideInLeft",
  162. },
  163. },
  164. },
  165. cacheBust: false,
  166. });
  167. } catch (e) {
  168. console.error("PJAX 初始化出错:" + e);
  169. }
  170. }
  171. // translate-js 翻译系统
  172. //// 初始化翻译系统
  173. function initTranslate() {
  174. try {
  175. translate.service.use("client.edge");
  176. translate.request.listener.start();
  177. translate.setAutoDiscriminateLocalLanguage();
  178. translate.language.setUrlParamControl();
  179. translate.ignore.class.push("notTranslate");
  180. translate.execute();
  181. } catch (e) {
  182. console.error("翻译系统出错:" + e);
  183. }
  184. }
  185. // Darkmode.js 深色模式
  186. function initDarkmode() {
  187. try {
  188. const Darkmode =
  189. window.Darkmode ||
  190. function () {
  191. console.warn("Darkmode.js 不存在?");
  192. };
  193. darkmode = new Darkmode();
  194. } catch (e) {
  195. console.error("初始化 Darkmode.js 出错:" + e);
  196. }
  197. }
  198. //// 检查并提示翻译
  199. function infoTranslate() {
  200. try {
  201. const currentLang = translate.language.getCurrent();
  202. const originalLang = translate.language.getLocal();
  203. if (currentLang !== originalLang) {
  204. const translateInfo =
  205. document.querySelectorAll(".translate-info");
  206. if (translateInfo) {
  207. translateInfo.forEach(function (item) {
  208. item.remove();
  209. });
  210. }
  211. // 获取 .markdown-body 元素
  212. var bq = document.createElement("blockquote");
  213. bq.classList.add("translate-info");
  214. var infoBody = document.createElement("p");
  215. infoBody.innerText = "当前页面已翻译。您可以:";
  216. var msgBody = document.createElement("p");
  217. var switchButton = document.createElement("a");
  218. switchButton.classList.add("translate-switch");
  219. switchButton.href = "javascript:;";
  220. switchButton.title = "切换到原语言";
  221. switchButton.innerText = "切换到文章原本的语言";
  222. bq.appendChild(infoBody);
  223. bq.appendChild(switchButton);
  224. const mainElement = document.querySelector(
  225. ".markdown-body .content",
  226. );
  227. mainElement.insertBefore(bq, mainElement.children[1]);
  228. }
  229. } catch (e) {
  230. console.error("检查并提示翻译出错:" + e);
  231. }
  232. }
  233. //// 刷新翻译
  234. function refreshTranslate() {
  235. try {
  236. translate.selectLanguageTag.refreshRender();
  237. } catch (e) {
  238. console.error("刷新翻译出错:" + e);
  239. }
  240. }
  241. // 获取文件所在目录
  242. function getDirectory(path) {
  243. path = new URL(path, "http://example.com").pathname;
  244. const lastSlashIndex = path.lastIndexOf("/");
  245. return path.substring(0, lastSlashIndex + 1);
  246. }
  247. // 获取 markdown.html 当前所加载的 md 文件的所在路径
  248. function getPath() {
  249. return getDirectory(window.location.href);
  250. }
  251. // 将 ?p= 后面的值转换为绝对路径
  252. /*
  253. 输出的值是 /path/to/file.md
  254. 当其为 null 时,根据是否存在 index.md 文件来决定返回的值
  255. */
  256. async function decodeMDPath(path) {
  257. const url = new URL(path);
  258. const params = new URLSearchParams(url.search);
  259. path = formatMDPath(params.get("p"));
  260. return path;
  261. }
  262. // 格式化路径
  263. /*
  264. 如果 mdPath 为 null,则返回 null,如果 mdPath 是路径,则返回该路径下 /index.md
  265. return: 返回格式化后的文件路径,一定是绝对路径,或者 null
  266. */
  267. function formatMDPath(mdPath) {
  268. if (mdPath) {
  269. if (isRelativePath(mdPath)) {
  270. mdPath = getPath() + mdPath;
  271. }
  272. mdPath = new URL(mdPath, "http://example.com").pathname;
  273. if (!mdPath.endsWith(".md")) {
  274. if (!mdPath.endsWith("/")) {
  275. mdPath += "/";
  276. }
  277. mdPath += "index.md";
  278. }
  279. }
  280. return mdPath;
  281. }
  282. // 判断是否为其它协议(是 HTTP(S) 协议)
  283. function isProtocol(url) {
  284. //// 排除特殊协议
  285. const excludedProtocols = [
  286. "#",
  287. "javascript:",
  288. "mailto:",
  289. "tel:",
  290. "data:",
  291. "ftp:",
  292. "about:",
  293. ];
  294. if (excludedProtocols.some((proto) => url.startsWith(proto))) {
  295. return false;
  296. } else {
  297. return true;
  298. }
  299. }
  300. // 判断链接是否为外链
  301. function isExternalLink(url) {
  302. if (!url || typeof url !== "string") return false;
  303. if (!isProtocol(url)) {
  304. return false;
  305. }
  306. try {
  307. const currentUrl = new URL(window.location.href);
  308. const targetUrl = new URL(url, currentUrl.origin);
  309. //// 排除非 HTTP(S) 协议
  310. if (!["http:", "https:"].includes(targetUrl.protocol)) return false;
  311. //// 域名统一转小写比较
  312. const currentHost = currentUrl.hostname.toLowerCase();
  313. const targetHost = targetUrl.hostname.toLowerCase();
  314. return currentHost !== targetHost;
  315. } catch (e) {
  316. return false;
  317. }
  318. }
  319. // 判断路径是否为相对路径
  320. function isRelativePath(path) {
  321. return !path.match(/^\//); //// 不以 / 开头
  322. }
  323. // 处理错误
  324. function updateContent(article, title = null, mdPath = pValue) {
  325. try {
  326. document.querySelector(".markdown-body").innerHTML =
  327. `<div class="old-content Animated Animated-remove Animated--reverse Animate--fast Animate--noDelay Animate--slideInLeft">${
  328. document.querySelector(".markdown-body .content").innerHTML
  329. }</div><div class="content Animated Animate--slideInRight">${article}</div>`;
  330. firstH1 = document.querySelector(".markdown-body .content h1");
  331. document.title = title
  332. ? title
  333. : firstH1
  334. ? firstH1.textContent
  335. : mdPath;
  336. } catch (error) {
  337. throw error;
  338. }
  339. }
  340. // 加载 CSS
  341. function loadCSS(url) {
  342. return new Promise((resolve, reject) => {
  343. //// 检查是否已加载
  344. const existingLinks = document.querySelectorAll(
  345. `link[href="${url}"]`,
  346. );
  347. if (existingLinks.length > 0) {
  348. return resolve(url);
  349. }
  350. //// 创建新的 link 元素
  351. const link = document.createElement("link");
  352. link.rel = "stylesheet";
  353. link.type = "text/css";
  354. link.href = url;
  355. //// 成功加载处理
  356. link.onload = () => {
  357. link.onload = null;
  358. link.onerror = null;
  359. resolve(url);
  360. };
  361. //// 加载失败处理
  362. link.onerror = () => {
  363. link.onerror = null;
  364. link.onload = null;
  365. document.head.removeChild(link);
  366. reject(new Error(`无法加载 CSS 文件:${url}`));
  367. };
  368. //// 添加到文档头部
  369. document.head.appendChild(link);
  370. });
  371. }
  372. // 等待动画结束
  373. function waitForAnimationsEnd(parentElement, selector, animationNames) {
  374. return new Promise((resolve) => {
  375. var completedCount = 0;
  376. const elements = parentElement.querySelectorAll(selector);
  377. const totalElements = elements.length;
  378. const handleAnimationEnd = function (event) {
  379. if (
  380. animationNames.includes(event.animationName) &&
  381. Array.from(elements).includes(event.target)
  382. ) {
  383. completedCount++;
  384. if (completedCount === totalElements) {
  385. parentElement.removeEventListener(
  386. "animationend",
  387. handleAnimationEnd,
  388. );
  389. resolve();
  390. }
  391. }
  392. };
  393. parentElement.addEventListener("animationend", handleAnimationEnd);
  394. });
  395. }
  396. // 处理错误
  397. function handleError(mdPath, errorMessage) {
  398. updateContent(
  399. `<h1>加载失败</h1><p>加载文档<code>${mdPath}</code>时出错:<code>${errorMessage}</code>。您可以尝试<a class="refresh-btn" href="">重新加载</a>或<a class="back-btn">返回</a>。</p>`,
  400. "加载失败",
  401. );
  402. waitForAnimationsEnd(
  403. document.querySelector(".markdown-body"),
  404. ".content, .old-content",
  405. ["Animation-slideInRight", "Animation-slideInLeft"],
  406. ).then(() => {
  407. customPushState(
  408. window.location.origin +
  409. window.location.pathname +
  410. (mdPath ? "?p=" + mdPath : ""),
  411. );
  412. });
  413. endLoad();
  414. }
  415. // 更新页面的 markdown 内容
  416. /*
  417. mdPath: 要加载的 markdown 文件路径,最好是带主机名的绝对路径(要用于 fetch())
  418. response: fetch() 的返回值,用于防止二次访问
  419. */
  420. const showMarkdown = async (mdPath, response = null) => {
  421. if (mdPath === null) {
  422. var path = null;
  423. const currentPath = getPath();
  424. // 如果存在 index.md 文件,则返回 index.md,否则返回 README.md
  425. if (notExistIndexPage) {
  426. path = currentPath + "README.md";
  427. } else if (notExistIndexPage === false) {
  428. path = currentPath + "index.md";
  429. } else {
  430. response = await fetch(getPath() + "index.md");
  431. if (
  432. response.ok &&
  433. response.headers.get("content-type").startsWith("text/markdown")
  434. ) {
  435. notExistIndexPage = false;
  436. path = currentPath + "index.md";
  437. } else {
  438. response = null;
  439. notExistIndexPage = true;
  440. path = currentPath + "README.md";
  441. }
  442. }
  443. } else if (mdPath.endsWith("about.md")) {
  444. // 特殊处理 about.md
  445. response = await fetch(mdPath);
  446. const about = getAbout();
  447. if (
  448. response.ok &&
  449. response.headers.get("content-type").startsWith("text/markdown")
  450. ) {
  451. var r_text = await response.text();
  452. const content = about + (await r_text.replace(/^# .*/m, ""));
  453. response = {
  454. ok: true,
  455. status: 200,
  456. statusText: "自生成。",
  457. text: async () => {
  458. return content;
  459. },
  460. };
  461. } else {
  462. response = {
  463. ok: true,
  464. status: 200,
  465. statusText: "自生成。",
  466. text: async () => {
  467. return about + "*无更多详细信息*";
  468. },
  469. };
  470. }
  471. }
  472. try {
  473. pValue = mdPath ? mdPath : path;
  474. updateContent(await getMarkdown(mdPath ? mdPath : path, response));
  475. document.querySelector("html").classList.add("loaded"); //// 防止缓存的页面被自定义 PJAX 中覆写的处理响应的函数捕获
  476. waitForAnimationsEnd(
  477. document.querySelector(".markdown-body"),
  478. ".content, .old-content",
  479. ["Animation-slideInRight", "Animation-slideInLeft"],
  480. ).then(async () => {
  481. await showMarkdownEnded();
  482. customPushState(
  483. window.location.origin +
  484. window.location.pathname +
  485. (mdPath ? "?p=" + mdPath : ""),
  486. );
  487. });
  488. } catch (error) {
  489. handleError(mdPath ? mdPath : path, error);
  490. }
  491. };
  492. // 读取并解析指定文件
  493. const getMarkdown = async (mdPath, response = null) => {
  494. //// 生成目录
  495. function generateOutline(doc) {
  496. const headings = Array.from(
  497. doc.querySelectorAll("h1, h2, h3, h4, h5, h6"),
  498. );
  499. if (headings.length === 0) return "<i>无目录</i>";
  500. var outline = "<ul>";
  501. var stack = [];
  502. headings.forEach((heading) => {
  503. const level = parseInt(heading.tagName.charAt(1));
  504. const id = heading.textContent
  505. .toLowerCase()
  506. .replace(/ /g, "-") //// 将空格替换为连字符
  507. .replace(/[^\w\u4e00-\u9fa5-]/g, ""); //// 保留字母、数字、下划线、中文字符和连字符
  508. //// 设置 id 属性以便链接跳转
  509. heading.setAttribute("id", id);
  510. while (
  511. stack.length > 0 &&
  512. stack[stack.length - 1].level >= level
  513. ) {
  514. stack.pop();
  515. outline += "</ul></li>";
  516. }
  517. if (stack.length === 0 || stack[stack.length - 1].level < level) {
  518. outline += "<li><ul>";
  519. } else {
  520. outline += "</li><li>";
  521. }
  522. outline += `<a href="#${id}">${heading.textContent}</a>`;
  523. stack.push({ level: level });
  524. });
  525. while (stack.length > 0) {
  526. outline += "</ul></li>";
  527. stack.pop();
  528. }
  529. outline += "</ul>";
  530. return outline;
  531. }
  532. if (!response) {
  533. response = await fetch(mdPath);
  534. if (
  535. !response.ok &&
  536. response.headers.get("content-type").startsWith("text/markdown")
  537. ) {
  538. throw new Error(
  539. "请求失败:" +
  540. mdPath +
  541. "," +
  542. response.headers.get("content-type") +
  543. "," +
  544. response.status +
  545. "," +
  546. response.statusText,
  547. );
  548. }
  549. }
  550. var markdown_content = await response.text();
  551. var content = marked.parse(markdown_content);
  552. //// 因为是在本页面渲染一个其它页面的文档:
  553. //// - 从 content 中获取所有 href 以 .md 结尾的 a 标签;
  554. //// - 遍历这些 a 标签,如果 href 不是外链,则判断 href 是否为相对路径……最后转换为 ?p=<到该文件的绝对路径>
  555. //// - 从 content 中获取所有 img 标签;
  556. //// - 遍历这些 img 标签,如果 src 不是外链,则判断 src 是否为相对路径……最后转换为 <到该文件的绝对路径>
  557. const linkParser = new DOMParser();
  558. const linkDoc = linkParser.parseFromString(
  559. `<div>${content}</div>`,
  560. "text/html",
  561. );
  562. //// 处理所有 a 链接
  563. const mdLinks = linkDoc.querySelectorAll('a[href]:not([href=""])');
  564. mdLinks.forEach((link) => {
  565. const href = link.getAttribute("href");
  566. //// 是相对路径
  567. if (!isExternalLink(href) && isRelativePath(href) && isProtocol(href)) {
  568. var absolutePath = pValue
  569. ? getDirectory(mdPath) + href
  570. : getPath() + href;
  571. absolutePath = new URL(absolutePath, "http://example.com")
  572. .pathname;
  573. if (absolutePath.endsWith(".md")) {
  574. link.setAttribute("href", `?p=${absolutePath}`);
  575. } else {
  576. link.setAttribute("href", absolutePath);
  577. }
  578. }
  579. });
  580. //// 处理所有图片
  581. const images = linkDoc.querySelectorAll("img");
  582. images.forEach((img) => {
  583. const src = img.getAttribute("src");
  584. img.setAttribute("loading", "lazy");
  585. if (
  586. src &&
  587. !src.startsWith("data:") &&
  588. !isExternalLink(src) &&
  589. isRelativePath(src)
  590. ) {
  591. var absolutePath = pValue
  592. ? getDirectory(mdPath) + src
  593. : getPath() + src;
  594. absolutePath = new URL(absolutePath, "http://example.com")
  595. .pathname;
  596. img.setAttribute("src", absolutePath);
  597. }
  598. });
  599. //// 更新处理后的 markdown 内容
  600. content = linkDoc.body.innerHTML.replace(/^<div>|<\/div>$/g, "");
  601. //// 空文件
  602. if (content === "") {
  603. content = "<i>空文件</i>";
  604. }
  605. //// 添加目录
  606. content = `<details class="outline"><summary>${decodeURIComponent(
  607. mdPath,
  608. )}</summary></details><hr>${content}`;
  609. const parser = new DOMParser();
  610. const doc = parser.parseFromString(content, "text/html");
  611. const outline = generateOutline(doc);
  612. doc.querySelector(".outline").innerHTML += outline;
  613. return doc.body.innerHTML;
  614. };
  615. // 初始化自定义 PJAX 响应
  616. function initCustomPJAXResponse() {
  617. //// 覆写 PJAX 处理响应的函数,在内容插入页面之前实现 markdown 的渲染
  618. PJAX._handleResponse = PJAX.handleResponse;
  619. PJAX.handleResponse = async function (
  620. responseText,
  621. request,
  622. href,
  623. options,
  624. ) {
  625. if (
  626. /^<!doctype html>[\s\S]*?<html>[\s\S]*?<markdown-html/i.test(
  627. request.responseText,
  628. )
  629. ) {
  630. await showMarkdown(await decodeMDPath(href));
  631. } else {
  632. PJAX._handleResponse(responseText, request, href, options);
  633. }
  634. };
  635. }
  636. // 初始化自定义 PJAX 事件监听器
  637. function initCustomPJAXEventListener() {
  638. // 监听自定义链接的点击事件
  639. if (existPushState) {
  640. document
  641. .querySelector(".markdown-body")
  642. .addEventListener("click", async function (event) {
  643. const link = event.target.closest('a[href$=".md"]');
  644. if (link) {
  645. try {
  646. event.preventDefault();
  647. startLoad();
  648. await showMarkdown(await decodeMDPath(link.href));
  649. } catch (e) {
  650. console.error("自定义 PJAX 出错:" + e);
  651. }
  652. }
  653. });
  654. }
  655. }
  656. // 自定义推送状态
  657. function customPushState(url = window.location.href) {
  658. if (existPushState) {
  659. if (level > lastLevel) {
  660. history.pushState(
  661. { url: url, title: document.title, uid: level },
  662. null,
  663. url,
  664. );
  665. lastLevel = level++;
  666. } else {
  667. lastLevel = level - 1;
  668. }
  669. }
  670. }
  671. // 初始化内容
  672. const initContent = async () => {
  673. try {
  674. await showMarkdown(await getPValue());
  675. } catch (error) {
  676. handleError(await getPValue(), "初始化内容时出错:" + error);
  677. }
  678. };
  679. // 初始化返回首页按钮
  680. function initHomeBtn() {
  681. const homeBtn = document.querySelector(".to-home");
  682. homeBtn.href = window.location.pathname;
  683. }
  684. // 初始化返回首页按钮
  685. function initAboutBtn() {
  686. const aboutBtn = document.querySelector(".about-btn");
  687. aboutBtn.href = `?p=${getDirectory(
  688. window.location.pathname,
  689. )}about.md`;
  690. }
  691. // 初始化
  692. function initialize() {
  693. startLoad(); //// 开始加载动画
  694. initDarkmode(); //// 初始化深色模式
  695. initHomeBtn(); //// 初始化返回首页按钮
  696. initAboutBtn(); //// 初始化关于按钮
  697. initContent(); //// 初始化内容
  698. initTranslate(); //// 初始化页面翻译
  699. initPJAX(); //// 初始化 PJAX
  700. initCustomPJAXResponse(); //// 初始化自定义 PJAX 响应
  701. initCustomPJAXEventListener(); //// 初始化自定义 PJAX 事件监听器
  702. // loadCSS(
  703. // "https://chinese-fonts-cdn.deno.dev/packages/maple-mono-cn/dist/MapleMono-CN-Regular/result.css"
  704. // ); //// 加载字体 CSS,会造成渲染阻塞,暂时禁用
  705. endLoad(); //// 结束加载动画
  706. }
  707. // 触发器
  708. //// 网页加载完毕后触发初始化
  709. window.addEventListener("DOMContentLoaded", () => initialize());
  710. //// 翻译执行完成后触发
  711. translate.listener.renderTaskFinish = function (_task) {
  712. endLoad();
  713. };
  714. //// PJAX 开始时执行的函数
  715. document.addEventListener("pjax:send", function () {
  716. startLoad();
  717. });
  718. //// 监听 PJAX 完成后,重新加载
  719. document.addEventListener("pjax:complete", async function () {
  720. await showMarkdown(await getPValue());
  721. initCustomPJAXEventListener(); //// 重新初始化自定义 PJAX 事件监听器
  722. });
  723. //// 监听 animationend 事件
  724. document.addEventListener(
  725. "animationend",
  726. function handleAnimationEnd(event) {
  727. if (event.animationName === "Animation-slideInRight") {
  728. const element = document.querySelector(".markdown-body .content");
  729. element.classList.remove("Animated");
  730. element.classList.remove("Animate--slideInRight");
  731. } else if (event.animationName === "Animation-slideInLeft") {
  732. document.querySelector(".markdown-body .old-content").remove();
  733. }
  734. },
  735. );
  736. //// 点击事件委托
  737. document.addEventListener("click", function (event) {
  738. const imgOrSvg = event.target.closest(".content img, .content svg");
  739. if (imgOrSvg) {
  740. const url =
  741. imgOrSvg.getAttribute("src") ||
  742. imgOrSvg.getAttribute("xlink:href");
  743. if (url) {
  744. window.open(url, "_blank");
  745. event.preventDefault();
  746. } else {
  747. const newWindow = window.open("", "_blank");
  748. newWindow.document.write(imgOrSvg.outerHTML);
  749. newWindow.document.close();
  750. event.preventDefault();
  751. }
  752. return;
  753. }
  754. if (event.target.closest(".back-btn")) {
  755. window.history.back();
  756. } else if (event.target.closest(".refresh-btn")) {
  757. window.location.reload();
  758. } else if (event.target.closest(".dark-btn")) {
  759. darkmode.toggle();
  760. } else if (event.target.closest(".translate-switch")) {
  761. translate.changeLanguage(translate.language.getLocal());
  762. /* 跳转。禁用原因是有些带有特殊字符的链接会出错或无法跳转
  763. } else if (event.target.closest('.content a[href^="#"]')) {
  764. // 目录平滑移动
  765. const href = event.target.getAttribute('href');
  766. if (href !== '#') {
  767. event.preventDefault();
  768. const targetElement = document.querySelector(href);
  769. if (targetElement) {
  770. targetElement.scrollIntoView({
  771. behavior: 'smooth'
  772. });
  773. } else {
  774. console.error(`ID 为 ${targetId} 的元素不存在。`);
  775. }
  776. }
  777. */
  778. } else if (event.target.closest('.content a[href]:not([href=""])')) {
  779. const href = event.target.getAttribute("href");
  780. if (isExternalLink(href)) {
  781. window.open(href, "_blank");
  782. event.preventDefault();
  783. }
  784. } else if (event.target.closest(".content img, .content svg")) {
  785. const url =
  786. event.target.getAttribute("src") ||
  787. event.target.getAttribute("xlink:href");
  788. if (url) {
  789. window.open(url, "_blank");
  790. event.preventDefault();
  791. } else {
  792. const newWindow = window.open("", "_blank");
  793. newWindow.document.write(imgOrSvg.outerHTML);
  794. newWindow.document.close();
  795. event.preventDefault();
  796. }
  797. }
  798. });
  799. //// 文档内容加载完毕时触发
  800. async function showMarkdownEnded() {
  801. refreshTranslate();
  802. infoTranslate(); //// 检查并提示翻译
  803. await mermaid.init({ noteMargin: 10 }, ".language-mermaid"); //// 初始化 mermaid
  804. translate.execute(); //// 手动触发翻译,但是理论上 translate-js 会监听页面变化
  805. hljs.highlightAll(); //// 触发代码块语法高亮
  806. endLoad();
  807. window.scrollTo({
  808. top: 0,
  809. behavior: "smooth",
  810. });
  811. }
  812. //// 浏览器返回时触发
  813. window.onpopstate = function (event) {
  814. if (level > 1) {
  815. --level;
  816. }
  817. };
  818. })();
  819. </script>
  820. <title>加载中</title>
  821. <style>
  822. /* 全局 */
  823. :root,
  824. html,
  825. body,
  826. button,
  827. input,
  828. select,
  829. textarea,
  830. code,
  831. pre {
  832. font-family:
  833. "Sarasa Term SC Nerd", "Maple Mono CN", Ubuntu, Roboto, "Open Sans",
  834. "Microsoft YaHei", Arial, sans-serif;
  835. text-decoration: none;
  836. }
  837. :root,
  838. html,
  839. body {
  840. background-color: #e6e6e6;
  841. }
  842. ::selection {
  843. background-color: #dcedc8;
  844. }
  845. body {
  846. margin: 0;
  847. }
  848. a {
  849. color: #66bb6a;
  850. cursor: pointer;
  851. text-decoration: none;
  852. }
  853. a:hover {
  854. color: #2e7d32;
  855. }
  856. /* 背景 */
  857. .background {
  858. position: fixed;
  859. left: 0;
  860. top: 0;
  861. height: 100%;
  862. width: 100%;
  863. z-index: -1;
  864. background-color: #e6e6e6;
  865. }
  866. /* 导航栏 */
  867. nav {
  868. position: fixed;
  869. top: 0;
  870. right: 0;
  871. width: min-content;
  872. background-color: #616161;
  873. display: flex;
  874. justify-content: space-between;
  875. align-items: center;
  876. z-index: 1;
  877. }
  878. nav a {
  879. color: #fafafa;
  880. padding: 0.3rem;
  881. transition:
  882. color 0.2s,
  883. background-color 0.2s;
  884. }
  885. nav a:hover {
  886. color: #fff;
  887. background-color: #212121;
  888. }
  889. /* 动画 */
  890. .Animated {
  891. animation-fill-mode: both;
  892. animation-duration: 1s;
  893. }
  894. .Animated-remove {
  895. position: absolute;
  896. }
  897. .Animated--reverse {
  898. animation-direction: reverse;
  899. }
  900. .Animate--fast {
  901. animation-duration: 0.5s;
  902. }
  903. .Animate--noDelay {
  904. animation-delay: 0s !important;
  905. }
  906. .Animate--slideInRight {
  907. animation-name: Animation-slideInRight;
  908. }
  909. @keyframes Animation-slideInRight {
  910. 0% {
  911. transform: translateX(200%);
  912. }
  913. 100% {
  914. transform: translateX(0);
  915. }
  916. }
  917. .Animate--slideInLeft {
  918. animation-name: Animation-slideInLeft;
  919. }
  920. @keyframes Animation-slideInLeft {
  921. 0% {
  922. transform: translateX(-100%);
  923. }
  924. 100% {
  925. transform: translateX(0);
  926. }
  927. }
  928. /* 主要内容 */
  929. .markdown-body {
  930. position: relative;
  931. margin: 3rem auto;
  932. width: 100%;
  933. max-width: 950px;
  934. min-height: 300px;
  935. background-color: #fafafa;
  936. color: #212121;
  937. box-sizing: border-box;
  938. overflow-x: hidden;
  939. box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
  940. }
  941. .markdown-body .content,
  942. .markdown-body .old-content {
  943. margin: 2rem;
  944. }
  945. .markdown-body img,
  946. .markdown-body video,
  947. .markdown-body iframe,
  948. .markdown-body object,
  949. .markdown-body embed,
  950. .markdown-body svg,
  951. .markdown-body canvas,
  952. .markdown-body audio {
  953. max-width: 100%;
  954. background-color: rgba(0, 0, 0, 0.05);
  955. }
  956. /* Markdown 样式 */
  957. .markdown-body a {
  958. transition:
  959. color 0.2s,
  960. background-color 0.2s;
  961. }
  962. .markdown-body a:hover {
  963. background-color: rgba(255, 255, 255, 0.1);
  964. }
  965. .markdown-body ul,
  966. .markdown-body ol {
  967. padding-left: 2rem;
  968. }
  969. .markdown-body pre {
  970. background-color: rgba(0, 0, 0, 0.05);
  971. padding: 0.4rem;
  972. border-radius: 0.1rem;
  973. overflow-y: scroll;
  974. }
  975. .markdown-body code {
  976. font-family: "cousine nerd font mono", monospace;
  977. background-color: rgba(0, 0, 0, 0.05);
  978. font-size: small;
  979. padding: 0.2rem;
  980. border-radius: 0.1rem;
  981. }
  982. .markdown-body pre code {
  983. background-color: unset;
  984. font-size: unset;
  985. padding: unset;
  986. border-radius: unset;
  987. }
  988. .markdown-body blockquote {
  989. background-color: rgba(0, 0, 0, 0.05);
  990. font-size: small;
  991. padding: 0.4rem;
  992. margin: 0.5rem 2rem;
  993. border-left: 5px solid rgba(0, 0, 0, 0.1);
  994. }
  995. .markdown-body details {
  996. border: 1px solid rgba(0, 0, 0, 0.1);
  997. border-radius: 0.1rem;
  998. }
  999. .markdown-body summary {
  1000. font-size: small;
  1001. cursor: pointer;
  1002. background-color: rgba(0, 0, 0, 0.05);
  1003. padding: 0.4rem;
  1004. font-weight: bold;
  1005. }
  1006. .markdown-body details a {
  1007. margin-left: -2rem;
  1008. }
  1009. .markdown-body table {
  1010. border-spacing: 0;
  1011. border-radius: 0.1rem;
  1012. width: 100%;
  1013. border-collapse: separate;
  1014. border: 0.1rem solid rgba(0, 0, 0, 0.05);
  1015. }
  1016. .markdown-body table > * {
  1017. overflow-y: scroll;
  1018. }
  1019. .markdown-body table td,
  1020. .markdown-body table th {
  1021. border-right: 0.1rem solid rgba(0, 0, 0, 0.05);
  1022. border-top: 0.1rem solid rgba(0, 0, 0, 0.05);
  1023. padding: 0.4rem;
  1024. }
  1025. .markdown-body table td:last-child,
  1026. .markdown-body th:last-child {
  1027. border-right-color: transparent;
  1028. }
  1029. .markdown-body table thead tr:first-child > * {
  1030. border-top: 0.1rem solid transparent;
  1031. }
  1032. /* 加载进度条 */
  1033. .loading-bar {
  1034. position: fixed;
  1035. top: 0;
  1036. left: 0;
  1037. z-index: 2;
  1038. opacity: 0;
  1039. transition: opacity 0.4s linear;
  1040. .progress {
  1041. position: fixed;
  1042. top: 0;
  1043. left: 0;
  1044. width: 0;
  1045. height: 4px;
  1046. background-color: #2e7d32;
  1047. box-shadow: 0 0 10px rgba(102, 187, 106, 0.7);
  1048. }
  1049. &.loading {
  1050. opacity: 1;
  1051. transition: none;
  1052. .progress {
  1053. transition: width 0.4s ease;
  1054. }
  1055. }
  1056. }
  1057. /* 翻译按钮相关 */
  1058. .translateSelectLanguage {
  1059. background-color: #616161;
  1060. color: inherit;
  1061. z-index: 3;
  1062. width: 17%;
  1063. height: 100%;
  1064. opacity: 0;
  1065. cursor: pointer;
  1066. position: absolute;
  1067. top: 0;
  1068. left: 50%;
  1069. }
  1070. /* 深色模式相关 */
  1071. /* 防止背景图片、svg、canvas 和视频等混色 */
  1072. .darkmode--activated .markdown-body img,
  1073. .darkmode--activated .markdown-body svg,
  1074. .darkmode--activated .markdown-body canvas,
  1075. .darkmode--activated .markdown-body video {
  1076. isolation: isolate;
  1077. mix-blend-mode: difference;
  1078. }
  1079. .darkmode-layer,
  1080. .darkmode-toggle {
  1081. z-index: 3;
  1082. }
  1083. /* 小屏响应式优化 */
  1084. @media only screen and (max-width: 950px) {
  1085. :root,
  1086. html,
  1087. body {
  1088. background-color: #616161;
  1089. }
  1090. :root,
  1091. html,
  1092. body,
  1093. .markdown-body {
  1094. height: 100%;
  1095. }
  1096. nav {
  1097. position: relative;
  1098. margin-left: auto;
  1099. }
  1100. .markdown-body {
  1101. overflow-y: scroll;
  1102. min-width: 256px;
  1103. top: 0;
  1104. margin: 0 0;
  1105. }
  1106. }
  1107. </style>
  1108. <link
  1109. href="https://lib.baomitu.com/highlight.js/11.4.0/styles/default.min.css"
  1110. type="text/css"
  1111. rel="stylesheet"
  1112. />
  1113. </head>
  1114. <body>
  1115. <!-- 导航栏 -->
  1116. <nav>
  1117. <a title="返回" class="back-btn">
  1118. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1119. <svg
  1120. xmlns="http://www.w3.org/2000/svg"
  1121. width="24"
  1122. height="24"
  1123. viewBox="0 0 24 24"
  1124. fill="none"
  1125. stroke="currentColor"
  1126. stroke-width="2"
  1127. stroke-linecap="round"
  1128. stroke-linejoin="round"
  1129. class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-back"
  1130. >
  1131. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1132. <path d="M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1" />
  1133. </svg>
  1134. </a>
  1135. <a title="刷新" class="refresh-btn" href="">
  1136. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1137. <svg
  1138. xmlns="http://www.w3.org/2000/svg"
  1139. width="24"
  1140. height="24"
  1141. viewBox="0 0 24 24"
  1142. fill="none"
  1143. stroke="currentColor"
  1144. stroke-width="2"
  1145. stroke-linecap="round"
  1146. stroke-linejoin="round"
  1147. class="icon icon-tabler icons-tabler-outline icon-tabler-refresh"
  1148. >
  1149. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1150. <path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" />
  1151. <path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" />
  1152. </svg>
  1153. </a>
  1154. <a title="主页" class="to-home">
  1155. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1156. <svg
  1157. xmlns="http://www.w3.org/2000/svg"
  1158. width="24"
  1159. height="24"
  1160. viewBox="0 0 24 24"
  1161. fill="none"
  1162. stroke="currentColor"
  1163. stroke-width="2"
  1164. stroke-linecap="round"
  1165. stroke-linejoin="round"
  1166. class="icon icon-tabler icons-tabler-outline icon-tabler-home"
  1167. >
  1168. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1169. <path d="M5 12l-2 0l9 -9l9 9l-2 0" />
  1170. <path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" />
  1171. <path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" />
  1172. </svg>
  1173. </a>
  1174. <a title="更改语言" id="translate">
  1175. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1176. <svg
  1177. xmlns="http://www.w3.org/2000/svg"
  1178. width="24"
  1179. height="24"
  1180. viewBox="0 0 24 24"
  1181. fill="none"
  1182. stroke="currentColor"
  1183. stroke-width="2"
  1184. stroke-linecap="round"
  1185. stroke-linejoin="round"
  1186. class="icon icon-tabler icons-tabler-outline icon-tabler-language"
  1187. >
  1188. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1189. <path d="M4 5h7" />
  1190. <path d="M9 3v2c0 4.418 -2.239 8 -5 8" />
  1191. <path d="M5 9c0 2.144 2.952 3.908 6.7 4" />
  1192. <path d="M12 20l4 -9l4 9" />
  1193. <path d="M19.1 18h-6.2" />
  1194. </svg>
  1195. </a>
  1196. <a title="切换显示模式" class="dark-btn" href="javascript:;">
  1197. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1198. <svg
  1199. xmlns="http://www.w3.org/2000/svg"
  1200. width="24"
  1201. height="24"
  1202. viewBox="0 0 24 24"
  1203. fill="none"
  1204. stroke="currentColor"
  1205. stroke-width="2"
  1206. stroke-linecap="round"
  1207. stroke-linejoin="round"
  1208. class="icon icon-tabler icons-tabler-outline icon-tabler-brightness"
  1209. >
  1210. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1211. <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
  1212. <path d="M12 3l0 18" />
  1213. <path d="M12 9l4.65 -4.65" />
  1214. <path d="M12 14.3l7.37 -7.37" />
  1215. <path d="M12 19.6l8.85 -8.85" />
  1216. </svg>
  1217. </a>
  1218. <a title="关于" class="about-btn">
  1219. <license content="Copyright (c) 2018-2025 Tabler"></license>
  1220. <svg
  1221. xmlns="http://www.w3.org/2000/svg"
  1222. width="24"
  1223. height="24"
  1224. viewBox="0 0 24 24"
  1225. fill="none"
  1226. stroke="currentColor"
  1227. stroke-width="2"
  1228. stroke-linecap="round"
  1229. stroke-linejoin="round"
  1230. class="icon icon-tabler icons-tabler-outline icon-tabler-info-circle"
  1231. >
  1232. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  1233. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  1234. <path d="M12 9h.01" />
  1235. <path d="M11 12h1v4h1" />
  1236. </svg>
  1237. </a>
  1238. </nav>
  1239. <!-- 内容主体 -->
  1240. <div class="markdown-body">
  1241. <div class="content">
  1242. <h1>加载中……</h1>
  1243. <p>请稍等。</p>
  1244. </div>
  1245. </div>
  1246. <!-- 加载动画 -->
  1247. <div class="loading-bar">
  1248. <div class="progress"></div>
  1249. </div>
  1250. <div class="background"></div>
  1251. <script
  1252. src="https://lib.baomitu.com/instant.page/5.1.0/instantpage.min.js"
  1253. type="text/javascript"
  1254. ></script>
  1255. </body>
  1256. </html>