Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fklingler/downatello


https://github.com/fklingler/downatello

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# downatello

**downatello** is a javascript library designed to provide a bridge between HTML markup and MARDOWN markup.
It allows to convert from HTML to MARKDOWN and from MARKDOWN to HTML.

# Usage

To use **downatello** in your web pages/applications, include the the ```downatello.js``` file:

```html

```

and use the ```downatello``` variable in your javascript code.

# Methods

## ```downatello.toMarkdown()```

Use ```downatello.toMarkdown()``` to convert HTML markup to MARKDOWN markup.

Example:

```html

This text will be translated to MARKDOWN.

var html = document.getElementById('html');
var markdown = downatello.toMarkdown(html);

console.log(markdown);

// This text will be translated to **MARKDOWN**.

```

## ```downatello.toHtml()```

Use ```downatello.toHtml()``` to convert MARKDOWN markup to HTML markup.

Example

```html

var html = downatello.toHtml('This text has been translated from **MARKDOWN**.');
console.log(html);

// <p>This text will has been translated from <strong>MARKDOWN</strong>.</p>

```