1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-21 11:49:44 +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-spread: 'off'
prefer-template: 'off' prefer-template: 'off'
quote-props: 'off' quote-props: 'off'
quotes: 'off' quotes:
- error
- double
- avoidEscape: true
radix: 'off' radix: 'off'
require-atomic-updates: error require-atomic-updates: error
require-await: error require-await: error

View File

@ -21,7 +21,7 @@ body:
attributes: attributes:
label: To Reproduce label: To Reproduce
description: "Steps to reproduce the behavior:" description: "Steps to reproduce the behavior:"
value: | placeholder: |
1. Go to '...' 1. Go to '...'
2. Click on '....' 2. Click on '....'
3. Scroll down to '....' 3. Scroll down to '....'
@ -41,7 +41,7 @@ body:
attributes: attributes:
label: TiddlyWiki Configuration label: TiddlyWiki Configuration
description: please complete the following information description: please complete the following information
value: | placeholder: |
- Version [e.g. v5.1.24] - Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc] - Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap] - 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. 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/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. 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 title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TiddlyWiki 5 compound tiddler description: Compound tiddler
name: text/vnd.tiddlywiki-multiple name: text/vnd.tiddlywiki-multiple
group: Developer group: Developer
group-sort: 2 group-sort: 2

View File

@ -45,7 +45,9 @@ Render individual tiddlers and save the results to the specified files
variableList = variableList.slice(2); variableList = variableList.slice(2);
} }
$tw.utils.each(tiddlers,function(title) { $tw.utils.each(tiddlers,function(title) {
var filepath = path.resolve(self.commander.outputPath,wiki.filterTiddlers(filenameFilter,$tw.rootWidget,wiki.makeTiddlerIterator([title]))[0]); 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) { if(self.commander.verbose) {
console.log("Rendering \"" + title + "\" to \"" + filepath + "\""); console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
} }
@ -56,6 +58,9 @@ Render individual tiddlers and save the results to the specified files
var text = type === "text/html" ? container.innerHTML : container.textContent; var text = type === "text/html" ? container.innerHTML : container.textContent;
$tw.utils.createFileDirectories(filepath); $tw.utils.createFileDirectories(filepath);
fs.writeFileSync(filepath,text,"utf8"); fs.writeFileSync(filepath,text,"utf8");
} else {
console.log("Not rendering \"" + title + "\" because the filename filter returned an empty result");
}
}); });
return null; return null;
}; };

View File

@ -12,7 +12,7 @@ Upgrader module that suppresses certain system tiddlers that shouldn't be import
/*global $tw: false */ /*global $tw: false */
"use strict"; "use strict";
var DONT_IMPORT_LIST = ["$:/Import"], var DONT_IMPORT_LIST = ["$:/Import", "$:/build"],
UNSELECT_PREFIX_LIST = ["$:/temp/","$:/state/","$:/StoryList","$:/HistoryList"], UNSELECT_PREFIX_LIST = ["$:/temp/","$:/state/","$:/StoryList","$:/HistoryList"],
WARN_IMPORT_PREFIX_LIST = ["$:/core/modules/"]; 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 tags: $:/tags/ViewTemplate
\whitespace trim \whitespace trim
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes"> <$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateSubtitleFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/subtitle/default]] }}} />
<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

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

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 title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TW5 - TiddlyWiki Wikitext Verbund Tiddler description: Verbund Tiddler
name: text/vnd.tiddlywiki-multiple name: text/vnd.tiddlywiki-multiple
group: Entwickler group: Entwickler
group-sort: 2 group-sort: 2

View File

@ -236,3 +236,7 @@ ViewTemplateBody/Caption: 查看模板主体
ViewTemplateBody/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的主体。 ViewTemplateBody/Hint: 默认的查看模板使用此规则级联,动态选择模板以显示条目的主体。
ViewTemplateTitle/Caption: 查看模板标题 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 title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TiddlyWiki 5 复合条目 description: 复合条目
name: text/vnd.tiddlywiki-multiple name: text/vnd.tiddlywiki-multiple
group: 开发者 group: 开发者
group-sort: 2 group-sort: 2

View File

@ -236,3 +236,7 @@ ViewTemplateBody/Caption: 檢視範本主體
ViewTemplateBody/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的主體。 ViewTemplateBody/Hint: 預設的檢視範本使用此規則級聯,動態選擇範本以顯示條目的主體。
ViewTemplateTitle/Caption: 檢視範本標題 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 title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple
description: TiddlyWiki 5 複合條目 description: 複合條目
name: text/vnd.tiddlywiki-multiple name: text/vnd.tiddlywiki-multiple
group: 開發者 group: 開發者
group-sort: 2 group-sort: 2

View File

@ -53,13 +53,10 @@ If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>
lat="51.751944" lat="51.751944"
long="-1.257778" long="-1.257778"
alt="0" alt="0"
text="""This is Oxford!"""/> text="""{{$:/core/images/star-filled}} This is Oxford!"""/>
<$data title="Output" text="""<$geomap <$data title="Output" text="""<$geomap
state=<<qualify "$:/state/demo-map">> state=<<qualify "$:/state/demo-map">>
> >
<$list filter="[all[tiddlers+shadows]tag[$:/tags/GeoMarker]]">
<$geolayer lat={{!!lat}} long={{!!long}} alt={{!!alt}} color={{!!color}}/>
</$list>
</$geomap> </$geomap>
"""/> """/>
<$data $tiddler="$:/plugins/tiddlywiki/geospatial"/> <$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
@ -80,7 +77,24 @@ If no base layers are defined by `<$geobaselayer>` widgets within the `<$geomap>
</$list> </$list>
</$geomap> </$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"/> <$data $tiddler="$:/plugins/tiddlywiki/geospatial"/>
</$testcase> </$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: First, locate the language file(s) you need. You can fetch the files from the following CDNs:
* <a href=<<jsDelivrLink>>>jsDelivr</a> * <a href=<<jsDelivrLink>> class="tc-tiddlylink-external" target="_blank">jsDelivr</a>
* <a href=<<unpkgLink>>>unpkg</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. 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.