You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Example: Text Highlight](https://github.com/MarkEdit-app/MarkEdit-highlight)
10
+
-[Example: Vue Language Package](https://github.com/MarkEdit-app/MarkEdit-lang-vue)
10
11
11
12
## Usage
12
13
@@ -107,6 +108,8 @@ export default defineConfig({
107
108
});
108
109
```
109
110
111
+
> Note: If you're using packages that are **not** supported in MarkEdit, such as leveraging [@codemirror/lang-vue](https://github.com/codemirror/lang-vue) to add syntax highlighting for Vue, they should **not** be marked as external.
112
+
110
113
It is recommended to build as [cjs](https://commonjs.org/), building as [umd](https://github.com/umdjs/umd) should work too. If you build it as an [iife](https://developer.mozilla.org/en-US/docs/Glossary/IIFE), make sure to replace imports as globals like this:
111
114
112
115
```
@@ -130,6 +133,8 @@ The reason is to ensure that user scripts and MarkEdit use the same modules, rat
130
133
131
134
The final step is to copy the built script to `~/Library/Containers/app.cyan.markedit/Data/Documents/scripts/`, and restart the app.
132
135
136
+
> Ensure the build system produces a single JavaScript file. If the build generates multiple chunks, you can use [vite-plugin-singlefile](https://github.com/richardtallent/vite-plugin-singlefile) to bundle everything into one file.
137
+
133
138
## Using JavaScript
134
139
135
140
If you just want to quickly prototype with JavaScript, you can directly access CodeMirror and MarkEdit interfaces through objects assigned to the `MarkEdit` object. For example:
For complete examples, refer to [Example (Markdown Table Editor)](https://github.com/MarkEdit-app/MarkEdit-mte) and [Example (Text Highlight)](https://github.com/MarkEdit-app/MarkEdit-highlight).
149
+
For complete examples, refer to [Example: Markdown Table Editor](https://github.com/MarkEdit-app/MarkEdit-mte), [Example: Text Highlight](https://github.com/MarkEdit-app/MarkEdit-highlight) and [Example: Vue Language Package](https://github.com/MarkEdit-app/MarkEdit-lang-vue).
0 commit comments