From 0891ae9a508abec8cebbf375f7dd7be276c0d23b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 15 Aug 2022 17:32:07 +0300 Subject: [PATCH] more cleanup... Signed-off-by: Alex A. Naanou --- pwiki/page.js | 15 ++++++++++++++- pwiki/parser.js | 4 ++-- pwiki2-test.js | 2 +- pwiki2.js | 17 +++++++++++++++-- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/pwiki/page.js b/pwiki/page.js index fb887da..75ded50 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -281,7 +281,18 @@ object.Constructor('BasePage', { //*/ resolve: relMatchProxy('resolve'), delete: function(path='.'){ - this.__delete__() + this.__delete__(path) + return this }, + + // XXX should these be implemented here or proxy to .store??? + copy: async function(to){ + this.get(to).data = await this.data + this.path = to + return this }, + move: async function(to){ + var from = this.path + await this.copy(to) + this.delete(from) return this }, // @@ -1299,6 +1310,8 @@ module.System = { // XXX tests... // + _test_macro: { + text: '@source(./name) @source(./name)'}, test_page: function(){ console.log('--- RENDERER:', this.render_root) console.log('--- PATH: ', this.path) diff --git a/pwiki/parser.js b/pwiki/parser.js index 841fa01..55942ff 100755 --- a/pwiki/parser.js +++ b/pwiki/parser.js @@ -52,8 +52,8 @@ module.BaseParser = { '"(?[^"]*)"', "'(?[^']*)'", // arg - // NOTE: this is last because it could eat up parts of the above - // alternatives... + // NOTE: this is last because it could eat up parts of + // the above alternatives... //'|\\s+[^\\s\\/>\'"]+', '(?[^\\sSTOP\'"]+)', ].join('|'), diff --git a/pwiki2-test.js b/pwiki2-test.js index 2f3824f..c1960ce 100755 --- a/pwiki2-test.js +++ b/pwiki2-test.js @@ -65,7 +65,7 @@ pwiki.pwiki text: object.doc` some text with inline @source(./path) macros... -
+
now @source(./path) inside a div...
` }) .update({ diff --git a/pwiki2.js b/pwiki2.js index 0e896ac..e1c546a 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -2,9 +2,16 @@ * * * -* XXX BUG: pwiki2-test.js: /test/macros -- broken parser... +* XXX BUG: source/include problem... +* to reproduce: +* .get('/System/_text_macro/_text').text +* this does not exhibit the issue: +* .get('/System/_text_macro').text * XXX BUG?: markdown: when parsing chunks each chunk gets an open/closed *

inserted at start/end -- this breaks stuff returned by macros... +* ...there are two ways to dance around this: +* - make filters run a bit more globaly -- per block... +* - find a local parser... * XXX OPTIMIZE: /_tree is really slow... * XXX might be a good idea to add page caching (state.page_cache) relative * to a path on parsing, to avoid re-matching the same page over and @@ -17,6 +24,7 @@ * }, * ... * } +* XXX BUG: FF: conflict between object.run and PouchDB... * XXX BUG: browser: .get('/*').raw hangs in the browser context... * XXX BUG?: /_tree for some reason does not show anything on lower levels... * ...renaming _tree -> all fixed the issue @@ -28,6 +36,7 @@ * - per page * - global * XXX Q: can we access fs from a pwa??? +* ...looks like no :| * * * @@ -46,10 +55,14 @@ * - zip (json/tree) -- * - page actions * - delete -- DONE -* - move/rename -- +* - copy/move -- * - migrate bootstrap -- * - store topology -- * - sync and sync conf -- +* - images +* - get -- +* - download -- +* - upload -- * - markdown -- DONE * - WikiWord -- DONE * - dom filter mechanics -- DONE