diff --git a/package.json b/package.json index 127ecbe..e326082 100755 --- a/package.json +++ b/package.json @@ -4,12 +4,15 @@ "author": "Alex A. Naanou ", "license": "BSD", "dependencies": { + "@toast-ui/editor": "^3.2.0", "glob": "*", "ig-actions": "*", "ig-features": "*", "ig-object": "*", "ig-types": "^6.9.4", "jszip": "*", + "medium-editor": "^5.23.3", + "medium-editor-markdown": "^3.2.2", "pouchdb": "^7.3.0", "pouchdb-browser": "^7.3.0", "requirejs": "*", diff --git a/pwiki2-test.js b/pwiki2-test.js index 3d8de9b..3e96da9 100755 --- a/pwiki2-test.js +++ b/pwiki2-test.js @@ -58,6 +58,21 @@ pwiki.store.update('@pouch', { // XXX TEST... // XXX add filter tests... pwiki.pwiki + .update({ + location: '/test/quote', + text: object.doc` + Inline quoted text: + --- + + this should not get expanded: @now() + + --- + + Included quoted text: + --- + + `, + }) .update({ location: '/test/wikiword', text: object.doc` diff --git a/pwiki2.html b/pwiki2.html index 8d81c79..b99b4a5 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -90,9 +90,7 @@ document.pwikiloaded = new Event('pwikiloaded') // start loading pWiki... require(['./browser'], function(pwiki){ pwiki = window.pwiki = pwiki.pwiki - pwiki.dom = document.querySelector('#pWiki') - // handle location.hash/history (both directions) window.addEventListener('hashchange', function(evt){ evt.preventDefault() @@ -128,11 +126,28 @@ require(['./browser'], function(pwiki){ && this.dom .querySelector('#'+ this.hash) .scrollIntoView() }) - // show current page... pwiki.path = location.hash.slice(1) }) + +// XXX +var saveData = async function(){ + var blob = new Blob([await pwiki.store.json(true)], {type: "text/plain;charset=utf-8"}); + + var a = document.createElement('a') + var blobURL = a.href = URL.createObjectURL(blob) + a.download = 'pWiki-dump.json' + + //document.body.appendChild(a) + a.dispatchEvent(new MouseEvent("click")) + //document.body.removeChild(a) + //URL.revokeObjectURL(blobURL) +} + + + + diff --git a/pwiki2.js b/pwiki2.js index fb5940a..e6656d7 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -17,7 +17,8 @@ * - render page -- DONE * - navigation -- DONE * - hash/anchor -- DONE -* - editor and interactivity +* - basic editor and interactivity +* - export / zip * - migrate bootstrap * - store topology * - sync and sync conf @@ -33,8 +34,21 @@ * - tags (current) * - raw / code * - nl2br -* - path2link (wikiword?) +* - path2link (wikiword?) -- DONE * - editor +* MediumEditor (markdown-plugin) +* https://github.com/yabwe/medium-editor +* https://github.com/IonicaBizau/medium-editor-markdown +* - heavy-ish markdown plugin +* ToastUI (markdown) +* https://github.com/nhn/tui.editor +* - quite heavy +* Pen (markdown) +* https://github.com/sofish/pen +* - no npm module +* - not sure if it works on mobile +* + small +* tiptap (no-markdown, investigate y.js) * - configuration * - defaults * - System/config (global)