1
0

index.html 44 KB

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