lots of minor tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-04-07 16:46:29 +03:00
parent fca3410173
commit b7276fd174
7 changed files with 25 additions and 32 deletions

View File

@ -2,14 +2,16 @@
bootstrap.js:
node make_bootstrap.js
bootstrap.js: scripts/bootstrap.js
node $<
.PHONY: bootstrap
bootstrap: bootstrap.js
clean:
rm -f bootstrap.js

View File

@ -47,23 +47,19 @@ are likely to change, the implementation / API **will definitely** change! ;)_
### General Documentation:
<pwiki-comment>
- [General info](README.md) - This document.
- [Bootstrap path](bootstrap/Doc/Path.md) - Path mechanics.
- [Bootstrap macros](bootstrap/Doc/Macros.md) - Macro documentation
</pwiki-comment>
<!--[pWiki[
- [Doc/About] - This document.
- [Doc/Path] - Path mechanics.
- [Doc/Macros] - Macro documentation
]]-->
### Project:
- The project on [GitHub](https://github.com/flynx/pWiki)
- pWiki [live demo (hosted on Gitgub)](https://flynx.github.io/pWiki/) _&ndash;
The data is stored in sessionStorage on the client, closing the tab/browser
@ -72,15 +68,10 @@ will reset the wiki._
### License and Copyright
pWiki is developed by [Alex A. Naanou](https://github.com/flynx) and
licensed under the
<pwiki-comment>
[3-Clause BSD License](LICENSE)
</pwiki-comment>
<!--[pWiki[
[3-Clause BSD License](#LICENSE)
]]-->
licensed under the <pwiki-comment>[3-Clause BSD License](LICENSE)
</pwiki-comment><!--[pWiki[ [3-Clause BSD License](#LICENSE) ]]-->
<!-- @filter(markdown) -->

2
bootstrap.js vendored

File diff suppressed because one or more lines are too long

View File

@ -95,4 +95,5 @@ pre {
}
/* @filter(-wikiword) */
/* @filter(text) */
/* vim:set ts=4 sw=4 ft=css : */

View File

@ -1107,7 +1107,8 @@ module.pWikiMacros = actions.Actions(pWikiBase, {
// can get using native JS lookup mechanisms, or at least the
// farthest I've pushed it so far...
var pWikiPage =
module.pWikiPage = object.Constructor('pWikiPage',
module.pWikiPage =
object.Constructor('pWikiPage',
actions.mix(
// XXX not sure if we need this here...
//actions.MetaActions,

View File

@ -18,29 +18,30 @@ glob('bootstrap/**/*.@(tpl|md|css|html)')
var p = path
.replace('bootstrap/', '')
.replace(/\.(json|txt|md|css|html)/, '')
p
&& console.log('Found:', p)
console.log('Found:', p)
bootstrap[p] = {
text: fs.readFileSync(path).toString(),
} })
.on('end', function(){
// extra root stuff...
if(fs.existsSync('README.md')){
console.log('Setting:', 'About')
bootstrap['Doc/About'] = {
text: fs.readFileSync('README.md').toString(),
} }
if(fs.existsSync('LICENSE')){
console.log('Setting:', 'LICENSE')
bootstrap['LICENSE'] = {
text: fs.readFileSync('LICENSE').toString(),
} }
if(!bootstrap.WikiHome){
console.log('Setting:', 'WikiHome')
bootstrap.WikiHome = {
text: '@include(Doc/About)'
} }
if(fs.existsSync('LICENSE')){
console.log('Setting:', 'LICENSE')
bootstrap['LICENSE'] = {
text: `${
fs.readFileSync('LICENSE').toString()
}<!-- @filter(text) -->`,
} }
var txt = '// This file is generated automatically, '
+'all changes made here will be lost.'

View File

@ -344,7 +344,6 @@ var macro = {
html: function(context, elem){
return $(elem) },
text: function(context, elem){
return $('<span>')
.append($('<pre>')
@ -454,6 +453,7 @@ var macro = {
},
//
// Parsing:
// 1) expand macros
// 2) apply filters
@ -956,15 +956,13 @@ data.__proto__ = BaseData
// XXX experimental...
// ...for some reason these are called twice...
var PathActions = {
/*
// XXX
test: function(){
var p = path2lst(this.location)
console.log('!!! TEST !!!')
this.location = p.slice(0, -1)
},
//*/
this.location = p.slice(0, -1) },
delete: function(){
var p = normalizePath(path2lst(this.location).slice(0, -1))
@ -1091,7 +1089,6 @@ var Wiki = {
delete this.__order
delete this.__order_by
this.__location = this.resolvePathVars(this.resolveDotPath(value))
this.resolvePathActions() },