From 95f803ce00a5f18d91a4d9e0b1b20147d1359ff2 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 17 Aug 2022 15:45:30 +0300 Subject: [PATCH] tweaking... Signed-off-by: Alex A. Naanou --- pwiki/page.js | 41 ++++++++++++++++++++++++++++++++++------- pwiki2-test.js | 18 +++++++++--------- pwiki2.html | 2 +- pwiki2.js | 1 + 4 files changed, 45 insertions(+), 17 deletions(-) diff --git a/pwiki/page.js b/pwiki/page.js index 35f6044..f7306f4 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -670,7 +670,7 @@ object.Constructor('Page', BasePage, { && await base.parse(args.src, state) if(!src){ return } - var recursive = args.recursive || body + var recursive = args.recursive ?? body var isolated = args.isolated var join = args.join && await base.parse(args.join, state) @@ -705,7 +705,7 @@ object.Constructor('Page', BasePage, { .map(function(p){ return page.get(p).match()[0] })) .size < seen.size)){ - if(!recursive){ + if(recursive == null){ return page.get(page.RECURSION_ERROR).parse(state) } // have the 'recursive' arg... return base.parse(recursive, state) } @@ -1226,8 +1226,8 @@ module.System = {
- - @include(. join="@source(file-separator)") + ` }, // XXX add join... _raw: { @@ -1239,8 +1239,8 @@ module.System = { '' +'
' +'
'}, + // XXX can we reuse _text here??? _edit: { - //_edit: { text: '@source(./path)' +'
' @@ -1253,6 +1253,16 @@ module.System = { +'' +''}, + // XXX this does not yet work... + // XXX "_test" breaks differently than "test" + //_test: { + test: { + text: object.doc` + @source(_text) + HEADER + CONTENT + FOOTER `}, + // XXX debug... _path: {text: '@source(./path join=" ")'}, @@ -1298,12 +1308,29 @@ module.System = { return 'abcdef'.split('') }, // XXX problem: it appears that we can't fill a slot from within a slot... // ...the "content" slot below does not override the content slot in _text - test_slots: { + test_base_slots: { text: object.doc`OUTER HEADER CONTENT FOOTER `}, - + // XXX does not work yet... + test_slots: { + text: object.doc` + Sequential: + unfilled + filled + refilled +

+ Nested: + + unfilled + + filled + + refilled + + + ` }, // page parts... // diff --git a/pwiki2-test.js b/pwiki2-test.js index bd18fc6..82c6923 100755 --- a/pwiki2-test.js +++ b/pwiki2-test.js @@ -177,19 +177,19 @@ pwiki.pwiki .update({ location: '/test/slots', text: object.doc` - unfilled + Sequential: + unfilled - filled + filled - refilled `, }) - .update({ - location: '/test/nestedslots', - text: object.doc` - + refilled + + Nested: + unfilled - + filled - + refilled diff --git a/pwiki2.html b/pwiki2.html index bd8f419..3b44cea 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -175,7 +175,7 @@ var exportData = async function(){ -
Loading...
+
Loading...
diff --git a/pwiki2.js b/pwiki2.js index 6bb498f..70274a6 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,6 +1,7 @@ /********************************************************************** * * +* XXX nested slots do not seem to work... * XXX BUG: /** /paths -- does not work... * XXX BUG?: markdown: when parsing chunks each chunk gets an open/closed *

inserted at start/end -- this breaks stuff returned by macros...