more cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-15 17:32:07 +03:00
parent 6befa05d33
commit 0891ae9a50
4 changed files with 32 additions and 6 deletions

View File

@ -281,7 +281,18 @@ object.Constructor('BasePage', {
//*/ //*/
resolve: relMatchProxy('resolve'), resolve: relMatchProxy('resolve'),
delete: function(path='.'){ 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 }, return this },
// //
@ -1299,6 +1310,8 @@ module.System = {
// XXX tests... // XXX tests...
// //
_test_macro: {
text: '@source(./name) @source(./name)'},
test_page: function(){ test_page: function(){
console.log('--- RENDERER:', this.render_root) console.log('--- RENDERER:', this.render_root)
console.log('--- PATH: ', this.path) console.log('--- PATH: ', this.path)

View File

@ -52,8 +52,8 @@ module.BaseParser = {
'"(?<PREFIXDoubleQuotedArg>[^"]*)"', '"(?<PREFIXDoubleQuotedArg>[^"]*)"',
"'(?<PREFIXSingleQuotedArg>[^']*)'", "'(?<PREFIXSingleQuotedArg>[^']*)'",
// arg // arg
// NOTE: this is last because it could eat up parts of the above // NOTE: this is last because it could eat up parts of
// alternatives... // the above alternatives...
//'|\\s+[^\\s\\/>\'"]+', //'|\\s+[^\\s\\/>\'"]+',
'(?<PREFIXArg>[^\\sSTOP\'"]+)', '(?<PREFIXArg>[^\\sSTOP\'"]+)',
].join('|'), ].join('|'),

View File

@ -65,7 +65,7 @@ pwiki.pwiki
text: object.doc` text: object.doc`
some text with inline @source(./path) macros... some text with inline @source(./path) macros...
<div wikiwords=false> <div wikiwords=no>
now @source(./path) inside a div... now @source(./path) inside a div...
</div>` }) </div>` })
.update({ .update({

View File

@ -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 * XXX BUG?: markdown: when parsing chunks each chunk gets an open/closed
* <p> inserted at start/end -- this breaks stuff returned by macros... * <p> 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 OPTIMIZE: /_tree is really slow...
* XXX might be a good idea to add page caching (state.page_cache) relative * 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 * 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: browser: .get('/*').raw hangs in the browser context...
* XXX BUG?: /_tree for some reason does not show anything on lower levels... * XXX BUG?: /_tree for some reason does not show anything on lower levels...
* ...renaming _tree -> all fixed the issue * ...renaming _tree -> all fixed the issue
@ -28,6 +36,7 @@
* - per page * - per page
* - global * - global
* XXX Q: can we access fs from a pwa??? * XXX Q: can we access fs from a pwa???
* ...looks like no :|
* *
* *
* *
@ -46,10 +55,14 @@
* - zip (json/tree) -- * - zip (json/tree) --
* - page actions * - page actions
* - delete -- DONE * - delete -- DONE
* - move/rename -- * - copy/move --
* - migrate bootstrap -- * - migrate bootstrap --
* - store topology -- * - store topology --
* - sync and sync conf -- * - sync and sync conf --
* - images
* - get --
* - download --
* - upload --
* - markdown -- DONE * - markdown -- DONE
* - WikiWord -- DONE * - WikiWord -- DONE
* - dom filter mechanics -- DONE * - dom filter mechanics -- DONE