Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaRickli committed Aug 25, 2023
1 parent c0d67c8 commit 1ad9b10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Markdown inline editor.

### [Demo](https://lucarickli.github.io/mdie/)

### [Documentation](https://lucarickli.github.io/mdie/docs)

### Install

```sh
Expand All @@ -25,34 +27,13 @@ Here is a snippet to include in your app for a basic working example.
}
```

### API

```ts
declare class InlineEditor {
constructor({
target,
markdown,
parse
}: {
target: HTMLElement | Element | Document | ShadowRoot
markdown: string
parse: (md: string) => string
})

get changesMade(): boolean

get markdown(): string

cleanup(save?: boolean): void
}
```

### Example

```ts
import { InlineEditor } from '@lucarickli/mdie'
import Mdie from '@lucarickli/mdie'
import marked from 'marked'

const editor = new InlineEditor({
const editor = new Mdie({
target: document.body,
markdown: `# Hello world`,
parse: (md) => marked.parse(md) // 3rd party library
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lucarickli/mdie",
"description": "Markdown inline editor",
"version": "0.0.2",
"version": "0.0.3",
"repository": {
"type": "git",
"url": "https://github.com/lucarickli/mdie.git"
Expand All @@ -13,8 +13,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:pages": "tsc && vite build --config pages.vite.config.js",
"typedoc": "typedoc src/main.ts",
"build:pages": "tsc && vite build --config pages.vite.config.js && typedoc --basePath /mdie/docs --out dist/docs src/main.ts",
"format": "prettier --write ."
},
"devDependencies": {
Expand Down

0 comments on commit 1ad9b10

Please sign in to comment.