- Created a new document for using components in Milkdown. - Added a guide for using plugins in Milkdown, including toggling plugins programmatically and listing official plugins. - Introduced a recipe for integrating Milkdown with Angular, including installation steps and component creation. - Added a recipe for using Milkdown with Next.js, detailing installation and component setup. - Created a guide for integrating Milkdown with NuxtJS, including installation and component creation. - Added a comprehensive guide for using Milkdown with React, covering both Crepe and core Milkdown usage. - Introduced a recipe for SolidJS integration with Milkdown, including installation and component creation. - Added a guide for using Milkdown with Svelte, detailing installation and component setup. - Created a comprehensive guide for integrating Milkdown with Vue, covering both Crepe and core Milkdown usage. - Added a recipe for using Milkdown with Vue2, including installation and component creation.
40 lines
785 B
Markdown
40 lines
785 B
Markdown
# FAQ
|
|
|
|
This page lists answers of FAQ.
|
|
|
|
---
|
|
|
|
### How can I change contents programmatically?
|
|
|
|
You should use `editor.action` to change the contents.
|
|
We provide two macros for that allow you to change content in milkdown, `insert` and `replaceAll`.
|
|
|
|
```typescript
|
|
import { insert, replaceAll } from "@milkdown/kit/utils";
|
|
|
|
const editor = await Editor.make()
|
|
// .use(<All Your Plugins>)
|
|
.create();
|
|
|
|
editor.action(insert("# New Heading"));
|
|
|
|
editor.action(replaceAll("# New Document"));
|
|
```
|
|
|
|
---
|
|
|
|
### How to configure remark?
|
|
|
|
```typescript
|
|
import { remarkStringifyOptionsCtx } from "@milkdown/kit/core";
|
|
|
|
editor.config((ctx) => {
|
|
ctx.set(remarkStringifyOptionsCtx, {
|
|
// some options, for example:
|
|
bullet: "*",
|
|
fences: true,
|
|
incrementListMarker: false,
|
|
});
|
|
});
|
|
```
|