Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fklingler/downatello
https://github.com/fklingler/downatello
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fklingler/downatello
- Owner: fklingler
- License: wtfpl
- Created: 2013-01-30T00:54:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-15T09:54:26.000Z (over 12 years ago)
- Last Synced: 2023-03-22T19:32:38.109Z (almost 2 years ago)
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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>
```