Skip to content

Commit e9d258e

Browse files
committed
Improve README
1 parent f88852c commit e9d258e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Type definitions for the latest [MarkEdit](https://markedit.app) API.
55
## References
66

77
- [MarkEdit Customization Guide](https://github.com/MarkEdit-app/MarkEdit/wiki/Customization)
8-
- [Example (Markdown Table Editor)](https://github.com/MarkEdit-app/MarkEdit-mte)
9-
- [Example (Text Highlight)](https://github.com/MarkEdit-app/MarkEdit-highlight)
8+
- [Example: Markdown Table Editor](https://github.com/MarkEdit-app/MarkEdit-mte)
9+
- [Example: Text Highlight](https://github.com/MarkEdit-app/MarkEdit-highlight)
10+
- [Example: Vue Language Package](https://github.com/MarkEdit-app/MarkEdit-lang-vue)
1011

1112
## Usage
1213

@@ -107,6 +108,8 @@ export default defineConfig({
107108
});
108109
```
109110

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+
110113
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:
111114

112115
```
@@ -130,6 +133,8 @@ The reason is to ensure that user scripts and MarkEdit use the same modules, rat
130133

131134
The final step is to copy the built script to `~/Library/Containers/app.cyan.markedit/Data/Documents/scripts/`, and restart the app.
132135

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+
133138
## Using JavaScript
134139

135140
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:
@@ -141,4 +146,4 @@ const editorAPI = MarkEdit.editorAPI;
141146

142147
----
143148

144-
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).

markedit.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* https://github.com/MarkEdit-app/MarkEdit-api
33
*
44
* - [MarkEdit Customization Guide](https://github.com/MarkEdit-app/MarkEdit/wiki/Customization)
5-
* - [Example (Markdown Table Editor)](https://github.com/MarkEdit-app/MarkEdit-mte)
6-
* - [Example (Text Highlight)](https://github.com/MarkEdit-app/MarkEdit-highlight)
5+
* - [Example: Markdown Table Editor](https://github.com/MarkEdit-app/MarkEdit-mte)
6+
* - [Example: Text Highlight](https://github.com/MarkEdit-app/MarkEdit-highlight)
7+
* - [Example: Vue Language Package](https://github.com/MarkEdit-app/MarkEdit-lang-vue)
78
*/
89

910
import type { EditorView } from '@codemirror/view';

0 commit comments

Comments
 (0)