mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-16 08:01:39 +00:00
notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
77998f8829
commit
fb82119d8c
@ -840,7 +840,6 @@ object.Constructor('Page', BasePage, {
|
|||||||
base.get(this.QUOTE_ACTION_PAGE).raw
|
base.get(this.QUOTE_ACTION_PAGE).raw
|
||||||
: await page.raw
|
: await page.raw
|
||||||
|
|
||||||
|
|
||||||
page.path
|
page.path
|
||||||
&& depends.add(page.path)
|
&& depends.add(page.path)
|
||||||
|
|
||||||
@ -1059,13 +1058,13 @@ object.Constructor('Page', BasePage, {
|
|||||||
[text, join] = state.macros[name] } }
|
[text, join] = state.macros[name] } }
|
||||||
|
|
||||||
if(src){
|
if(src){
|
||||||
var match = this.get(await base.parse(src, state))
|
|
||||||
|
|
||||||
join = _getBlock('join')
|
join = _getBlock('join')
|
||||||
?? join
|
?? join
|
||||||
join = join
|
join = join
|
||||||
&& await base.parse(join, state)
|
&& await base.parse(join, state)
|
||||||
|
|
||||||
|
var match = this.get(await base.parse(src, state))
|
||||||
|
|
||||||
// NOTE: thie does not introduce a dependency on each
|
// NOTE: thie does not introduce a dependency on each
|
||||||
// of the iterated pages, that is handled by the
|
// of the iterated pages, that is handled by the
|
||||||
// respective include/source/.. macros, this however
|
// respective include/source/.. macros, this however
|
||||||
@ -1217,6 +1216,10 @@ object.Constructor('Page', BasePage, {
|
|||||||
//
|
//
|
||||||
// NOTE: this uses .PAGE_TEMPLATE to render the page.
|
// NOTE: this uses .PAGE_TEMPLATE to render the page.
|
||||||
// NOTE: writing to .raw is the same as writing to .text...
|
// NOTE: writing to .raw is the same as writing to .text...
|
||||||
|
//
|
||||||
|
// NOTE: .__debug_last_render_state is mainly exposed for introspection
|
||||||
|
// and debugging, set comment it out to disable...
|
||||||
|
//__debug_last_render_state: undefined,
|
||||||
get text(){ return (async function(){
|
get text(){ return (async function(){
|
||||||
var path = pwpath.split(this.path)
|
var path = pwpath.split(this.path)
|
||||||
path.at(-1)[0] == '_'
|
path.at(-1)[0] == '_'
|
||||||
@ -1235,6 +1238,9 @@ object.Constructor('Page', BasePage, {
|
|||||||
// render template in context of page...
|
// render template in context of page...
|
||||||
var depends = this.depends = new Set([tpl])
|
var depends = this.depends = new Set([tpl])
|
||||||
var state = {depends}
|
var state = {depends}
|
||||||
|
// this is here for debugging and introspection...
|
||||||
|
'__debug_last_render_state' in this
|
||||||
|
&& (this.__debug_last_render_state = state)
|
||||||
var data = { render_root: this }
|
var data = { render_root: this }
|
||||||
return this.get(path, data)
|
return this.get(path, data)
|
||||||
.parse(
|
.parse(
|
||||||
@ -1255,7 +1261,8 @@ object.Constructor('Page', BasePage, {
|
|||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
var getCachedProp = function(obj, name){
|
var getCachedProp =
|
||||||
|
function(obj, name){
|
||||||
var that = obj
|
var that = obj
|
||||||
var value = obj.cache ?
|
var value = obj.cache ?
|
||||||
obj.cache[name]
|
obj.cache[name]
|
||||||
@ -1264,7 +1271,8 @@ var getCachedProp = function(obj, name){
|
|||||||
&& value.then(function(value){
|
&& value.then(function(value){
|
||||||
that.cache = {[name]: value} })
|
that.cache = {[name]: value} })
|
||||||
return value }
|
return value }
|
||||||
var setCachedProp = function(obj, name, value){
|
var setCachedProp =
|
||||||
|
function(obj, name, value){
|
||||||
return object.parentProperty(CachedPage.prototype, name).set.call(obj, value) }
|
return object.parentProperty(CachedPage.prototype, name).set.call(obj, value) }
|
||||||
|
|
||||||
// XXX this is good enough on the front-side to think about making the
|
// XXX this is good enough on the front-side to think about making the
|
||||||
|
|||||||
@ -136,6 +136,13 @@ module.BaseStore = {
|
|||||||
...await this.__names(),
|
...await this.__names(),
|
||||||
} },
|
} },
|
||||||
|
|
||||||
|
// XXX sort paths based on search order into three groups:
|
||||||
|
// - non-system
|
||||||
|
// ...sorted by length?
|
||||||
|
// - system
|
||||||
|
// ...sort based on system search order?
|
||||||
|
__sort_names: function(){},
|
||||||
|
|
||||||
__cache_add: function(path){
|
__cache_add: function(path){
|
||||||
if(this.__paths_cache){
|
if(this.__paths_cache){
|
||||||
this.__paths_cache.includes(path)
|
this.__paths_cache.includes(path)
|
||||||
|
|||||||
15
pwiki2.js
15
pwiki2.js
@ -1,6 +1,14 @@
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
* XXX page search: make things invariant via .names
|
||||||
|
* - if a page is in a system path and there are no alternatives
|
||||||
|
* just return it and do not search.
|
||||||
|
* - if there are alternatives rank them
|
||||||
|
* - check the non-system ones (common sub-path?)
|
||||||
|
* - return the first system
|
||||||
|
* XXX sort paths in .names
|
||||||
|
* XXX remove/mark shadowed paths???
|
||||||
* XXX NORMCACHE .normalize(..) cache normalized strings...
|
* XXX NORMCACHE .normalize(..) cache normalized strings...
|
||||||
* ...seems to have little impact...
|
* ...seems to have little impact...
|
||||||
* XXX MATCH limit candidates to actual page name matches -- this will
|
* XXX MATCH limit candidates to actual page name matches -- this will
|
||||||
@ -27,8 +35,9 @@
|
|||||||
* mark the normalized string and return it as-is on
|
* mark the normalized string and return it as-is on
|
||||||
* renormalization...
|
* renormalization...
|
||||||
* ...initial experiment made things slower...
|
* ...initial experiment made things slower...
|
||||||
* XXX need a uniform way to track some state in links in pwiki for things
|
* XXX FEATURE eed a uniform way to track some state in links in pwiki
|
||||||
* like paging and the like with simple user/macro access (???)...
|
* for things like paging and the like with simple user/macro
|
||||||
|
* access (???)...
|
||||||
* ...the simplest that comes to mind is to store in in path
|
* ...the simplest that comes to mind is to store in in path
|
||||||
* somehow:
|
* somehow:
|
||||||
* - <path>?<arg>=<value>&...
|
* - <path>?<arg>=<value>&...
|
||||||
@ -76,6 +85,8 @@
|
|||||||
* ...might be a good idea to make filters local only...
|
* ...might be a good idea to make filters local only...
|
||||||
* XXX slots/macros might also pose a problem...
|
* XXX slots/macros might also pose a problem...
|
||||||
* 2) all the macros that can source pages to produce generators (DONE)
|
* 2) all the macros that can source pages to produce generators (DONE)
|
||||||
|
* XXX might be a good idea to parse a page into an executable/function
|
||||||
|
* that would render self in a given context...
|
||||||
* XXX the parser should handle all action return values, including:
|
* XXX the parser should handle all action return values, including:
|
||||||
* - lists -- DONE
|
* - lists -- DONE
|
||||||
* - iterators -- DONE
|
* - iterators -- DONE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user