├── .gitignore ├── LICENSE ├── README.md └── src ├── brand-marking.html ├── css └── base.css ├── error └── 404.html ├── favicon.ico ├── images ├── ajax-loader.gif ├── brand │ ├── b3log-128.png │ ├── b3log-32.png │ ├── b3log-460.png │ ├── b3log-512.png │ ├── b3log.png │ ├── chainbook-128.png │ ├── chainbook-32.png │ ├── chainbook-512.png │ ├── hacpai-128.png │ ├── hacpai-32.png │ ├── hacpai-512.png │ ├── latke-128.png │ ├── latke-32.png │ ├── latke-512.png │ ├── lute-128.png │ ├── lute-32.png │ ├── lute-512.png │ ├── pipe-128.png │ ├── pipe-32.png │ ├── pipe-512.png │ ├── siyuan-128.png │ ├── siyuan-32.png │ ├── siyuan-512.png │ ├── solo-128.png │ ├── solo-32.png │ ├── solo-512.png │ ├── sym-128.png │ ├── sym-32.png │ ├── sym-512.png │ ├── vditor-128.png │ ├── vditor-32.png │ ├── vditor-512.png │ ├── wide-128.png │ ├── wide-32.png │ └── wide-512.png ├── timeline │ ├── 030.jpg │ ├── 20110904.jpg │ ├── 20120304.png │ ├── 20130426.jpg │ ├── 20130817.jpg │ ├── 20140601.jpeg │ ├── 20141224.png │ ├── 20150301.jpg │ ├── 20151002.jpg │ ├── 20161019.jpg │ ├── 20161226.jpg │ ├── 20170123.png │ ├── 20170831.png │ ├── 20171228.png │ ├── 20180121.jpg │ ├── 20181024.png │ ├── 20181122.gif │ ├── 20190618.png │ ├── 20191214.jpg │ ├── 20201212.jpg │ ├── API.jpg │ ├── DASHU.jpg │ ├── GitOpen.png │ ├── daniel.jpg │ ├── dx.jpg │ ├── getstarted.jpg │ ├── hp.png │ ├── jboat.jpg │ ├── lamb.png │ ├── lol.png │ ├── ly.jpg │ ├── mainlove.png │ ├── move-github.png │ ├── one_key_start.jpg │ ├── qiniu.jpg │ ├── question.png │ ├── skiner.jpg │ ├── v041.png │ ├── v20120219.jpg │ ├── vanessa.jpg │ └── wide.png └── version │ ├── v1.0.png │ ├── v2.0.png │ ├── v3.0.png │ └── v4.0.png ├── index.html ├── js ├── common.js ├── index-timeline.json └── lib │ ├── TimelineJS │ ├── icons │ │ ├── tl-icons.eot │ │ ├── tl-icons.svg │ │ ├── tl-icons.ttf │ │ └── tl-icons.woff │ ├── locale │ │ └── zh-cn.json │ ├── timeline-min.js │ └── timeline.css │ ├── fancybox │ ├── blank.gif │ ├── fancybox_loading.gif │ ├── fancybox_overlay.png │ ├── fancybox_sprite.png │ ├── jquery.fancybox.css │ └── jquery.fancybox.pack.js │ ├── jquery-v3.5.1.min.js │ └── jquery.min.js ├── kill-browser.html ├── siyuan ├── dist │ ├── community.html │ ├── distributors │ │ └── lizhi.html │ ├── download.html │ ├── en │ │ ├── community.html │ │ ├── download.html │ │ ├── eula.html │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── pricing.html │ │ └── privacy.html │ ├── eula.html │ ├── favicon.ico │ ├── index.html │ ├── pricing.html │ └── privacy.html ├── package-lock.json ├── package.json ├── pnpm-lock.yaml ├── src │ ├── community.pug │ ├── distributors │ │ └── lizhi.pug │ ├── download.pug │ ├── en │ │ ├── community.pug │ │ ├── download.pug │ │ ├── eula.pug │ │ ├── index.pug │ │ ├── pricing.pug │ │ └── privacy.pug │ ├── eula.pug │ ├── index.pug │ ├── layout │ │ ├── footer-en.pug │ │ ├── footer.pug │ │ ├── head-en.pug │ │ ├── head.pug │ │ ├── header-en.pug │ │ ├── header.pug │ │ ├── layout.pug │ │ └── script.pug │ ├── pricing.pug │ └── privacy.pug ├── static │ ├── base.css │ ├── distributors-lizhi.png │ ├── feature0.png │ ├── feature1-1.png │ ├── feature1-2.png │ ├── feature1-3.png │ ├── feature1-4.png │ ├── feature2-1.svg │ ├── feature2-2.png │ ├── feature2-3.png │ ├── feature2-4.png │ ├── feature2-5.png │ ├── feature3-1.png │ ├── feature3-2.png │ ├── feature3-3.png │ ├── feature4-1.png │ ├── feature4-2.png │ ├── feature4-3.png │ ├── feature5-1.svg │ ├── feature5-2.svg │ ├── feature5-3.svg │ ├── home-backup.svg │ ├── home-backup2.svg │ ├── home-img.png │ ├── home-img.svg │ ├── home-img2.svg │ ├── home.svg │ ├── icon-check.svg │ ├── icon-info.svg │ ├── icon-x.svg │ ├── img-bg.svg │ ├── img-bg2.svg │ ├── img-bg3.svg │ ├── img-bg4.svg │ ├── index.js │ ├── logo-android.png │ ├── logo-chromium.png │ ├── logo-discord.png │ ├── logo-docker.png │ ├── logo-github.png │ ├── logo-ios.png │ ├── logo-linux.png │ ├── logo-macOS.png │ ├── logo-mobile.png │ ├── logo-qq.png │ ├── logo-twitter.png │ ├── logo-weibo.png │ ├── logo-windows.png │ ├── logo.svg │ └── logo_.png └── webpack.config.js ├── solo ├── favicon.ico ├── images │ └── themes │ │ ├── 5styles.jpg │ │ ├── 9IPHP.jpg │ │ ├── Bubble.jpg │ │ ├── Casper.jpg │ │ ├── Jane.jpg │ │ ├── Pinghsu.jpg │ │ ├── amaze.jpg │ │ ├── andrea.jpg │ │ ├── bootstyle.jpg │ │ ├── bruce.jpg │ │ ├── coda.jpg │ │ ├── community-bubbles.png │ │ ├── community.jpg │ │ ├── dashu03.jpg │ │ ├── dot-b.jpg │ │ ├── favourite.jpg │ │ ├── finding.jpg │ │ ├── i-nove.jpg │ │ ├── iMobile.jpg │ │ ├── idream.jpg │ │ ├── medium.png │ │ ├── metro-hot.jpg │ │ ├── neoease.jpg │ │ ├── next.jpg │ │ ├── nijigen.jpg │ │ ├── owmx-3.0.jpg │ │ ├── posart.jpg │ │ ├── shawn.jpg │ │ ├── solo-aragaki.jpg │ │ ├── solo-nexmoe.jpg │ │ ├── solo-star.jpg │ │ ├── timeline.jpg │ │ ├── tree-house.jpg │ │ └── yilia.jpg ├── index.html └── solo.js ├── sym ├── customers.html ├── favicon.ico ├── images │ ├── 3-1.png │ ├── 3-2.png │ ├── 3-3.png │ ├── 3-4.png │ ├── 3-5.png │ ├── bg1.jpg │ ├── bg2.png │ ├── bg3.png │ ├── bg4.png │ ├── com-dzjg.png │ ├── com-gdkj.png │ ├── com-heqijuli.png │ ├── com-hfyrtx.jpg │ ├── com-huiju.png │ ├── com-jindie.gif │ ├── com-kd100.png │ ├── com-pakj.jpg │ ├── com-puyuan.png │ ├── com-szbb.png │ ├── com-szslzhkj.jpg │ ├── com-szwtkjcx.png │ ├── com-ttxn.png │ ├── com-wlt.png │ ├── com-yidong.jpg │ ├── com-yiming.png │ ├── com-yn.png │ ├── com-youfu.png │ ├── com-youzang.png │ ├── com-zh.png │ ├── com-zogjscy.png │ ├── com-zqdl.jpg │ ├── screen-aiq.png │ ├── screen-hacpai.png │ ├── screen-huiju.png │ ├── screen-jieshibang.png │ ├── screen-kuaike.png │ ├── screen-pra.png │ ├── screen-raqsoft.png │ ├── screen-wozx.png │ ├── theme-hacpai-dark.png │ ├── theme-hacpai.png │ ├── theme-mobile-dark.png │ ├── theme-mobile.png │ ├── theme-v2ex-dark.png │ ├── theme-v2ex.png │ ├── theme-zhihu-dark.png │ └── theme-zhihu.png ├── index.html ├── js │ ├── circleMagic.js │ └── sym.js ├── pricing.html └── syme-intro.pptx └── vditor ├── demo ├── advanced-cache.html ├── advanced-comment.html ├── advanced-counter.html ├── advanced-hint.html ├── advanced-hljs.html ├── advanced-markdown.html ├── advanced-math.html ├── advanced-outline.html ├── advanced-preview-actions.html ├── advanced-preview.html ├── advanced-resize.html ├── advanced-toolbar.html ├── advanced-upload.html ├── angular.html ├── index.html ├── markdown │ └── zh_CN.md ├── method-CRUD.html ├── method-get.html ├── method-other.html ├── method-theme.html ├── option-callback.html ├── option-icon.html ├── option-lang.html ├── option-mode.html ├── option-other.html ├── option-size.html ├── preview-config.html ├── preview-custom.html ├── preview-render.html ├── preview.html ├── react.html ├── sweet-mobile.html ├── sweet-two.html └── vue.html ├── favicon.ico ├── images ├── editor.png ├── ir.gif ├── preview.png ├── sv.gif └── wysiwyg.gif ├── index.html └── vditor.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | index.iml 3 | src/siyuan/node_modules/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | * [B3log](https://b3log.org) 2 | * [Sym](https://b3log.org/sym) 3 | * [Solo](https://b3log.org/solo) 4 | * [Vditor](https://b3log.org/vditor) 5 | * [思源笔记](https://b3log.org/siyuan) 6 | -------------------------------------------------------------------------------- /src/error/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |new Vditor('vditor', {
72 | height: 360
73 | })
74 |
75 | new Vditor('vditor', {
69 | height: 360
70 | })
71 |
72 | new Vditor('vditor', { mode: 'sv', height: 360 });
77 |
78 | new Vditor('vditor', {
80 | height: 360
81 | })
82 |
83 | 1.创建项目并添加vditor
库
$ ng new PROJECT_NAME
67 | $ cd PROJECT_NAME
68 | $ npm install vditor --save
69 |
70 | 2.在angular.json
添加vditor
样式表
{
72 | ...
73 | "styles":[
74 | ...,
75 | "node_modules/vditor/src/assets/less/index.less"
76 | ]
77 | }
78 |
79 | 3.在app.component.html
中添加代码
<div id="vditor"></div>
81 |
82 | 4.在 app.component.ts
中添加代码
import {Component, OnInit} from '@angular/core';
84 | import Vditor from 'vditor';
85 |
86 | @Component({
87 | selector: 'app-root',
88 | templateUrl: './app.component.html',
89 | })
90 |
91 | export class AppComponent implements OnInit{
92 | vditor: Vditor;
93 |
94 | ngOnInit(): void {
95 | this.vditor = new Vditor('vditor', {
96 | height: 360,
97 | toolbarConfig: {
98 | pin: true,
99 | },
100 | cache: {
101 | enable: false,
102 | },
103 | after: () => {
104 | this.vditor.setValue('Hello, Vditor + Angular!');
105 | }
106 | });
107 | }
108 | }
109 |
110 |
111 | new Vditor('vditor', {
74 | mode: 'sv',
75 | cache: {
76 | enable: false
77 | },
78 | height: 360,
79 | value: '所见即所得模式对不熟悉 Markdown 的用户较为友好,熟悉 Markdown 的话也可以无缝使用。'
80 | })
81 |
82 | new Vditor('vditor', {
84 | typewriterMode: true,
85 | height: 360,
86 | })
87 |
88 | new Vditor('vditor', {
76 | height: 360,
77 | cache: {
78 | enable: false,
79 | },
80 | value: '可选图标:ant, material',
81 | })
82 |
83 | new Vditor('vditor', {
72 | height: 360,
73 | lang: 'zh_CN'
74 | })
75 |
76 | new Vditor('vditor', {
83 | cache: {
84 | enable: false,
85 | },
86 | value: '可选模式:sv, ir, wysiwyg',
87 | })
88 |
89 | new Vditor('vditor')
76 |
77 | new Vditor('vditor', {
65 | toolbarConfig: {
66 | pin: true
67 | },
68 | counter: {
69 | enable: true
70 | },
71 | height: window.innerHeight / 2,
72 | toolbar: [
73 | 'emoji',
74 | 'link',
75 | 'upload',
76 | 'edit-mode',
77 | {
78 | name: 'more',
79 | toolbar: [
80 | 'insert-after',
81 | 'fullscreen',
82 | 'preview',
83 | 'info',
84 | 'help',
85 | ],
86 | },
87 | ],
88 | })
89 |
90 | new Vditor('vditor', {
65 | toolbarConfig: {
66 | pin: true,
67 | },
68 | height: 360,
69 | counter: {
70 | enable: true,
71 | max: 1024,
72 | },
73 | })
74 |
75 | new Vditor('vditor2', {
76 | height: 200,
77 | counter: {
78 | enable: true,
79 | max: 512,
80 | },
81 | })
82 |
83 | new Vue({
66 | el: '#app',
67 | data: {
68 | contentEditor: '',
69 | },
70 | mounted () {
71 | this.contentEditor = new Vditor('vditor', {
72 | height: 360,
73 | toolbarConfig: {
74 | pin: true,
75 | },
76 | cache: {
77 | enable: false,
78 | },
79 | after: () => {
80 | this.contentEditor.setValue('hello, Vditor + Vue!')
81 | },
82 | })
83 | },
84 | })
85 |
86 | ${code}
32 |
`
33 | Vditor.highlightRender({lineNumber: true, enable: true}, demoCodeElement, "https://cdn.jsdelivr.net/npm/vditor")
34 | Vditor.codeRender(demoCodeElement)
35 | }
36 |
37 | const autoType = () => {
38 | const typeElement = document.getElementById('autoType')
39 | if (!typeElement) {
40 | return
41 | }
42 | const texts = [
43 | '实现 CommonMark 和 GFM 规范',
44 | '支持数学公式、图表、五线谱、脑图等14+渲染',
45 | '所见即所得(wysiwyg)',
46 | '即时渲染(ir)',
47 | '分屏预览(sv)',
48 | '易于使用的 Markdown 编辑器,为适配不同的应用场景而生',
49 | ]
50 | let textLength = 0
51 | let time = 0
52 | texts.forEach((text, i) => {
53 | if (i > 0) {
54 | textLength += text[i - 1].length + 20
55 | }
56 | for (let j = 0; j < text.length; j++) {
57 | time += 200
58 | setTimeout(() => {
59 | typeElement.innerHTML = text.substr(0, j + 1) +
60 | ``
63 | }, time)
64 | }
65 | if (i !== texts.length - 1) {
66 | time += 2000
67 | for (let k = 0; k < text.length; k++) {
68 | time += 50
69 | setTimeout(() => {
70 | typeElement.innerHTML = typeElement.textContent.substr(0,
71 | typeElement.textContent.length - 1) + ''
72 | }, time)
73 | }
74 | } else {
75 | setTimeout(() => {
76 | document.querySelector('.caret').style.animationName = 'flash'
77 | }, time + 1)
78 | }
79 | })
80 | }
81 |
82 | addStyle('https://cdn.jsdelivr.net/npm/vditor@3.9.7/dist/index.css')
83 | document.addEventListener('DOMContentLoaded', function () {
84 | autoType();
85 |
86 | if (document.getElementById('vditorComments')) {
87 | addScript('https://cdn.jsdelivr.net/npm/vditor@3.9.7/dist/index.min.js',
88 | () => {
89 | const demoCodeElement = document.getElementById('vditorDemoCode')
90 | if (demoCodeElement) {
91 | Vditor.highlightRender({lineNumber: true, enable: true},
92 | demoCodeElement, "https://cdn.jsdelivr.net/npm/vditor")
93 | Vditor.codeRender(demoCodeElement)
94 | }
95 | if (typeof vditorScript !== 'undefined') {
96 | vditorScript()
97 | }
98 | addScript(
99 | 'https://cdn.jsdelivr.net/npm/vcmt@1.3.2/dist/index.min.js',
100 | () => {
101 | const vcomment = new Vcomment({
102 | id: 'vditorComments',
103 | postId: '1549638745630',
104 | url: 'https://ld246.com',
105 | userName: 'Vanessa',
106 | currentPage: 1,
107 | vditor: {
108 | hljsEnable: true,
109 | hljsStyle: 'github',
110 | },
111 | after () {
112 | const commentCntElement = document.getElementById(
113 | 'commentsCount')
114 | document.getElementById(
115 | 'commentCnt').innerText = commentCntElement.innerText +
116 | ' 个讨论'
117 | commentCntElement.nextSibling.remove()
118 | commentCntElement.remove()
119 | },
120 | error () {
121 | document.getElementById('comments').remove()
122 | },
123 | })
124 |
125 | vcomment.render()
126 | })
127 | })
128 | }
129 |
130 | const dynamicElement = document.getElementById('dynamic')
131 | if (dynamicElement) {
132 | const xhr = new XMLHttpRequest()
133 | xhr.open('GET', 'https://ld246.com/api/index/articles/tag/vditor?p=1')
134 | xhr.withCredentials = true
135 | xhr.onreadystatechange = () => {
136 | if (xhr.readyState === XMLHttpRequest.DONE) {
137 | if (xhr.status === 200) {
138 | const responseJSON = JSON.parse(xhr.responseText)
139 | const articles = responseJSON.data.articles
140 | if (responseJSON.code !== 0 || 0 === articles.length) {
141 | dynamicElement.innerHTML = '无新闻'
142 | dynamicElement.style.backgroundImage = 'none'
143 | return
144 | }
145 |
146 | let listHTML = '