diff --git a/wiki.js b/wiki.js
index 0a42c29..5210be6 100755
--- a/wiki.js
+++ b/wiki.js
@@ -118,9 +118,7 @@ var macro = {
macro: {
now: Macro('Create a now id',
[],
- function(context, elem, state){
- return ''+Date.now()
- }),
+ function(context, elem, state){ return ''+Date.now() }),
// select filter to post-process text...
filter: Macro('Filter to post-process text',
['name'],
@@ -255,8 +253,26 @@ var macro = {
}
}
+ // fill macro...
if(path){
- return $(context.get(path)
+ var pages = context.get(path)
+
+ // no matching pages...
+ if(pages.length == 0){
+ var e = elem
+ .find('else').first().clone()
+ .attr('src', path)
+ parse(e, context)
+ return e
+
+ }
+
+ // fill with pages...
+ elem = elem.clone()
+ .find('else')
+ .remove()
+ .end()
+ return $(pages
.map(function(page){
var e = elem.clone()
.attr('src', page.path)
@@ -735,6 +751,11 @@ var data = {
+'@include(./todo)'
+'',
},
+ 'Templates/EmptyOutline': {
+ text: ''
+ +'@include(./outline)'
+ +'',
+ },
'Templates/pages': {
//text: '