tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-17 15:45:30 +03:00
parent 50991c004e
commit 95f803ce00
4 changed files with 45 additions and 17 deletions

View File

@ -670,7 +670,7 @@ object.Constructor('Page', BasePage, {
&& await base.parse(args.src, state) && await base.parse(args.src, state)
if(!src){ if(!src){
return } return }
var recursive = args.recursive || body var recursive = args.recursive ?? body
var isolated = args.isolated var isolated = args.isolated
var join = args.join var join = args.join
&& await base.parse(args.join, state) && await base.parse(args.join, state)
@ -705,7 +705,7 @@ object.Constructor('Page', BasePage, {
.map(function(p){ .map(function(p){
return page.get(p).match()[0] })) return page.get(p).match()[0] }))
.size < seen.size)){ .size < seen.size)){
if(!recursive){ if(recursive == null){
return page.get(page.RECURSION_ERROR).parse(state) } return page.get(page.RECURSION_ERROR).parse(state) }
// have the 'recursive' arg... // have the 'recursive' arg...
return base.parse(recursive, state) } return base.parse(recursive, state) }
@ -1226,8 +1226,8 @@ module.System = {
<hr> <hr>
<slot name="footer"></slot> <slot name="footer"></slot>
<slot name="content"> <slot name="content" hidden>
@include(. join="@source(file-separator)") @include(. join="@source(file-separator)" recursive="")
</slot>` }, </slot>` },
// XXX add join... // XXX add join...
_raw: { _raw: {
@ -1239,8 +1239,8 @@ module.System = {
'<macro src="." join="@source(file-separator)">' '<macro src="." join="@source(file-separator)">'
+'<pre wikiwords="no"><quote filter="quote-tags" src="."/></pre>' +'<pre wikiwords="no"><quote filter="quote-tags" src="."/></pre>'
+'</macro>'}, +'</macro>'},
// XXX can we reuse _text here???
_edit: { _edit: {
//_edit: {
text: text:
'@source(./path)' '@source(./path)'
+'<hr>' +'<hr>'
@ -1253,6 +1253,16 @@ module.System = {
+'</pre>' +'</pre>'
+'</macro>'}, +'</macro>'},
// XXX this does not yet work...
// XXX "_test" breaks differently than "test"
//_test: {
test: {
text: object.doc`
@source(_text)
<slot name="header">HEADER</slot>
<slot name="content">CONTENT</slot>
<slot name="footer">FOOTER</slot> `},
// XXX debug... // XXX debug...
_path: {text: '@source(./path join=" ")'}, _path: {text: '@source(./path join=" ")'},
@ -1298,12 +1308,29 @@ module.System = {
return 'abcdef'.split('') }, return 'abcdef'.split('') },
// XXX problem: it appears that we can't fill a slot from within a slot... // 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 // ...the "content" slot below does not override the content slot in _text
test_slots: { test_base_slots: {
text: object.doc`OUTER text: object.doc`OUTER
<slot name="header">HEADER</slot> <slot name="header">HEADER</slot>
<slot name="content">CONTENT</slot> <slot name="content">CONTENT</slot>
<slot name="footer">FOOTER</SLOT> `}, <slot name="footer">FOOTER</SLOT> `},
// XXX does not work yet...
test_slots: {
text: object.doc`
Sequential:
<slot name="sequential">unfilled</slot>
<slot name="sequential">filled</slot>
<slot name="sequential">refilled</slot>
<br><br>
Nested:
<slot name="nested">
unfilled
<slot name="nested">
filled
<slot name="nested">
refilled
</slot>
</slot>
</slot> ` },
// page parts... // page parts...
// //

View File

@ -177,19 +177,19 @@ pwiki.pwiki
.update({ .update({
location: '/test/slots', location: '/test/slots',
text: object.doc` text: object.doc`
<slot name="slot">unfilled</slot> Sequential:
<slot name="sequential">unfilled</slot>
<slot name="slot">filled</slot> <slot name="sequential">filled</slot>
<slot name="slot">refilled</slot> `, }) <slot name="sequential">refilled</slot>
.update({
location: '/test/nestedslots', Nested:
text: object.doc` <slot name="nested">
<slot name="slot">
unfilled unfilled
<slot name="slot"> <slot name="nested">
filled filled
<slot name="slot"> <slot name="nested">
refilled refilled
</slot> </slot>
</slot> </slot>

View File

@ -175,7 +175,7 @@ var exportData = async function(){
<body> <body>
<!-- XXX need to add something passive but animated here... --> <!-- XXX need to add something passive but animated here... -->
<div id="pWiki">Loading...</div> <div id="pWiki"><div class="spinner">Loading...</div></div>
</body> </body>
</html> </html>

View File

@ -1,6 +1,7 @@
/********************************************************************** /**********************************************************************
* *
* *
* XXX nested slots do not seem to work...
* XXX BUG: /** /paths -- does not work... * XXX BUG: /** /paths -- does not work...
* 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...