mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-17 03:20:02 +00:00
parent
1335dff450
commit
8904a6dba6
@ -1835,6 +1835,7 @@ $tw.boot.startup = function(options) {
|
||||
$tw.utils.registerFileType("audio/mp3","base64",".mp3");
|
||||
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
|
||||
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
|
||||
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
|
||||
// Create the wiki store for the app
|
||||
$tw.wiki = new $tw.Wiki();
|
||||
// Install built in tiddler fields modules
|
||||
|
@ -4,7 +4,8 @@
|
||||
"tiddlywiki/googleanalytics",
|
||||
"tiddlywiki/nodewebkitsaver",
|
||||
"tiddlywiki/browser-sniff",
|
||||
"tiddlywiki/railroad"
|
||||
"tiddlywiki/railroad",
|
||||
"tiddlywiki/evernote"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
|
4
plugins/tiddlywiki/evernote/docs.tid
Normal file
4
plugins/tiddlywiki/evernote/docs.tid
Normal file
@ -0,0 +1,4 @@
|
||||
title: $:/plugins/tiddlywiki/evernote/docs
|
||||
|
||||
! Introduction
|
||||
|
47
plugins/tiddlywiki/evernote/modules/enex-deserializer.js
Normal file
47
plugins/tiddlywiki/evernote/modules/enex-deserializer.js
Normal file
@ -0,0 +1,47 @@
|
||||
/*\
|
||||
title: $:/plugins/tiddlywiki/evernote/modules/enex-deserializer.js
|
||||
type: application/javascript
|
||||
module-type: tiddlerdeserializer
|
||||
|
||||
ENEX file deserializer
|
||||
|
||||
For details see: https://blog.evernote.com/tech/2013/08/08/evernote-export-format-enex/
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
// DOMParser = require("$:/plugins/tiddlywiki/xmldom/dom-parser").DOMParser;
|
||||
|
||||
/*
|
||||
Parse an ENEX file into tiddlers
|
||||
*/
|
||||
exports["application/enex+xml"] = function(text,fields) {
|
||||
// Collect output tiddlers in an array
|
||||
var results = [];
|
||||
// Parse the XML document
|
||||
var parser = new DOMParser(),
|
||||
doc = parser.parseFromString(text,"application/xml");
|
||||
// Output a report tiddler with information about the import
|
||||
var enex = doc.querySelector("en-export");
|
||||
results.push({
|
||||
title: "Evernote Import Report",
|
||||
text: "Evernote file imported on " + enex.getAttribute("export-date") + " from " + enex.getAttribute("application") + " (" + enex.getAttribute("version") + ")"
|
||||
})
|
||||
// Get all the "note" nodes
|
||||
var noteNodes = doc.querySelectorAll("note");
|
||||
$tw.utils.each(noteNodes,function(noteNode) {
|
||||
results.push({
|
||||
title: noteNode.querySelector("title").textContent,
|
||||
type: "text/html",
|
||||
text: noteNode.querySelector("content").textContent
|
||||
});
|
||||
});
|
||||
// Return the output tiddlers
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
7
plugins/tiddlywiki/evernote/plugin.info
Normal file
7
plugins/tiddlywiki/evernote/plugin.info
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"title": "$:/plugins/tiddlywiki/evernote",
|
||||
"description": "Evernote migration tools",
|
||||
"author": "JeremyRuston",
|
||||
"core-version": ">=5.0.0",
|
||||
"list": "readme docs"
|
||||
}
|
11
plugins/tiddlywiki/evernote/readme.tid
Normal file
11
plugins/tiddlywiki/evernote/readme.tid
Normal file
@ -0,0 +1,11 @@
|
||||
title: $:/plugins/tiddlywiki/evernote/readme
|
||||
|
||||
This plugin contains tool to assist migration of content from Evernote ENEX files.
|
||||
|
||||
!! Instructions
|
||||
|
||||
# Download or save your ENEX file from Evernote
|
||||
# Rename the file to have an `.enex` extension
|
||||
# Drag the file into the TiddlyWiki browser window
|
||||
## Alternatively, click the "Import" button in the "Tools" sidebar tab
|
||||
# Review and accept the converted tiddlers
|
Loading…
x
Reference in New Issue
Block a user