mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-25 07:25:13 +00:00
update readme
This commit is contained in:
parent
73fb26c6ba
commit
8cd2d63782
1 changed files with 10 additions and 6 deletions
16
README.md
16
README.md
|
@ -12,20 +12,24 @@ TypeScript:
|
||||||
```ts
|
```ts
|
||||||
import * as mfm from 'rosee';
|
import * as mfm from 'rosee';
|
||||||
|
|
||||||
const input =
|
const inputText =
|
||||||
`<center>
|
`<center>
|
||||||
Hello [tada everynyan! 🎉]
|
Hello [tada everynyan! 🎉]
|
||||||
|
|
||||||
I'm @ai, An bot of misskey!
|
I'm @ai, A bot of misskey!
|
||||||
|
|
||||||
https://github.com/syuilo/ai
|
https://github.com/syuilo/ai
|
||||||
</center>`;
|
</center>`;
|
||||||
|
|
||||||
// parse a MFM text
|
// Generate a MFM tree from the MFM text.
|
||||||
const result = mfm.parse(input);
|
const mfmTree = mfm.parse(inputText);
|
||||||
|
|
||||||
|
// Generate a MFM tree from the MFM plain text.
|
||||||
|
const plainMfmTree = mfm.parsePlain('I like the hot soup :soup:');
|
||||||
|
|
||||||
|
// Reverse to a MFM text from the MFM tree.
|
||||||
|
const text = mfm.toString(mfmTree);
|
||||||
|
|
||||||
// parse a MFM plain text
|
|
||||||
const plainResult = mfm.parsePlain('I like the hot soup :soup:');
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage (Repository)
|
## Usage (Repository)
|
||||||
|
|
Loading…
Reference in a new issue