mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
244266b2f6
commit
51be8b9dff
40
pwiki2.js
40
pwiki2.js
@ -12,6 +12,7 @@
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
// XXX might be a good idea to make this compatible with node's path API...
|
||||
var pWikiPath =
|
||||
module.pWikiPath = {
|
||||
|
||||
@ -110,9 +111,11 @@ module.pWikiPath = {
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
// XXX should we support page symlinking???
|
||||
// XXX store keys must be normalized...
|
||||
// NOTE: store keys must be normalized...
|
||||
//
|
||||
// XXX must support store stacks...
|
||||
// XXX path macros???
|
||||
// XXX should we support page symlinking???
|
||||
var store =
|
||||
module.store = {
|
||||
exists: function(path){
|
||||
@ -230,7 +233,40 @@ module.page = {
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
// Abstract macro syntax:
|
||||
// Inline macro:
|
||||
// @macro(arg ..)
|
||||
//
|
||||
// HTML-like:
|
||||
// <macro arg=value ../>
|
||||
//
|
||||
// HTML-like with body:
|
||||
// <macro arg=value ..>
|
||||
// ..text..
|
||||
// </macro>
|
||||
//
|
||||
// XXX should inline macros support named args???
|
||||
var MACRO_PATTERN =
|
||||
[[
|
||||
// @macro(arg ..)
|
||||
'\\\\?@([a-zA-Z-_]+)\\(([^)]*)\\)',
|
||||
|
||||
// <macro ..> | <macro ../>
|
||||
'<\\s*($MACROS)(\\s+[^>]*)?/?>',
|
||||
// </macro>
|
||||
'</\\s*($MACROS)\\s*>',
|
||||
].join('|'), 'mg'],
|
||||
|
||||
var WIKIWORD_PATTERN =
|
||||
RegExp('('+[
|
||||
//'\\\\?(\\/|\\./|\\.\\./|>>|[A-Z][_a-z0-9]+[A-Z/])[_a-zA-Z0-9/]*',
|
||||
'\\\\?\\/?(\\./|\\.\\./|>>|[A-Z][_a-z0-9]+[A-Z/])[_a-zA-Z0-9/]*',
|
||||
'\\\\?\\[[^\\]]+\\]',
|
||||
].join('|') +')', 'g'),
|
||||
|
||||
var macros = {
|
||||
now: function(){},
|
||||
macro: function(){},
|
||||
}
|
||||
var expandPage = function(page){
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user