差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
javascript:codemirror [2025/04/07 07:51] – [cm.js でインストール] ともやん | javascript:codemirror [2025/04/17 13:47] (現在) – [ビルドツールを使わない方法] ともやん | ||
---|---|---|---|
行 3: | 行 3: | ||
ソースコード: | ソースコード: | ||
- | ===== CodeMirror 6 ===== | + | ====== CodeMirror 6 ====== |
本家: [[https:// | 本家: [[https:// | ||
ソースコード: | ソースコード: | ||
ドキュメント: | ドキュメント: | ||
+ | |||
+ | ===== ビルドツールを使わない方法 ===== | ||
+ | < | ||
+ | |||
+ | <div id=" | ||
+ | <script type=" | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | <script type=" | ||
+ | import { javascript } from ' | ||
+ | import { basicSetup } from ' | ||
+ | import { EditorView, keymap } from ' | ||
+ | import { defaultKeymap } from ' | ||
+ | //import { solarizedDark } from ' | ||
+ | import { monokai } from ' | ||
+ | |||
+ | let myView = new EditorView({ | ||
+ | doc: `<div id=" | ||
+ | |||
+ | <script type=" | ||
+ | import { javascript } from ' | ||
+ | import { basicSetup } from ' | ||
+ | import { EditorView, keymap } from ' | ||
+ | import { defaultKeymap } from ' | ||
+ | //import { solarizedDark } from ' | ||
+ | import { monokai } from ' | ||
+ | |||
+ | let myView = new EditorView({ | ||
+ | doc: ' | ||
+ | extensions: [keymap.of(defaultKeymap)], | ||
+ | parent: document.getElementById(" | ||
+ | extensions: [ | ||
+ | basicSetup, | ||
+ | javascript({typescript: | ||
+ | monokai, | ||
+ | EditorView.theme({ | ||
+ | ' | ||
+ | fontFamily: ' | ||
+ | } | ||
+ | }) | ||
+ | ], | ||
+ | }) | ||
+ | </ | ||
+ | extensions: [keymap.of(defaultKeymap)], | ||
+ | parent: document.getElementById(" | ||
+ | extensions: [ | ||
+ | basicSetup, | ||
+ | javascript({typescript: | ||
+ | monokai, | ||
+ | EditorView.theme({ | ||
+ | ' | ||
+ | fontFamily: ' | ||
+ | } | ||
+ | }) | ||
+ | ], | ||
+ | }) | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== CodeMirirter 6 のテーマ...🤔 ===== | ||
+ | [[git> | ||
+ | [[git> | ||
+ | |||
+ | ===== CodeMirror 6 開発版(dev)のインストール方法 ===== | ||
==== Node.js のインストール ==== | ==== Node.js のインストール ==== | ||
行 25: | 行 98: | ||
remote: Total 25 (delta 0), reused 12 (delta 0), pack-reused 0 (from 0) | remote: Total 25 (delta 0), reused 12 (delta 0), pack-reused 0 (from 0) | ||
Receiving objects: 100% (25/25), 11.13 KiB | 178.00 KiB/s, done. | Receiving objects: 100% (25/25), 11.13 KiB | 178.00 KiB/s, done. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== cm.js の使用方法 ==== | ||
+ | <WRAP color_term> | ||
+ | <WRAP color_command>< | ||
+ | <font color="# | ||
+ | </ | ||
+ | <WRAP color_result>< | ||
+ | Usage: | ||
+ | cm install [--ssh] | ||
+ | cm packages | ||
+ | cm status | ||
+ | cm build Build the bundle files | ||
+ | cm clean Delete files created by the build | ||
+ | cm devserver [--source-map] | ||
+ | Start a dev server on port 8090 | ||
+ | cm release & | ||
+ | Create commits to tag a release | ||
+ | cm build-readme & | ||
+ | cm commit & | ||
+ | cm push Run git push in packages that have new commits | ||
+ | cm run & | ||
+ | cm test [--no-browser] | ||
+ | cm grep & | ||
+ | cm --help | ||
</ | </ | ||
</ | </ | ||
行 285: | 行 384: | ||
<WRAP color_term> | <WRAP color_term> | ||
<WRAP color_command>< | <WRAP color_command>< | ||
- | <b class=GRN> | + | <font color="# |
</ | </ | ||
<WRAP color_result>< | <WRAP color_result>< | ||
- | > dev | + | & |
- | > node bin/cm.js devserver | + | & |
Starting compilation in watch mode... | Starting compilation in watch mode... | ||
- | Found 0 errors. Watching for file changes. | + | state/ |
- | Bundling state, view, language, commands, search, autocomplete, | + | & |
+ | |||
+ | Found 1 error. Watching for file changes. | ||
+ | Bundling state, view, language, commands, search, autocomplete, | ||
Dev server listening on 8090 | Dev server listening on 8090 | ||
Bundling done. | Bundling done. | ||
行 305: | 行 407: | ||
</ | </ | ||
- | ===== CodeMirror 5 ===== | + | ====== CodeMirror 5 ====== |
==== インストール ==== | ==== インストール ==== |