|
1 | 1 |
|
2 | 2 |
|
| 3 | +<!DOCTYPE html> |
3 | 4 |
|
4 | 5 | <html> |
5 | 6 |
|
6 | | - |
7 | 7 | <head> |
8 | | - |
| 8 | + <meta charset=utf-8> |
9 | 9 |
|
10 | | - <title>monaco editor setup</title> |
| 10 | + <title> |
| 11 | + Monaco Editor Setup |
| 12 | + </title> |
| 13 | + |
| 14 | + <meta name=desctiption content='Learn how to embed the Monaco Editor—the code editor behind VS Code—into any webpage. This step-by-step guide includes a live, editable demo so you can explore its features and customize your setup in real time.'> |
11 | 15 |
|
12 | | - <base href='https://javascript-2020.github.io/blog/25-08-25/monaco-editor-setup/'> |
| 16 | + <link rel=icon type='image/png' href='/blog/image/blog-30.png'> |
| 17 | + <meta name=viewport content='width=device-width, initial-scale=1'> |
13 | 18 |
|
| 19 | + <base href='https://ext-code.com/blog/25-08-25/monaco-editor-setup/'> |
14 | 20 | <link rel=canonical href='https://ext-code.com/blog/25-08-25/monaco-editor-setup/monaco-editor-setup.html'> |
15 | | - |
16 | | - <meta name=viewport content='width=device-width, initial-scale=1'> |
17 | | - <link rel=icon type='image/png' href='/blog/image/blog-30.png'> |
18 | 21 |
|
19 | | - |
| 22 | + |
| 23 | + <script type='application/ld+json'> |
| 24 | + { |
| 25 | + "@context" : "https://schema.org", |
| 26 | + "@type" : "TechArticle", |
| 27 | + "headline" : "Monaco Editor Setup", |
| 28 | + "description" : "Learn how to embed the Monaco Editor—the code editor behind VS Code—into any webpage. This step-by-step guide includes a live, editable demo so you can explore its features and customize your setup in real time.", |
| 29 | + "author" : {"@type":"Person","name":"Matthew Richards"}, |
| 30 | + "datePublished" : "2025-08-25", |
| 31 | + "dateModified" : "2025-10-29", |
| 32 | + "mainEntityOfPage" : {"@type":"WebPage","@id":"https://ext-code.com/blog/25-08-25/monaco-editor-setup/monaco-editor-setup.html"}, |
| 33 | + "publisher" : {"@type":"Organization","name":"Your Blog or Company Name","logo":{"@type":"ImageObject","url":"https://ext-code.com/favicon.ico"}}, |
| 34 | + } |
| 35 | + </script> |
| 36 | + |
| 37 | + |
20 | 38 | <script src='https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js'></script> |
21 | 39 |
|
22 | 40 |
|
23 | 41 | <script src='https://libs.ext-code.com/js/dom/component/component.js'></script> |
24 | 42 |
|
25 | 43 | <script init> |
26 | 44 | console.clear(); |
| 45 | + console.log('monaco-editor-setup.html'); |
| 46 | + console.log(); |
27 | 47 | console.json=v=>console.log(JSON.stringify(v,null,4)); |
28 | | - var version = 'v1.0'; |
29 | | - |
30 | | - var df = true; |
31 | | - |
| 48 | + var df=true,version='v1.0' |
| 49 | + ; |
32 | 50 |
|
| 51 | + var ace; |
| 52 | + |
33 | 53 | var ext; |
34 | 54 | var $; |
35 | 55 | var datatype; |
36 | 56 | var menumod; |
37 | | - var code; |
38 | | - |
| 57 | + var keydown; |
| 58 | + var debug; |
39 | 59 |
|
40 | 60 | var snippet; |
| 61 | + |
| 62 | + var log; |
| 63 | + |
41 | 64 |
|
42 | 65 | //: |
43 | 66 |
|
44 | 67 |
|
45 | | - mod.stack.add = init; |
46 | | - |
47 | 68 | async function init(){ |
48 | 69 | //debug('init',version); |
49 | 70 | menu = menumod(); |
50 | 71 |
|
51 | 72 |
|
52 | 73 | snippet = mod['snippet-html-console']; |
| 74 | + log = mod.log; |
53 | 75 |
|
54 | 76 | snippet.initmod({ext,$,menu,ace}); |
| 77 | + log.initmod({ext,$}); |
55 | 78 |
|
56 | | - await snippet.init(); |
57 | | - |
58 | | - |
| 79 | + await Promise.all([ |
| 80 | + snippet.init(), |
| 81 | + log.init, |
| 82 | + ]); |
| 83 | + |
59 | 84 |
|
60 | | - await initdom(document.body); |
| 85 | + initdom(document.body); |
61 | 86 |
|
62 | 87 |
|
63 | 88 | }//init |
|
77 | 102 | 'js/core/datatype.js', |
78 | 103 | 'js/dom/menumod/menumod.js', |
79 | 104 | 'js/dom/keydown/keydown.js', |
80 | | - 'js/dom/code/v2.0/code-v2.0.js.api', |
| 105 | + 'js/debug/debug.js', |
81 | 106 | ); |
82 | | - [$,datatype,menumod,keydown,code] = await promise; |
| 107 | + [$,datatype,menumod,keydown,debug] = await promise; |
83 | 108 |
|
84 | | - code.initmod({ext,$,datatype,menumod}); |
85 | | - |
86 | 109 | mod.stack.complete; |
87 | 110 |
|
88 | 111 | })(); |
|
91 | 114 | </script init> |
92 | 115 |
|
93 | 116 |
|
94 | | - |
95 | | - |
96 | 117 | <link rel=stylesheet href='/blog/css/blog.css'> |
97 | 118 |
|
98 | 119 | <style> |
99 | 120 |
|
100 | 121 | html |
101 | 122 | {height:100%;font-family:arial} |
102 | 123 | body |
103 | | - {min-height:calc(100% - 40px);display:flex;flex-direction:column;gap:10px;margin:20px;align-items:center; |
| 124 | + {min-height:calc(100% - 40px);display:flex;flex-direction:column;gap:20px;margin:20px;align-items:center; |
104 | 125 | padding-bottom:200px; |
105 | 126 | } |
106 | 127 | body>* |
107 | | - {max-width:1400px;width:100%;padding:0 20px;} |
| 128 | + {max-width:1400px;width:100%} |
| 129 | + |
| 130 | + [component] |
| 131 | + {display:none} |
| 132 | + |
| 133 | + .description |
| 134 | + {max-width:1000px;text-align:justify;border-left:4px solid #4a90e2;padding:1rem 2rem; |
| 135 | + background-color:#f9f9f9;font-family:system-ui,sans-serif;font-size:1rem;line-height:1.6;color:#333} |
| 136 | + .description>p |
| 137 | + {margin:0} |
| 138 | + .description > p+p |
| 139 | + {margin:10px 0} |
| 140 | + |
| 141 | + code |
| 142 | + {font-family:monospace;background:whitesmoke} |
| 143 | + code.inline |
| 144 | + {display:inline;padding:5px 10px} |
| 145 | + |
| 146 | + a |
| 147 | + {color:#4a90e2;text-decoration:none;font-weight:500} |
| 148 | + a:hover |
| 149 | + {text-decoration:underline} |
| 150 | + .link-domain |
| 151 | + {font-size:0.85rem;color:#777;margin-left:0.25rem} |
| 152 | + .link-domain::before |
| 153 | + {content:'['} |
| 154 | + .link-domain::after |
| 155 | + {content:']'} |
| 156 | + .link-txt |
| 157 | + {} |
| 158 | + |
| 159 | + input |
| 160 | + {font-size:16px;padding:5px 7px;box-sizing:border-box;} |
| 161 | + input[type=button] |
| 162 | + {cursor:pointer} |
| 163 | + |
| 164 | + |
108 | 165 |
|
109 | 166 | </style> |
110 | 167 |
|
|
113 | 170 |
|
114 | 171 | <body> |
115 | 172 |
|
| 173 | + <blog-hdr component=grp1 v2.0> |
| 174 | + <h1 class=title> |
| 175 | + Monaco Editor Setup |
| 176 | + </h1> |
| 177 | + <time slot=date datetime=2025-10-29> |
| 178 | + 29 Oct 2025 |
| 179 | + </time> |
| 180 | + </blog-hdr> |
116 | 181 |
|
117 | 182 |
|
118 | | - <h3> |
119 | | - monaco editor setup |
120 | | - </h3> |
121 | | - |
122 | 183 |
|
123 | | - <div id=desc> |
124 | | - |
125 | | -monaco editor setup |
126 | | - |
| 184 | + <div class=description> |
| 185 | + <p> |
| 186 | + Learn how to embed the Monaco Editor—the code editor behind VS Code—into any webpage. |
| 187 | + This step-by-step guide includes a live, editable demo so you can explore its features and customize your setup in real time. |
| 188 | + </p> |
127 | 189 | </div> |
128 | 190 |
|
129 | 191 |
|
130 | | - <snippet-html-console component v2.0 src='ex/ex1.html'> |
131 | | - </snippet-html-console> |
| 192 | + <snippet-html-console component v2.0 src='ex/ex1.html'></snippet-html-console> |
132 | 193 |
|
133 | 194 |
|
134 | 195 | <div id=ftr></div> |
| 196 | + |
| 197 | + |
| 198 | + <log component v2.0></log> |
135 | 199 |
|
136 | 200 | </body> |
137 | 201 |
|
|
0 commit comments