|
1 | 1 |
|
2 | 2 |
|
| 3 | +<!DOCTYPE html> |
| 4 | + |
| 5 | + |
3 | 6 | <html> |
4 | 7 |
|
5 | 8 | <head> |
6 | | - |
7 | | - <title>markdown-editor</title> |
8 | | - <meta name=description content='Write and preview Markdown instantly in your browser. A clean, fast, and distraction-free editor built for developers, writers, and technical bloggers'> |
| 9 | + <meta charset=utf-8> |
9 | 10 |
|
10 | | - <base href='https://ext-code.com/utils/editors/markdown-editor/'> |
11 | | - <base href='https://javascript-2020.github.io/utils/editors/markdown-editor/'> |
| 11 | + <title> |
| 12 | + Markdown Editor |
| 13 | + </title> |
| 14 | + |
| 15 | + <meta name=description content='Write and preview Markdown instantly in your browser. A clean, fast, and distraction-free editor built for developers, writers, and technical bloggers.'> |
12 | 16 |
|
| 17 | + <base href='https://ext-code.com/utils/editors/markdown-editor/'> |
13 | 18 | <link rel=canonical href='https://ext-code.com/utils/editors/markdown-editor/markdown-editor.html'> |
14 | 19 |
|
15 | 20 | <meta name=viewport content='width=device-width, initial-scale=1'> |
16 | 21 | <link rel=icon type='image/png' href='images/markdown-editor-favicon.png'> |
17 | 22 |
|
| 23 | + <script type='application/ld+json'> |
| 24 | + { |
| 25 | + "@context" : "https://schema.org", |
| 26 | + "@type" : "SoftwareApplication", |
| 27 | + "name" : "Markdown Editor", |
| 28 | + "url" : "https://ext-code.com/utils/editors/markdown-editor/markdown-editor.html", |
| 29 | + "author" : {"@type":"Person","name":"Matthew Richards"}, |
| 30 | + "description" : "Write and preview Markdown instantly in your browser. A clean, fast, and distraction-free editor built for developers, writers, and technical bloggers", |
| 31 | + "applicationCategory" : "DeveloperApplication", |
| 32 | + "operatingSystem" : "All", |
| 33 | + "browserRequirements" : "Requires JavaScript-enabled browser", |
| 34 | + "softwareVersion" : "1.0.0", |
| 35 | + "offers" : {"@type":"Offer","price":"0","priceCurrency":"GBP"} |
| 36 | + } |
| 37 | + </script> |
| 38 | + |
| 39 | + |
| 40 | + <script src='https://cdn.jsdelivr.net/npm/ace-builds@1.37.0/src-min-noconflict/ace.js'></script> |
| 41 | + |
18 | 42 |
|
19 | 43 | <script src='https://libs.ext-code.com/js/dom/component/component.js'></script> |
20 | 44 |
|
|
23 | 47 | console.log('markdown-editor-v2.0.html'); |
24 | 48 | console.log(); |
25 | 49 | console.json=v=>console.log(JSON.stringify(v,null,4)); |
| 50 | + var df=true,version='v2.0' |
| 51 | + ; |
| 52 | + |
| 53 | + var ace; |
| 54 | + |
26 | 55 | var ext; |
27 | 56 | var $; |
28 | 57 | var datatype; |
29 | 58 | var menumod; |
30 | 59 | var keydown; |
| 60 | + var debug; |
31 | 61 |
|
32 | 62 | var menu; |
33 | 63 |
|
|
44 | 74 | //: |
45 | 75 |
|
46 | 76 |
|
47 | | - mod.stack.add = init; |
48 | | - |
49 | 77 | async function init(){ |
50 | | - console.log('init'); |
| 78 | + debug('init',version); |
51 | 79 | //keydown = keydown(); |
52 | 80 | menu = menumod(); |
53 | 81 |
|
54 | | - hdr = mod.hdr; |
| 82 | + hdr = mod['editors-hdr']; |
55 | 83 | mainmenu = mod['main-menu'] |
56 | | - filemod = mod.filemod; |
57 | | - publish = mod.publish; |
58 | | - editor = mod.editor; |
59 | | - output = mod.output; |
60 | | - log = mod.log; |
| 84 | + filemod = mod['file-mod']; |
| 85 | + publish = mod['publish-ui']; |
| 86 | + editor = mod['web-editor']; |
| 87 | + output = mod['output-md']; |
| 88 | + log = mod['log-mod']; |
61 | 89 |
|
62 | 90 | menu.initmod({keydown}); |
63 | 91 |
|
|
69 | 97 | output.initmod({ext,$,editor}); |
70 | 98 | log.initmod({ext,$}); |
71 | 99 |
|
72 | | - await hdr.init(); |
73 | | - await mainmenu.init(); |
74 | | - await filemod.init(); |
75 | | - await publish.init(); |
76 | | - await editor.init(); |
77 | | - await output.init(); |
78 | | - await log.init(); |
| 100 | + await Promise.all([ |
| 101 | + hdr.init(), |
| 102 | + mainmenu.init(), |
| 103 | + filemod.init(), |
| 104 | + publish.init(), |
| 105 | + editor.init(), |
| 106 | + output.init(), |
| 107 | + log.init(), |
| 108 | + ]); |
79 | 109 |
|
80 | 110 |
|
81 | 111 | //: |
|
92 | 122 | }//init |
93 | 123 |
|
94 | 124 |
|
95 | | - //: |
96 | | - |
97 | | - |
98 | 125 | (async()=>{ |
99 | 126 |
|
100 | 127 | mod.stack.add; |
|
105 | 132 | 'js/dom/$.js', |
106 | 133 | 'js/core/datatype.js', |
107 | 134 | 'js/dom/menumod/menumod.js', |
108 | | - 'js/dom/keydown/keydown.js' |
| 135 | + 'js/dom/keydown/keydown.js', |
| 136 | + 'js/debug/debug.js', |
109 | 137 | ); |
110 | | - [$,datatype,menumod,keydown] = await promise; |
| 138 | + [$,datatype,menumod,keydown,debug] = await promise; |
111 | 139 |
|
112 | 140 | mod.stack.complete; |
113 | 141 |
|
|
156 | 184 | #view |
157 | 185 | {display:none;flex:1} |
158 | 186 |
|
159 | | - editor-root |
| 187 | + web-editor |
160 | 188 | {width:50%} |
161 | 189 |
|
162 | | - output-root |
| 190 | + output-md |
163 | 191 | {flex:1} |
164 | 192 |
|
165 | 193 | button |
|
168 | 196 | </style> |
169 | 197 |
|
170 | 198 | </head> |
| 199 | + |
171 | 200 |
|
172 | 201 | <body> |
173 | 202 |
|
174 | | - <hdr component=grp v2.0> |
| 203 | + <editors-hdr component=grp> |
175 | 204 | <img class=title src='images/markdown-editor.png' style='top:-5px;height:55px'> |
176 | | - <span slot=date>24 Aug 2025</span> |
177 | | - </hdr> |
| 205 | + <time slot=date datetime=2025-10-31>31 Oct 2025</time> |
| 206 | + </editors-hdr> |
178 | 207 |
|
179 | 208 |
|
180 | 209 | <div id=hdr> |
181 | 210 |
|
182 | | - <main-menu component=page v2.0></main-menu> |
| 211 | + <main-menu component=page></main-menu> |
183 | 212 |
|
184 | | - <filemod component v2.0></filemod> |
| 213 | + <file-mod component></file-mod> |
185 | 214 |
|
186 | 215 | <div id=save-root> |
187 | 216 | <button id=save>save</button> |
|
193 | 222 | </div> |
194 | 223 | </div> |
195 | 224 |
|
196 | | - <publish component v2.0></publish> |
| 225 | + <publish-ui component></publish-ui> |
197 | 226 |
|
198 | 227 | <button id=run>run</button> |
199 | 228 |
|
|
206 | 235 |
|
207 | 236 | <div id=view> |
208 | 237 |
|
209 | | - <editor component v2.0></editor> |
| 238 | + <web-editor component></web-editor> |
210 | 239 |
|
211 | 240 | <div id=page-slider style='width:10px;cursor:ew-resize'></div> |
212 | 241 |
|
213 | | - <output component=page v2.0></output> |
| 242 | + <output-md component=page></output-md> |
214 | 243 |
|
215 | 244 | </div> |
216 | 245 |
|
217 | 246 |
|
218 | | - <log component v2.0></log> |
| 247 | + <log-mod component v2.0></log-mod> |
219 | 248 |
|
220 | 249 |
|
221 | 250 | <checkbox-one-template> |
|
417 | 446 | editor.setValue(txt,-1); |
418 | 447 | } |
419 | 448 |
|
420 | | - if(json.run){ |
421 | | - run(); |
422 | | - } |
423 | | - |
424 | 449 |
|
425 | 450 | }//onmessage |
426 | 451 |
|
|
0 commit comments