diff --git a/pwiki/page.js b/pwiki/page.js index a01e91d..e224a9a 100755 --- a/pwiki/page.js +++ b/pwiki/page.js @@ -24,6 +24,7 @@ var markdown = require('./filters/markdown') var relProxy = function(name){ var func = function(path='.:$ARGS', ...args){ + path = this.resolvePathVars(path) return this.store[name]( pwpath.relative(this.path, path), ...args) } @@ -35,6 +36,7 @@ function(name){ if(path === true || path === false){ strict = path path = '.:$ARGS' } + path = this.resolvePathVars(path) return this.store[name]( pwpath.relative(this.path, path), strict) } @@ -755,9 +757,7 @@ object.Constructor('Page', BasePage, { ['name', 'default', ['local']], function(args){ return this.macros.arg.call(this, args) }), - // XXX do we need this??? args: function(){ - console.log('!!!!') return pwpath.obj2args(this.args) }, // // @filter() @@ -1859,6 +1859,7 @@ module.System = { (edit)
Referrer: @source(../referrer) (edit)
+ Args:
type: @source(../type)
diff --git a/pwiki/parser.js b/pwiki/parser.js index 2cb844d..5f4e4ad 100755 --- a/pwiki/parser.js +++ b/pwiki/parser.js @@ -83,7 +83,7 @@ module.BaseParser = { // @(arg ..) '\\\\?@\\((?UNNAMED_ARGS)\\)', // | - '<\\s*(?MACROS)(?ARGS)?\\s*/?>', + '<\\s*(?MACROS)(?\\sARGS)?\\s*/?>', // 'MACROS)\\s*>', ].join('|'))+')', diff --git a/pwiki2.js b/pwiki2.js index 85c744e..2b2e5e7 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,55 +1,28 @@ /********************************************************************** * * -* XXX BUG: this does not call the args macro... -* await pwiki.get('/path/testDirect:x:y:z').parse('') -* ...syntax checking is done correctly though... -* XXX ARGS: arg passing is a mess... -* - need a consistent way to access args -* - global -* .root.args? -* - render root -* - local -* use: -* testDirect - direct action -* testDirect! - energetic direct action -* testPage - page -* testAction - page action -* testAction! - energetic page action -* examples: -* // NOTE: .text is redered via _view and thus is on a different -* // level to .raw... -* // XXX should renderer.args be the same in .text and .parse(..)??? -* // XXX for .text and .parse(..), the action is called twice... +* XXX BUG?: the action is called twice here: +* await pwiki.get('/path/testDirect:x:y:z').parse('@include(.:$ARGS)') +* and: +* await pwiki.get('/path/testDirect:x:y:z').text +* XXX ARGS: should the arg locations in these be the same??? * // root path: /System/testAction:a:b:c * await pwiki.get('/path/testDirect:x:y:z').raw * .args - x y z -* .renderer.args - a b c -* .root.args - a b c -* await pwiki.get('/path/testAction:x:y:z').raw -* .args - x y z -* .renderer.args - a b c +* .renderer.args - a b c (XXX seems logical) * .root.args - a b c * await pwiki.get('/path/testDirect:x:y:z').parse('@include(.:$ARGS)') * .args - x y z -* .renderer.args - a b c +* .renderer.args - a b c (XXX odd) * .root.args - a b c -* XXX triggered twice... -* await pwiki.get('/path/testAction:x:y:z').parse('@include(.:$ARGS)') -* .args - x y z -* .renderer.args - a b c -* .root.args - a b c -* XXX triggered twice... * await pwiki.get('/path/testDirect:x:y:z').text * .args - x y z -* .renderer.args - x y z +* .renderer.args - x y z (XXX logical) * .root.args - a b c -* XXX triggered twice... -* await pwiki.get('/path/testAction:x:y:z').text -* .args - x y z -* .renderer.args - x y z -* .root.args - a b c -* XXX triggered twice... +* ...this essentially boils down to how .renderer is handled... +* currently it is inherited and since all pages are clones of the +* root page and the root is rendered it is always the .renderer +* unless we explicitly reassign it (.text) * XXX CACHE need to explicitly prevent caching of some actions/pages... * XXX FEATURE tags and accompanying API... * - add tags to page -- macro/filter