static.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html lang="zh-cmn-Hans">
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  7. <meta name="theme-color" content="#f1f7fe">
  8. <meta name="apple-mobile-web-app-capable" content="yes">
  9. <meta name="mobile-web-app-capable" content="yes"/>
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <title>Vditor - A markdown editor written in TypeScript.</title>
  12. <meta name="description"
  13. content="B3log 开源社区 markdown 编辑器,使用 TypeScript 编写。支持在线预览、表情插入、at 用户提示、HTML 转换等必要功能。"/>
  14. <meta property="og:description"
  15. content="B3log 开源社区 markdown 编辑器,使用 TypeScript 编写。支持在线预览、表情插入、at 用户提示、HTML 转换等必要功能。"/>
  16. <meta name="twitter:description" property="og:description" itemprop="description"
  17. content="B3log 开源社区 markdown 编辑器,使用 TypeScript 编写。支持在线预览、表情插入、at 用户提示、HTML 转换等必要功能。"/>
  18. <link rel="dns-prefetch" href="//cdn.jsdelivr.net/"/>
  19. <link rel="preconnect" href="https://cdn.jsdelivr.net">
  20. <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/vditor/dist/images/logo.png"/>
  21. <link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/vditor/dist/images/logo.png">
  22. <link rel="shortcut icon" type="image/x-icon" href="https://cdn.jsdelivr.net/npm/vditor/dist/images/logo.png">
  23. <meta name="copyright" content="B3log"/>
  24. <meta http-equiv="Window-target" content="_top"/>
  25. <meta property="og:locale" content="zh-cmn-Hans"/>
  26. <meta property="og:title" content="Vditor - A markdown editor written in TypeScript."/>
  27. <meta property="og:site_name" content="Blog-vditor"/>
  28. <meta property="og:url" content="https://hacpai.com/tag/vditor"/>
  29. <meta name="twitter:card" content="summary"/>
  30. <meta name="twitter:domain" content="b3log.org"/>
  31. <meta name="twitter:title" property="og:title" itemprop="b3lig vditor"
  32. content="Vditor - A markdown editor written in TypeScript."/>
  33. <meta name="twitter:site" content="@B3logOS"/>
  34. <meta name="twitter:url" content="https://hacpai.com/tag/vditor"/>
  35. <meta property="og:image" content="https://cdn.jsdelivr.net/npm/vditor/dist/images/logo.png"/>
  36. <meta name="twitter:image" content="https://cdn.jsdelivr.net/npm/vditor/dist/images/logo.png"/>
  37. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.css"/>
  38. <script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
  39. </head>
  40. <body>
  41. <h2><a href="https://hacpai.com/article/1549638745630?r=Vanessa" target="_blank">Doc</a></h2>
  42. <h2>
  43. Vditor for preview
  44. <a href="static-preview.html?lang=zh_CN">中文</a>
  45. <a href="static-preview.html?lang=ko_KR">한글</a>
  46. </h2>
  47. <h2>
  48. Vditor for you
  49. <button onclick="vditor.setTheme('dark')">Dark</button>
  50. <button onclick="vditor.setTheme('light')">Light</button>
  51. </h2>
  52. <div id="vditor">
  53. <h1>Vditor</h1>
  54. <ul>
  55. <li>foo</li>
  56. <li>bar</li>
  57. </ul>
  58. </div>
  59. <script>
  60. const vditor = new Vditor('vditor', {
  61. debugger: true,
  62. typewriterMode: true,
  63. placeholder: 'placeholder',
  64. counter: 100,
  65. height: 500,
  66. hint: {
  67. emojiPath: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/images/emoji',
  68. emojiTail: '<a href="https://hacpai.com/settings/function" target="_blank">设置常用表情</a>',
  69. emoji: {
  70. 'sd': '💔',
  71. 'j': 'https://unpkg.com/[email protected]/dist/images/emoji/j.png',
  72. },
  73. },
  74. tab: '\t',
  75. upload: {
  76. accept: 'image/*,.mp3, .wav, .rar',
  77. token: 'test',
  78. url: '/api/upload/editor',
  79. linkToImgUrl: '/api/upload/fetch',
  80. filename (name) {
  81. return name.replace(/[^(a-zA-Z0-9\u4e00-\u9fa5\.)]/g, '').
  82. replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g, '').
  83. replace('/\\s/g', '')
  84. },
  85. },
  86. })
  87. </script>
  88. </body>
  89. </html>