0.2.1 • Published 8 years ago

angular-lightweight-markdown-editor v0.2.1

Weekly downloads
289
License
MIT
Repository
-
Last release
8 years ago

Angular lightweight markdown editor

angular-lightweight-markdown-editor is extremely light weight editor (v0.2.0 12kb including styles) for markdown. It doesn't use any fancy text editors but just that basic textarea.

Requires only angular.js and angular-sanitize.js libraries.

Editor displays preview if showdown.js is included in to the project.

screenshot

Usage

Install using bower

bower install angular-lightweight-markdown-editor

Include CSS and JS to project

<link  href="angular-lightweight-markdown-editor/dist/angular-lightweight-markdown-editor.css" rel="stylesheet">
<script src="angular-lightweight-markdown-editor/dist/angular-lightweight-markdown-editor.min.js"></script>

Add dependecy to your angular application

angular.module("myapp", [
    "ngSanitize",
    "angular-lightweight-markdown-editor"
]);

Include editor into your html

<markdown-editor></markdown-editor>

See demo for example code

Parameters

ParameterDescriptionDefault
ng-modelData model to use in textarea
optionsSettings for editor. See options.
text-previewButton text for previewPreview
text-propose-textPrompt text to as link textPlease provide link text
text-propose-linkPrompt text asking for link urlPlease provide link URL
show-previewControl preview showing with external valuefalse
nameDefault textarea parameter
requiredDefault textarea parameter
minlengthDefault textarea parameter
maxlengthDefault textarea parameter
placeholderDefault textarea parameter
selectionDirectionDefault textarea parameter
selectionStartDefault textarea parameter
 selectionEndDefault textarea parameter
spellcheckDefault textarea parameter

Options

KeyTypeDescriptionDefault
controlsArray of stringsControls to display in toolbar "bold", "italic", "strikethrough", "separator", "heading", "bullets", "indent", "code", "separator", "link", "quote", "separator", "preview"

Developing

Fork, git clone, push and send pull request.

To get started:

> npm install && bower install

To build release version while developing. This will watch and do release build constantly.

> gulp

To run and test you need to start web server in root of project.