1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00
This commit is contained in:
Jermolene 2017-12-12 13:58:30 +00:00
commit 56940e49c2
5 changed files with 78 additions and 8 deletions

View File

@ -1806,9 +1806,13 @@ $tw.loadWikiTiddlers = function(wikiPath,options) {
// Save the original tiddler file locations if requested
var config = wikiInfo.config || {};
if(config["retain-original-tiddler-path"]) {
var output = {};
var output = {}, relativePath;
for(var title in $tw.boot.files) {
output[title] = path.relative(resolvedWikiPath,$tw.boot.files[title].filepath);
relativePath = path.relative(resolvedWikiPath,$tw.boot.files[title].filepath);
output[title] =
path.sep === path.posix.sep ?
relativePath :
relativePath.split(path.sep).join(path.posix.sep);
}
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/json", text: JSON.stringify(output)});
}

View File

@ -0,0 +1,20 @@
title: $:/ContributionBanner
tags: $:/tags/EditTemplate
list-after: $:/core/ui/EditTemplate/title
\define makeGitHubLink()
https://github.com/Jermolene/TiddlyWiki5/edit/master/editions/dev/tiddlers/$(githubLink)$
\end
\define innerMakeGitHubLink(linkText)
<$set name="githubLink" value={{$:/config/OriginalTiddlerPaths##$(draftOfTiddler)$}}>
<a href=<<makeGitHubLink>> class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer">$linkText$</a>
</$set>
\end
\define outerMakeGitHubLink(linkText)
<$set name="draftOfTiddler" value={{$(currentTiddler)$!!draft.of}}>
<<innerMakeGitHubLink "$linkText$">>
</$set>
\end
<div class="tc-improvement-banner">
{{$:/core/images/star-filled}} Can you help us improve this documentation? [ext[Find out how|https://tiddlywiki.com/#Improving%20TiddlyWiki%20Documentation]] to edit <<outerMakeGitHubLink "this tiddler on ~GitHub">>
</div>

View File

@ -0,0 +1,23 @@
title: $:/editions/tw5.com/TiddlerInfo/Sources
tags: $:/tags/TiddlerInfo
caption: Sources
\define github-link-base()
https://github.com/Jermolene/TiddlyWiki5/blob/master/editions/dev/tiddlers/$(title)$
\end
\define make-github-link()
<$set name="title" value={{$:/config/OriginalTiddlerPaths##$(currentTiddler)$}}>
<$set name="title" filter="[<title>encodeuricomponent[]]" select="0">
<a href=<<github-link-base>> class="tc-tiddlylink-external" target="_blank" rel="noopener noreferrer"><$text text=<<github-link-base>>/></a>
</$set>
</$set>
\end
<$list filter="[all[current]!is[system]!is[shadow]]">
Help us to improve the documentation by sending a ~GitHub pull request for this tiddler:
* <<make-github-link>>
</$list>

View File

@ -56,5 +56,8 @@
"--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
"--rendertiddlers","[!is[system]]","$:/core/templates/static.tiddler.html","static","text/plain",
"--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain"]
},
"config": {
"retain-original-tiddler-path": true
}
}

View File

@ -1,5 +1,5 @@
created: 20150124182421000
modified: 20150124184900000
modified: 20171212073225103
tags: [[Filter Syntax]]
title: Filter Expression
type: text/vnd.tiddlywiki
@ -14,15 +14,35 @@ type: text/vnd.tiddlywiki
A <<.def "filter expression">> is the outermost level of the [[filter syntax|Filter Syntax]]. It consists of one or more [[runs|Filter Run]].
A run's input is normally a list of all the non-[[shadow|ShadowTiddlers]] tiddler titles in the wiki (in no particular order). But the `+` prefix can change this.
If a run has:
* If a run has no `+` or `-` prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output.
* If a run has a `-` prefix, its output titles are <<.em removed>> from the filter's output (if they were present).
* If a run has a `+` prefix, it receives the filter's output so far as its input. The filter's output is then completely <<.em replaced>> by the run's output. Any subsequent run reverts to receiving all tiddler titles as its input, unless it too has a `+` prefix.
* no prefix, its output titles are [[dominantly appended|Dominant Append]] to the filter's output
* the prefix `-`, output titles are <<.em removed>> from the filter's output (if such tiddlers exist)
* the prefix `+`, it receives the filter output so far as its input; its output then <<.em "replaces">> all filter ouput so far and forms the input for the next run
In concise technical terms:
In technical / logical terms:
|!Run |!Interpretation |!Output |
|`run` |union of sets |... OR run |
|`+run` |intersection of sets |... AND run |
|`-run` |difference of sets |... AND NOT run |
A run's input is normally a list of all the non-[[shadow|ShadowTiddlers]] tiddler titles in the wiki (in no particular order). But the `+` prefix can change this:
|Prefix|Input|h
|`-` or none| <$link to="all Operator">`[all[]]`</$link> tiddler titles, unless otherwise determined by the first [[filter operator|Filter Operators]]|
|`+`|the filter output of all previous runs so far|
Precisely because of varying inputs, be aware that both prefixes `-` and `+` do not behave inverse to one another!
For example, in both of the following, `$:/baz` will only be removed if it actually exists:
* <$link to="is Operator"> `foo bar $:/baz -[is[system]]`</$link>
* <$link to="prefix Operator">`foo bar $:/baz -[prefix[$:/]]`</$link>
To understand why, consider the input for both final runs with their `-` prefix.
In order to remove `$:/baz` in any case, existing or not, simply use the `+` prefix with [[negated filter operators|Filter Operators]]:
* <$link to="is Operator">`foo bar $:/baz +[!is[system]]`</$link>
* <$link to="prefix Operator">`foo bar $:/baz +[!prefix[$:/]]`</$link>