1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Merge branch 'master' into multi-wiki-support

This commit is contained in:
Jeremy Ruston 2024-08-06 21:38:38 +01:00
commit 6492ed36bf
22 changed files with 163 additions and 36 deletions

View File

@ -231,7 +231,10 @@ rules:
prefer-spread: 'off'
prefer-template: 'off'
quote-props: 'off'
quotes: 'off'
quotes:
- error
- double
- avoidEscape: true
radix: 'off'
require-atomic-updates: error
require-await: error

View File

@ -21,7 +21,7 @@ body:
attributes:
label: To Reproduce
description: "Steps to reproduce the behavior:"
value: |
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@ -41,7 +41,7 @@ body:
attributes:
label: TiddlyWiki Configuration
description: please complete the following information
value: |
placeholder: |
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]

View File

@ -235,3 +235,7 @@ ViewTemplateBody/Caption: View Template Body
ViewTemplateBody/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the body of a tiddler.
ViewTemplateTitle/Caption: View Template Title
ViewTemplateTitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the title of a tiddler.
ViewTemplateSubtitle/Caption: View Template Subtitle
ViewTemplateSubtitle/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the subtitle of a tiddler.
ViewTemplateTags/Caption: View Template Tags
ViewTemplateTags/Hint: This rule cascade is used by the default view template to dynamically choose the template for displaying the tags area of a tiddler.

View File

@ -1,5 +1,5 @@
title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TiddlyWiki 5 compound tiddler
description: Compound tiddler
name: text/vnd.tiddlywiki-multiple
group: Developer
group-sort: 2

View File

@ -45,17 +45,22 @@ Render individual tiddlers and save the results to the specified files
variableList = variableList.slice(2);
}
$tw.utils.each(tiddlers,function(title) {
var filepath = path.resolve(self.commander.outputPath,wiki.filterTiddlers(filenameFilter,$tw.rootWidget,wiki.makeTiddlerIterator([title]))[0]);
if(self.commander.verbose) {
console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
var filenameResults = wiki.filterTiddlers(filenameFilter,$tw.rootWidget,wiki.makeTiddlerIterator([title]));
if(filenameResults.length > 0) {
var filepath = path.resolve(self.commander.outputPath,filenameResults[0]);
if(self.commander.verbose) {
console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
}
var parser = wiki.parseTiddler(template || title),
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title,storyTiddler: title})}),
container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent;
$tw.utils.createFileDirectories(filepath);
fs.writeFileSync(filepath,text,"utf8");
} else {
console.log("Not rendering \"" + title + "\" because the filename filter returned an empty result");
}
var parser = wiki.parseTiddler(template || title),
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title,storyTiddler: title})}),
container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent;
$tw.utils.createFileDirectories(filepath);
fs.writeFileSync(filepath,text,"utf8");
});
return null;
};

View File

@ -12,7 +12,7 @@ Upgrader module that suppresses certain system tiddlers that shouldn't be import
/*global $tw: false */
"use strict";
var DONT_IMPORT_LIST = ["$:/Import"],
var DONT_IMPORT_LIST = ["$:/Import", "$:/build"],
UNSELECT_PREFIX_LIST = ["$:/temp/","$:/state/","$:/StoryList","$:/HistoryList"],
WARN_IMPORT_PREFIX_LIST = ["$:/core/modules/"];

View File

@ -0,0 +1,9 @@
title: $:/core/ui/ControlPanel/ViewTemplateSubtitle
tags: $:/tags/ControlPanel/Cascades
caption: {{$:/language/ControlPanel/ViewTemplateSubtitle/Caption}}
\define lingo-base() $:/language/ControlPanel/ViewTemplateSubtitle/
<<lingo Hint>>
{{$:/tags/ViewTemplateSubtitleFilter||$:/snippets/ListTaggedCascade}}

View File

@ -0,0 +1,9 @@
title: $:/core/ui/ControlPanel/ViewTemplateTags
tags: $:/tags/ControlPanel/Cascades
caption: {{$:/language/ControlPanel/ViewTemplateTags/Caption}}
\define lingo-base() $:/language/ControlPanel/ViewTemplateTags/
<<lingo Hint>>
{{$:/tags/ViewTemplateTagsFilter||$:/snippets/ListTaggedCascade}}

View File

@ -2,10 +2,4 @@ title: $:/core/ui/ViewTemplate/subtitle
tags: $:/tags/ViewTemplate
\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler">
<$transclude tiddler=<<subtitleTiddler>> mode="inline"/><$list-join>&nbsp;</$list-join>
</$list>
</div>
</$reveal>
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateSubtitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/subtitle/default]] }}} />

View File

@ -0,0 +1,10 @@
title: $:/core/ui/ViewTemplate/subtitle/default
\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-subtitle">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler">
<$transclude tiddler=<<subtitleTiddler>> mode="inline"/><$list-join>&nbsp;</$list-join>
</$list>
</div>
</$reveal>

View File

@ -2,6 +2,4 @@ title: $:/core/ui/ViewTemplate/tags
tags: $:/tags/ViewTemplate
\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper"><$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/></div>
</$reveal>
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateTagsFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/tags/default]] }}} />

View File

