experimenting...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-13 14:57:53 +03:00
parent e7c34dd9f1
commit c7daa906db
4 changed files with 52 additions and 5 deletions

View File

@ -4,12 +4,15 @@
"author": "Alex A. Naanou <alex.nanou@gmail.com>",
"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": "*",

View File

@ -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:
---
<quote>
this should not get expanded: @now()
</quote>
---
Included quoted text:
---
<quote src="/test/slots"/>
`,
})
.update({
location: '/test/wikiword',
text: object.doc`

View File

@ -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)
}
</script>
<body>

View File

@ -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)