mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-18 00:51:38 +00:00
minor notes and cleanup...
Signed-off-by: Alex A. Naanou <alec.nanou@gmail.com>
This commit is contained in:
parent
54edbc70b1
commit
024be0174b
11
wiki.js
11
wiki.js
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
//var DEBUG = DEBUG != null ? DEBUG : true
|
//var DEBUG = DEBUG != null ? DEBUG : true
|
||||||
|
|
||||||
|
// XXX mve away from ES6, we still need to run this on the browser...
|
||||||
var clearWikiWords = elem => {
|
var clearWikiWords = elem => {
|
||||||
// clear existing...
|
// clear existing...
|
||||||
elem.find('.WikiWord').each(function(){
|
elem.find('.WikiWord').each(function(){
|
||||||
@ -36,6 +37,7 @@ var setWikiWords = (text, show_brackets) =>
|
|||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
// XXX not sure about these...
|
// XXX not sure about these...
|
||||||
|
// XXX add docs...
|
||||||
var BaseData = {
|
var BaseData = {
|
||||||
'System/title': function(){
|
'System/title': function(){
|
||||||
return this.get('..').title },
|
return this.get('..').title },
|
||||||
@ -123,6 +125,8 @@ var BaseData = {
|
|||||||
// ],
|
// ],
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
|
// XXX add .json support...
|
||||||
var data = {
|
var data = {
|
||||||
'Templates/EmptyPage': {
|
'Templates/EmptyPage': {
|
||||||
text: 'Page [@include(./path)] is empty.' +'<br><br>'
|
text: 'Page [@include(./path)] is empty.' +'<br><br>'
|
||||||
@ -180,6 +184,7 @@ var normalizePath = path =>
|
|||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
|
// XXX add .json support...
|
||||||
var Wiki = {
|
var Wiki = {
|
||||||
__wiki_data: data,
|
__wiki_data: data,
|
||||||
|
|
||||||
@ -415,7 +420,7 @@ var Wiki = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// XXX list children/sub-pages...
|
// XXX list children/sub-pages...
|
||||||
get list(){
|
get children(){
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@ -432,6 +437,8 @@ var Wiki = {
|
|||||||
exists: function(path){
|
exists: function(path){
|
||||||
return normalizePath(path || this.path) in this.__wiki_data },
|
return normalizePath(path || this.path) in this.__wiki_data },
|
||||||
// get title from dir and then go up the tree...
|
// get title from dir and then go up the tree...
|
||||||
|
//
|
||||||
|
// XXX should we also acquire each path part???
|
||||||
acquire: function(path, no_default){
|
acquire: function(path, no_default){
|
||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
@ -550,7 +557,6 @@ var macro = {
|
|||||||
context: null,
|
context: null,
|
||||||
|
|
||||||
// XXX this is preliminary...
|
// XXX this is preliminary...
|
||||||
// XXX add wikiword...
|
|
||||||
// filter(text) -> html
|
// filter(text) -> html
|
||||||
filter: {
|
filter: {
|
||||||
default: 'html',
|
default: 'html',
|
||||||
@ -657,7 +663,6 @@ var macro = {
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
},
|
},
|
||||||
// XXX do we need to parse the contents of tags here??? (nested patterns?)
|
|
||||||
parse: function(text, context){
|
parse: function(text, context){
|
||||||
var that = this
|
var that = this
|
||||||
var filters = []
|
var filters = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user