Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wanasit/enml-js
Evernote's ENML library in Javascript
https://github.com/wanasit/enml-js
Last synced: 17 days ago
JSON representation
Evernote's ENML library in Javascript
- Host: GitHub
- URL: https://github.com/wanasit/enml-js
- Owner: wanasit
- License: mit
- Created: 2012-07-09T03:38:58.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T01:55:45.000Z (over 4 years ago)
- Last Synced: 2024-10-14T10:54:49.563Z (about 1 month ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 103
- Watchers: 11
- Forks: 25
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
enml-js
===========[Evernote's ENML](http://dev.evernote.com/doc/articles/enml.php) utitlity for Javascript.
```
> enml.ENMLOfPlainText("Hello\nWorld!!")
"\nHello\nWorld!!\n"> enml.PlainTextOfENML('\n
Hello\nWorld!!\n')
"Hello\nWorld!!"```
### Node.js
npm install enml-js
### Browser
Functions
============**enml.ENMLOfPlainText**(String) - Encode a given plain text into ENML format.
**enml.PlainTextOfENML**(String) - Translate ENML content back into normal plain text.
> enml.PlainTextOfENML('\n
Hello\nWorld!!\n')
"Hello\nWorld!!"**enml.HTMLOfENML**(String, [ Resources ]) - Translate ENML to HTML for viewing in browsers.
> enml.HTMLOfENML('\n
Hello\nWorld!!\n')
'Hello\nWorld!!\n'This function accepts an array of Resource object from Evernote Official Javascript SDK as the second parameter. Those resources (img, audio, video) will be embeded into HTML using base64 data encoding.
```javascriptd
var client = new evernote.Client({token: AUTH_TOKEN });
var noteStore = client.getNoteStore()noteStore.getNote(noteGuid, true, true, true, true, function(err, note){
var html = enml.HTMLOfENML(note.content, note.resources);
//...
});
```**enml.TodosOfENML**(String) - Extract Todo items in a given ENML text.
> enml.TodosOfENML('Task1
Task2
With Bold Italic and Underline
With Color')
[ { text: 'Task1', checked: false },
{ text: 'Task2', checked: true },
{ text: 'With Bold Italic and Underline',
checked: false },
{ text: 'With Color', checked: false } ]**enml.CheckTodoInENML**(String, Int, Bool) - Rewrite ENML content by changing check/uncheck value of the TODO in given position.
> enml.CheckTodoInENML('Task1
Task2
With Bold Italic and Underline
With Color',0, true )
Task1Task2
With Bold Italic and Underline
With Color'