1.0.1 • Published 3 years ago

@fman42/simple-markdown v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

SimpleMarkdownEditor

The markdown editor for Vue without heavy dependencies. Just one command and you will get editor in your project

💫 Simple. Only needed attributes and methods;

💥 Fast. Install package and you have an ability to use an editor right now;

💭 Lightweidth. An editor required just one dependency.

editor

My gratitude to https://github.com/Dessader for his beatiful design

Installation

Browser: npm install @fman42/simple-markdown

Usage

<template>
  <SimpleMarkdown/>
</template>
<script>
  import SimpleMarkdown from 'simple-markdown';
  
  export default {
    components: {
      SimpleMarkdown
    }
  }
</script>

Documentation

Attributes

resize

Type: Boolean

Default: true

To allow resize main content and preview field

preview

Type: Boolean

Default: true

Enable or disable preview field in an editor

disabledTools

Type: Array

Default: []

You will can pass in this array ids of toolbar items for disable them

autoSave

Type: Number

Default: 5000

Time in seconds when an editor will be saved

defaultContent

Type: String

Default: ''

Set a default content for an editor

Methods

toMarkdown() : string

Get raw text from main field

toHTML() : string

Get parsed markdown text from a preview field

setContent(content) : void

Set content in an editor