the-editor

A simple markdown editor

MIT License

Downloads
22
Stars
5
Committers
1

The Editor

The Editormarkdown APIgetValue, getHTML, getTOC, setValue

  • API
  • markdown
  • markdown
  • Table of contentTOC

NPM

yarn add the-editor
// or
npm i the-editor
const editor = new TheEditor(editorElement, options);
// options=

vue

// main.js
import 'the-editor/dist/the-editor.css'; // 
// app.vue
<template>
  <div ref="editor">
</template>
<script>
import { TheEditor } from 'the-editor'

export default {
  mounted() {
    const editor = new TheEditor(this.$refs.editor, {
      value: '# Hello The Editor'
    })
  }
}
</script>

jsdelivr

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/[email protected]/dist/the-editor.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/the-editor.min.js"></script>

value string null markdown
gfm boolean true GitHub Flavoured Markdown
lineNumbers boolean true

setValue string void markdown
getValue string markdown
getHTML string HTML
getTOC Array<{ anchor: string; text: string; level: number; }> TOC