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)
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 = {
<hr>
<slot name="footer"></slot>
<slot name="content">
@include(. join="@source(file-separator)")
<slot name="content" hidden>
@include(. join="@source(file-separator)" recursive="")
</slot>` },
// XXX add join...
_raw: {
@ -1239,8 +1239,8 @@ module.System = {
'<macro src="." join="@source(file-separator)">'
+'<pre wikiwords="no"><quote filter="quote-tags" src="."/></pre>'
+'</macro>'},
// XXX can we reuse _text here???
_edit: {
//_edit: {
text:
'@source(./path)'
+'<hr>'
@ -1253,6 +1253,16 @@ module.System = {
+'</pre>'
+'</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...
_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
<slot name="header">HEADER</slot>
<slot name="content">CONTENT</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...
//

View File

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

View File

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

View File

@ -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
* <p> inserted at start/end -- this breaks stuff returned by macros...