@ -0,0 +1,11 @@
title: $:/core/ui/ViewTemplate/tags/default
\whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes">
<div class="tc-tags-wrapper">
<$list filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Tags]!has[draft.of]]">
<$transclude mode="inline"/>
</$list>
</div>
</$reveal>

View File

@ -0,0 +1,4 @@
title: $:/config/ViewTemplateSubtitleFilters/
tags: $:/tags/ViewTemplateSubtitleFilter
default: [[$:/core/ui/ViewTemplate/subtitle/default]]

View File

@ -0,0 +1,4 @@
title: $:/config/ViewTemplateTagsFilters/
tags: $:/tags/ViewTemplateTagsFilter
default: [[$:/core/ui/ViewTemplate/tags/default]]

View File

@ -0,0 +1,54 @@
title: ReservedWikiText
description: Verify that reserved wikitext constructions are not parsed
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Narrative
Verifies that certain wikitext constructions that are reserved for use by other tools are not parsed by TiddlyWiki.
+
title: TestTiddler
{%%}
(==)
{% %}
(= =)
{% something %}
(= something =)
Inline {% something %} substitution
Inline (= something =) substitution
Prefix-{%
Prefix-(=
%}-Postfix
=)-Postfix
{%
(=
%}
=)
+
title: Output
<$wikify name="parsetree" text={{TestTiddler}} output="parsetree">
<$text text={{{ [<parsetree>jsonget[0],[children],[0],[text]] }}}/>
</$wikify>
+
title: ExpectedResult
<p>
{%%}
(==)
{% %}
(= =)
{% something %}
(= something =)
Inline {% something %} substitution
Inline (= something =) substitution
Prefix-{%
Prefix-(=
%}-Postfix
=)-Postfix
{%
(=
%}
=)
</p>

View File

@ -1,5 +1,5 @@
title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TW5 - TiddlyWiki Wikitext Verbund Tiddler
description: Verbund Tiddler
name: text/vnd.tiddlywiki-multiple
group: Entwickler
group-sort: 2

View File

@ -236,3 +236,7 @@ ViewTemplateBody/Caption: 查看模板主体
ViewTemplateBody/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的主体。
ViewTemplateTitle/Caption: 查看模板标题
ViewTemplateTitle/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的标题。
ViewTemplateSubtitle/Caption: 查看模板副标题
ViewTemplateSubtitle/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的副标题。
ViewTemplateTags/Caption: 查看模板标签区
ViewTemplateTags/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的标签区域。

View File

@ -1,5 +1,5 @@
title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TiddlyWiki 5 复合条目
description: 复合条目
name: text/vnd.tiddlywiki-multiple
group: 开发者
group-sort: 2

View File

@ -235,4 +235,8 @@ Tools/Download/Full/Caption: 下載完整副本
ViewTemplateBody/Caption: 檢視範本主體
ViewTemplateBody/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的主體。
ViewTemplateTitle/Caption: 檢視範本標題
ViewTemplateTitle/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的標題。
ViewTemplateTitle/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的標題。
ViewTemplateSubtitle/Caption: 檢視範本副標題
ViewTemplateSubtitle/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的副標題。
ViewTemplateTags/Caption: 檢視範本標籤
ViewTemplateTags/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的標籤。

View File

@ -1,5 +1,5 @@
title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TiddlyWiki 5 複合條目
description: 複合條目
name: text/vnd.tiddlywiki-multiple
group: 開發者
group-sort: 2

View File

@ -53,13 +53,10 @@ If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>
lat="51.751944"
long="-1.257778"
alt="0"
text="""This is Oxford!"""/>
text="""{{$:/core/images/star-filled}} This is Oxford!"""/>
<$data title="Output" text="""<$geomap
state=<<qualify "$:/state/demo-map">>
>
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap>
"""/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
@ -80,7 +77,24 @@ If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>
</$list>
</$geomap>
"""/>
<$data $tiddler="ui/PopupTemplate"/>
<$data
title="Oxford"
tags="$:/tags/GeoMarker"
caption="Oxford"
lat="51.751944"
long="-1.257778"
alt="0"
text="""{{$:/core/images/star-filled}} This is Oxford!"""/>
properties=""/>
<$data title="ui/PopupTemplate" text="""
<div width="300px">
<$let currentTiddler={{{ [<feature>jsonget[properties],[title]] }}}>
<$link><$text text=<<currentTiddler>>/></$link>
<!-- <$codeblock code={{{ [<feature>] }}}/> -->
<$transclude $tiddler=<<currentTiddler>> $mode="block"/>
</$let>
</div>
"""/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase>

View File

@ -31,8 +31,8 @@ You can import language definitions into <$text text="JavaScript"/> tiddlers, wi
First, locate the language file(s) you need. You can fetch the files from the following CDNs:
* <a href=<<jsDelivrLink>>>jsDelivr</a>
* <a href=<<unpkgLink>>>unpkg</a>
* <a href=<<jsDelivrLink>> class="tc-tiddlylink-external" target="_blank">jsDelivr</a>
* <a href=<<unpkgLink>> class="tc-tiddlylink-external" target="_blank">unpkg</a>
Then, click the button below to create a "highlight" module. Copy and paste the content of a language file into the the text area. Give your tiddler a meaningful title so you can keep track of the languages you've installed. You may choose to either create one tiddler per language or lump all language definitions into one tiddler. Save and reload your wiki.