diff --git a/bin/build-site.sh b/bin/build-site.sh index fd1430199..f8270cec6 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -5,7 +5,7 @@ # Default to the current version number for building the plugin library if [ -z "$TW5_BUILD_VERSION" ]; then - TW5_BUILD_VERSION=v5.2.4 + TW5_BUILD_VERSION=v5.2.5 fi echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]" diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index ca1739b76..d8321edbf 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -90,8 +90,8 @@ Plugins/Languages/Caption: Languages Plugins/Languages/Hint: Language pack plugins Plugins/NoInfoFound/Hint: No ''"<$text text=<>/>"'' found Plugins/NotInstalled/Hint: This plugin is not currently installed -Plugins/OpenPluginLibrary: open plugin library -Plugins/ClosePluginLibrary: close plugin library +Plugins/OpenPluginLibrary: Open plugin library +Plugins/ClosePluginLibrary: Close plugin library Plugins/PluginWillRequireReload: (requires reload) Plugins/Plugins/Caption: Plugins Plugins/Plugins/Hint: Plugins diff --git a/core/modules/filters/json-ops.js b/core/modules/filters/json-ops.js index d5e8c33af..eabf6433e 100644 --- a/core/modules/filters/json-ops.js +++ b/core/modules/filters/json-ops.js @@ -17,9 +17,23 @@ exports["jsonget"] = function(source,operator,options) { source(function(tiddler,title) { var data = $tw.utils.parseJSONSafe(title,title); if(data) { - var item = getDataItemValueAsString(data,operator.operands); + var items = getDataItemValueAsStrings(data,operator.operands); + if(items !== undefined) { + results.push.apply(results,items); + } + } + }); + return results; +}; + +exports["jsonextract"] = function(source,operator,options) { + var results = []; + source(function(tiddler,title) { + var data = $tw.utils.parseJSONSafe(title,title); + if(data) { + var item = getDataItem(data,operator.operands); if(item !== undefined) { - results.push(item); + results.push(JSON.stringify(item)); } } }); @@ -31,9 +45,9 @@ exports["jsonindexes"] = function(source,operator,options) { source(function(tiddler,title) { var data = $tw.utils.parseJSONSafe(title,title); if(data) { - var item = getDataItemKeysAsStrings(data,operator.operands); - if(item !== undefined) { - results.push.apply(results,item); + var items = getDataItemKeysAsStrings(data,operator.operands); + if(items !== undefined) { + results.push.apply(results,items); } } }); @@ -57,11 +71,11 @@ exports["jsontype"] = function(source,operator,options) { /* Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid */ -function getDataItemValueAsString(data,indexes) { +function getDataItemValueAsStrings(data,indexes) { // Get the item var item = getDataItem(data,indexes); - // Return the item as a string - return convertDataItemValueToString(item); + // Return the item as a string list + return convertDataItemValueToStrings(item); } /* @@ -77,15 +91,34 @@ function getDataItemKeysAsStrings(data,indexes) { /* Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined */ -function convertDataItemValueToString(item) { +function convertDataItemValueToStrings(item) { // Return the item as a string if(item === undefined) { - return item; + return undefined; + } else if(item === null) { + return ["null"] + } else if(typeof item === "object") { + var results = [],i,t; + if($tw.utils.isArray(item)) { + // Return all the items in arrays recursively + for(i=0; i> diff --git a/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid b/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid index 88a007d50..a119d4095 100644 --- a/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +++ b/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid @@ -1,6 +1,6 @@ title: $:/config/OfficialPluginLibrary tags: $:/tags/PluginLibrary -url: https://tiddlywiki.com/prerelease/library/v5.2.4/index.html +url: https://tiddlywiki.com/prerelease/library/v5.2.5/index.html caption: {{$:/language/OfficialPluginLibrary}} (Prerelease) The prerelease version of the official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team. diff --git a/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid b/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid index 7dd4e1f01..96aee607c 100644 --- a/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid +++ b/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid @@ -1,7 +1,11 @@ title: TiddlyWiki Pre-release modified: 20150428204930183 -This is a pre-release build of TiddlyWiki, [[also available in empty form|https://tiddlywiki.com/prerelease/empty.html]]. It is provided for testing purposes. ''Please don't try to use it for anything important'' -- you should use the latest official release from https://tiddlywiki.com. +This is a pre-release build of TiddlyWiki provided for testing and review purposes. ''Please don't try to depend on the pre-release for anything important'' -- you should use the latest official release from https://tiddlywiki.com. + +All of the changes in this pre-release are provisional until it is released and they become frozen by our backwards compatibility policies. This is the perfect time to raise questions or make suggestions. Please [[open a ticket at GitHub|https://github.com/Jermolene/TiddlyWiki5/issues/new/choose]] or make a post at https://talk.tiddlywiki.org/. + +The pre-release is also available as an [[empty wiki|https://tiddlywiki.com/prerelease/empty.html]] ready for reuse. <$list filter="[tag[ReleaseNotes]!has[released]!sort[created]]">
diff --git a/editions/test/tiddlers/tests/test-json-filters.js b/editions/test/tiddlers/tests/test-json-filters.js index c892c2419..b7f4836d9 100644 --- a/editions/test/tiddlers/tests/test-json-filters.js +++ b/editions/test/tiddlers/tests/test-json-filters.js @@ -23,7 +23,7 @@ describe("json filter tests", function() { type: "application/json" },{ title: "Second", - text: '["une","deux","trois"]', + text: '["une","deux","trois",["quatre","cinq"]]', type: "application/json" },{ title: "Third", @@ -38,14 +38,14 @@ describe("json filter tests", function() { it("should support the jsonget operator", function() { expect(wiki.filterTiddlers("[{Third}jsonget[]]")).toEqual(["This is not JSON"]); - expect(wiki.filterTiddlers("[{First}jsonget[]]")).toEqual(['{"a":"one","b":"","c":1.618,"d":{"e":"four","f":["five","six",true,false,null]}}']); + expect(wiki.filterTiddlers("[{Second}jsonget[]]")).toEqual(["une","deux","trois","quatre","cinq"]); + expect(wiki.filterTiddlers("[{First}jsonget[]]")).toEqual(["one","","1.618","four","five","six","true","false","null"]); expect(wiki.filterTiddlers("[{First}jsonget[a]]")).toEqual(["one"]); expect(wiki.filterTiddlers("[{First}jsonget[b]]")).toEqual([""]); expect(wiki.filterTiddlers("[{First}jsonget[missing-property]]")).toEqual([]); - expect(wiki.filterTiddlers("[{First}jsonget[d]]")).toEqual(['{"e":"four","f":["five","six",true,false,null]}']); - expect(wiki.filterTiddlers("[{First}jsonget[d]jsonget[f]]")).toEqual(['["five","six",true,false,null]']); + expect(wiki.filterTiddlers("[{First}jsonget[d]]")).toEqual(["four","five","six","true","false","null"]); expect(wiki.filterTiddlers("[{First}jsonget[d],[e]]")).toEqual(["four"]); - expect(wiki.filterTiddlers("[{First}jsonget[d],[f]]")).toEqual(['["five","six",true,false,null]']); + expect(wiki.filterTiddlers("[{First}jsonget[d],[f]]")).toEqual(["five","six","true","false","null"]); expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[0]]")).toEqual(["five"]); expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[1]]")).toEqual(["six"]); expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[2]]")).toEqual(["true"]); @@ -53,8 +53,25 @@ describe("json filter tests", function() { expect(wiki.filterTiddlers("[{First}jsonget[d],[f],[4]]")).toEqual(["null"]); }); + it("should support the jsonextract operator", function() { + expect(wiki.filterTiddlers("[{Third}jsonextract[]]")).toEqual(['"This is not JSON"']); + expect(wiki.filterTiddlers("[{First}jsonextract[]]")).toEqual(['{"a":"one","b":"","c":1.618,"d":{"e":"four","f":["five","six",true,false,null]}}']); + expect(wiki.filterTiddlers("[{First}jsonextract[a]]")).toEqual(['"one"']); + expect(wiki.filterTiddlers("[{First}jsonextract[b]]")).toEqual(['""']); + expect(wiki.filterTiddlers("[{First}jsonextract[missing-property]]")).toEqual([]); + expect(wiki.filterTiddlers("[{First}jsonextract[d]]")).toEqual(['{"e":"four","f":["five","six",true,false,null]}']); + expect(wiki.filterTiddlers("[{First}jsonextract[d]jsonextract[f]]")).toEqual(['["five","six",true,false,null]']); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[e]]")).toEqual(['"four"']); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[f]]")).toEqual(['["five","six",true,false,null]']); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[f],[0]]")).toEqual(['"five"']); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[f],[1]]")).toEqual(['"six"']); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[f],[2]]")).toEqual(["true"]); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[f],[3]]")).toEqual(["false"]); + expect(wiki.filterTiddlers("[{First}jsonextract[d],[f],[4]]")).toEqual(["null"]); + }); + it("should support the jsonindexes operator", function() { - expect(wiki.filterTiddlers("[{Second}jsonindexes[]]")).toEqual(["0","1","2"]); + expect(wiki.filterTiddlers("[{Second}jsonindexes[]]")).toEqual(["0","1","2","3"]); expect(wiki.filterTiddlers("[{First}jsonindexes[]]")).toEqual(["a","b","c","d"]); expect(wiki.filterTiddlers("[{First}jsonindexes[a]]")).toEqual([]); expect(wiki.filterTiddlers("[{First}jsonindexes[b]]")).toEqual([]); diff --git a/editions/translators/tiddlywiki.info b/editions/translators/tiddlywiki.info index b08c5ceda..b2cc4f7ba 100644 --- a/editions/translators/tiddlywiki.info +++ b/editions/translators/tiddlywiki.info @@ -12,7 +12,6 @@ "de-CH", "de-DE", "el-GR", - "en-GB", "en-US", "es-ES", "fa-IR", diff --git a/editions/tw5.com/tiddlers/features/JSON in TiddlyWiki.tid b/editions/tw5.com/tiddlers/features/JSON in TiddlyWiki.tid index 2f2edd09f..cd827ddb6 100644 --- a/editions/tw5.com/tiddlers/features/JSON in TiddlyWiki.tid +++ b/editions/tw5.com/tiddlers/features/JSON in TiddlyWiki.tid @@ -2,7 +2,7 @@ title: JSON in TiddlyWiki tags: Features type: text/vnd.tiddlywiki created: 20220427174702859 -modified: 20220427174702859 +modified: 20220611104737314 !! Introduction diff --git a/editions/tw5.com/tiddlers/filters/jsonextract.tid b/editions/tw5.com/tiddlers/filters/jsonextract.tid new file mode 100644 index 000000000..15517e110 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/jsonextract.tid @@ -0,0 +1,66 @@ +created: 20220611104737314 +modified: 20220611104737314 +tags: [[Filter Operators]] [[JSON Operators]] +title: jsonextract Operator +caption: jsonextract +op-purpose: retrieve the JSON string of a property from JSON strings +op-input: a selection of JSON strings +op-parameter: one or more indexes of the property to retrieve +op-output: the JSON string values of each of the retrieved properties + +<<.from-version "5.2.4">> See [[JSON in TiddlyWiki]] for background. + +The <<.op jsonextract>> operator is used to retrieve values from JSON data as JSON substrings. See also the following related operators: + +* <<.olink jsonget>> to retrieve the values of a property in JSON data +* <<.olink jsontype>> to retrieve the type of a JSON value +* <<.olink jsonindexes>> to retrieve the names of the fields of a JSON object, or the indexes of a JSON array + +Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`. + +``` +{ + "a": "one", + "b": "", + "c": "three", + "d": { + "e": "four", + "f": [ + "five", + "six", + true, + false, + null + ], + "g": { + "x": "max", + "y": "may", + "z": "maize" + } + } +} +``` + +The following examples assume that this JSON data is contained in a variable called `jsondata`. + +The <<.op jsonextract>> operator uses multiple operands to specify the indexes of the property to retrieve. Values are returned as literal JSON strings: + +``` +[jsonextract[a]] --> "one" +[jsonextract[d],[e]] --> "four" +[jsonextract[d],[f],[0]] --> "five" +[jsonextract[d],[f]] --> ["five","six",true,false,null] +[jsonextract[d],[g]] --> {"x":"max","y":"may","z":"maize"} +``` + +Indexes can be dynamically composed from variables and transclusions: + +``` +[jsonextract,{!!field},[0]] +``` + +A subtlety is that the special case of a single blank operand is used to identify the root object. Thus: + +``` +[jsonextract[]] --> {"a":"one","b":"","c":"three","d":{"e":"four","f":["five","six",true,false,null],"g":{"x":"max","y":"may","z":"maize"}}} +``` diff --git a/editions/tw5.com/tiddlers/filters/jsonget.tid b/editions/tw5.com/tiddlers/filters/jsonget.tid index dbc247d7b..d9caa680e 100644 --- a/editions/tw5.com/tiddlers/filters/jsonget.tid +++ b/editions/tw5.com/tiddlers/filters/jsonget.tid @@ -10,10 +10,11 @@ op-output: the values of each of the retrieved properties <<.from-version "5.2.4">> See [[JSON in TiddlyWiki]] for background. -The <<.op jsonget>> operator is used to retrieve values from JSON data. See also the following related operators: +The <<.op jsonget>> operator is used to retrieve values from JSON data as strings. See also the following related operators: * <<.olink jsontype>> to retrieve the type of a JSON value * <<.olink jsonindexes>> to retrieve the names of the fields of a JSON object, or the indexes of a JSON array +* <<.olink jsonextract>> to retrieve a JSON value as a string of JSON Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`. @@ -65,11 +66,11 @@ Boolean values and null are returned as normal strings. The <<.olink jsontype>> [jsontype[d],[f],[2]] --> "boolean" ``` -Using the <<.op jsonget>> operator to retrieve an object or an array returns a JSON string of the values. For example: +Using the <<.op jsonget>> operator to retrieve an object or an array returns a list of the values. For example: ``` -[jsonget[d],[f]] --> `["five","six",true,false,null]` -[jsonget[d],[g]] --> `{"x": "max","y": "may","z": "maize"}` +[jsonget[d],[f]] --> "five","six","true","false","null" +[jsonget[d],[g]] --> "max","may","maize" ``` The <<.olink jsonindexes>> operator retrieves the corresponding indexes: @@ -79,6 +80,12 @@ The <<.olink jsonindexes>> operator retrieves the corresponding indexes: [jsonindexes[d],[g]] --> "x", "y", "z" ``` +If the object or array contains nested child objects or arrays then the values are retrieved recursively and returned flattened into a list. For example: + +``` +[jsonget[d]] --> "four","five","six","true","false","null","max","may","maize" +``` + A subtlety is that the special case of a single blank operand is used to identify the root object. Thus: ``` diff --git a/editions/tw5.com/tiddlers/filters/jsonindexes.tid b/editions/tw5.com/tiddlers/filters/jsonindexes.tid index 933f0f101..605936a2f 100644 --- a/editions/tw5.com/tiddlers/filters/jsonindexes.tid +++ b/editions/tw5.com/tiddlers/filters/jsonindexes.tid @@ -14,6 +14,7 @@ The <<.op jsonindexes>> operator is used to retrieve the property names of JSON * <<.olink jsonget>> to retrieve the values of a property in JSON data * <<.olink jsontype>> to retrieve the type of a JSON value +* <<.olink jsonextract>> to retrieve a JSON value as a string of JSON Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`. diff --git a/editions/tw5.com/tiddlers/filters/jsontype.tid b/editions/tw5.com/tiddlers/filters/jsontype.tid index 766757af0..b88f865dd 100644 --- a/editions/tw5.com/tiddlers/filters/jsontype.tid +++ b/editions/tw5.com/tiddlers/filters/jsontype.tid @@ -14,6 +14,7 @@ The <<.op jsontype>> operator is used to retrieve the type of a property in JSON * <<.olink jsonget>> to retrieve the values of a property in JSON data * <<.olink jsonindexes>> to retrieve the names of the fields of a JSON object, or the indexes of a JSON array +* <<.olink jsonextract>> to retrieve a JSON value as a string of JSON JSON supports the following data types: diff --git a/editions/tw5.com/tiddlers/hellothere/HelloThere.tid b/editions/tw5.com/tiddlers/hellothere/HelloThere.tid index dec5d87b4..044c9cfb5 100644 --- a/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +++ b/editions/tw5.com/tiddlers/hellothere/HelloThere.tid @@ -1,6 +1,6 @@ created: 20130822170200000 list: [[A Gentle Guide to TiddlyWiki]] [[Discover TiddlyWiki]] [[Some of the things you can do with TiddlyWiki]] [[Ten reasons to switch to TiddlyWiki]] Examples [[What happened to the original TiddlyWiki?]] -modified: 20221204165636777 +modified: 20221213163110439 tags: TableOfContents title: HelloThere type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid b/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid index f076ced60..1fd773caa 100644 --- a/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid +++ b/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid @@ -5,4 +5,4 @@ image: Grok TiddlyWiki Banner caption: Grok ~TiddlyWiki link: "Grok TiddlyWiki" by Soren Bjornstad -A guided tutorial through ~TiddlyWiki \ No newline at end of file +Everything you need to know to get the best out of ~TiddlyWiki \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/howtos/Reading data from JSON tiddlers.tid b/editions/tw5.com/tiddlers/howtos/Reading data from JSON tiddlers.tid index acf482789..8f7968de0 100644 --- a/editions/tw5.com/tiddlers/howtos/Reading data from JSON tiddlers.tid +++ b/editions/tw5.com/tiddlers/howtos/Reading data from JSON tiddlers.tid @@ -1,11 +1,20 @@ created: 20220427174702859 -modified: 20220427171449102 +modified: 20220611104737314 tags: [[JSON in TiddlyWiki]] Learning title: Reading data from JSON tiddlers type: text/vnd.tiddlywiki See [[JSON in TiddlyWiki]] for an overview of using JSON in TiddlyWiki. +!! Filter Operators for Accessing JSON Data + +The following filter operators allow values to be read from JSON data: + +* <<.olink jsonget>> to retrieve the values of a property in JSON data +* <<.olink jsontype>> to retrieve the type of a JSON value +* <<.olink jsonindexes>> to retrieve the names of the fields of a JSON object, or the indexes of a JSON array +* <<.olink jsonextract>> to retrieve a JSON value as a string of JSON + !! Text References for Accessing JSON Data [[Text references|TextReference]] are a simple shortcut syntax to look up the value of a named property. For example, if a [[DictionaryTiddler|DictionaryTiddlers]] called `MonthDays` contains: diff --git a/editions/tw5.com/tiddlers/images/New Release Banner.png b/editions/tw5.com/tiddlers/images/New Release Banner.png index 5fd68f349..253f51f45 100644 Binary files a/editions/tw5.com/tiddlers/images/New Release Banner.png and b/editions/tw5.com/tiddlers/images/New Release Banner.png differ diff --git a/editions/prerelease/tiddlers/Release 5.2.4.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid similarity index 88% rename from editions/prerelease/tiddlers/Release 5.2.4.tid rename to editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid index e21fe7d98..822ef8651 100644 --- a/editions/prerelease/tiddlers/Release 5.2.4.tid +++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid @@ -1,11 +1,12 @@ caption: 5.2.4 -created: 20221127133944178 -modified: 20221127133944178 +created: 20221213163110439 +modified: 20221213163110439 +released: 20221213163110439 tags: ReleaseNotes title: Release 5.2.4 type: text/vnd.tiddlywiki -//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.3...master]]// +//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.3...v5.2.4]]// <<.banner-credits credit:"""Congratulations to [[dmikh|https://talk.tiddlywiki.org/u/dmikh]] for their winning design for the banner for this release (here is the [[competition thread|https://talk.tiddlywiki.org/t/new-release-banner-competition-for-v5-2-4/4982]] and the [[voting thread|https://talk.tiddlywiki.org/t/vote-for-the-v5-2-4-new-release-banner/5140/2]]). @@ -19,19 +20,20 @@ New [ext[Twitter Archivist|./editions/twitter-archivist]] plugin to import the t <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6961">> new GenesisWidget that allows the dynamic construction of another widget, where the name and attributes of the new widget can be dynamically determined, without needing to be known in advance -<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6936">> new operators for reading and formatting JSON data: [[jsonget Operator]], [[jsonindexes Operator]], [[jsontype Operator]] and [[format Operator]] +<<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6936">> (and <<.link-badge-here "https://github.com/Jermolene/TiddlyWiki5/pull/7105">>) new operators for reading and formatting JSON data: [[jsonget Operator]], [[jsonindexes Operator]], [[jsontype Operator]], [[jsonextract Operator]] and [[format Operator]] -! Translation improvement +! Translation Improvements Improvements to the following translations: * Chinese * French +* German * Polish * Spanish * Japanese -Improvements to the translation features of TiddlyWiki: +Improvements to the translation features of TiddlyWiki itself: * <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6882">> the [[Translators Edition|Translate TiddlyWiki into your language]] to add an option to display the original English text underneath the text area * <<.link-badge-updated "https://github.com/Jermolene/TiddlyWiki5/pull/6933">> "delete" button text in $:/AdvancedSearch so that it is translatable @@ -75,22 +77,25 @@ Improvements to the translation features of TiddlyWiki: * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7043">> support for Unix epoch timestamps in [[date format strings|DateFormat]] * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7064">> the "big green download button" to use the defined palette colour * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7063">> new hidden setting [[to use horizontal tabs for the "more" sidebar tab|Hidden Setting: More Tabs Horizontal]] - +* <<.link-badge-extended "https://github.com/Jermolene/TiddlyWiki5/commit/bef11fe6a25fb849dee40c4aa4337d6a30daf0b4">> the [[external JavaScript templates|Using the external JavaScript template]] to allow the URL of the external script file to be configured ! Bug Fixes +* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7099">> truncated search results on small screens +* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7010">> table contents overflow on small screens * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/fb34df84ed41882c1c2a6ff54f0e908b43ef95a3">> "new image" keyboard shortcut not to assign journal tags * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/6987">> SelectWidget class to update if it uses a filter * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7017">> issue with wikification within the advanced search filter dropdown * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7057">> the table in $:/Import to avoid creating hidden empty rows * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7008">> advanced search keyboard shortcut not navigating correctly * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/issues/7083">> erroneous display of drafts within the advanced search filter dropdown +* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7092">> backwards compatibility of new field editor cascade introduced in v5.2.3 ! Node.js Improvements * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7073">> new CommandsCommand to enable command tokens to be dynamically generated from a filter * <<.link-badge-improved "https://github.com/Jermolene/TiddlyWiki5/pull/6947">> console logging to avoid spaces and `` message -* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7014">> problem with lazy loading deleting tiddler bodies under certian circumstances +* <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/pull/7014">> problem with lazy loading deleting tiddler bodies under certain circumstances * <<.link-badge-fixed "https://github.com/Jermolene/TiddlyWiki5/commit/344110e2890caf711ab8f3c4f4deaa7d86771231">> handling of ".mp4" file extension so that it defaults to video not audio * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/6588">> test server to the plugin library edition * <<.link-badge-added "https://github.com/Jermolene/TiddlyWiki5/pull/7049">> [[Hidden Setting: Sync Logging]] to control logging of sync-related messages @@ -111,7 +116,7 @@ AnthonyMuscio bestony btheado BramChen -carlo-columbo +carlo-colombo EvidentlyCube FlashSystems flibbles @@ -126,7 +131,9 @@ pmario rmunn roma0104 saqimtiaz +simonbaird talha131 +Telumire tw-FRed twMat xcazin diff --git a/editions/tw5.com/tiddlers/saving/Saving on TiddlyHost.tid b/editions/tw5.com/tiddlers/saving/Saving on TiddlyHost.tid index 7cb9a1ec7..8931c71be 100644 --- a/editions/tw5.com/tiddlers/saving/Saving on TiddlyHost.tid +++ b/editions/tw5.com/tiddlers/saving/Saving on TiddlyHost.tid @@ -3,7 +3,7 @@ color: #29B6F6 community-author: Simon Baird created: 20210422191232572 delivery: Service -description: Online service for creating and hosting TiddlyWikis +description: Online service for creating and hosting ~TiddlyWikis method: save modified: 20210423003921468 tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera PHP Safari Saving Windows iOS Edge diff --git a/editions/tw5.com/tiddlers/saving/Saving on TiddlySpot.tid b/editions/tw5.com/tiddlers/saving/Saving on TiddlySpot.tid index e65d171ae..c66587102 100644 --- a/editions/tw5.com/tiddlers/saving/Saving on TiddlySpot.tid +++ b/editions/tw5.com/tiddlers/saving/Saving on TiddlySpot.tid @@ -6,7 +6,6 @@ delivery: Service description: Online TiddlyWiki hosting. (Deprecated in favour of TiddlyHost) method: save modified: 20210423004027196 -tags: Android Chrome Firefox [[Internet Explorer]] Linux Mac Opera PHP Safari Saving Windows iOS Edge title: Saving on TiddlySpot type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/saving/Saving.tid b/editions/tw5.com/tiddlers/saving/Saving.tid index 9b55b1d1d..85c5d47ae 100644 --- a/editions/tw5.com/tiddlers/saving/Saving.tid +++ b/editions/tw5.com/tiddlers/saving/Saving.tid @@ -32,9 +32,16 @@ type: text/vnd.tiddlywiki \define checkactions(item:"Linux") <$action-listops $tiddler=<> $subfilter="[[$item$]]"/> \end -<$vars stateTiddler=<> > -Available methods for saving changes with ~TiddlyWiki: +\define introduction-message() +
+
+Use the checkboxes to explore the methods of saving that work with your platform(s) +
+
+\end + +<$vars stateTiddler=<> >
@@ -56,7 +63,7 @@ Available methods for saving changes with ~TiddlyWiki:
<$wikify text=<> name="alltagsfilterwikified"> -<$list filter=<>> +<$list filter=<> emptyMessage=<>> {{||$:/_tw5.com-card-template}} diff --git a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid index 06b9b7210..d6d00f86f 100644 --- a/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +++ b/editions/tw5.com/tiddlers/system/tw5.com-styles.tid @@ -122,6 +122,15 @@ type: text/vnd.tiddlywiki margin-left: 10px; } +.tc-saving-introduction { + display: flex; + justify-content: center; + text-align: center; + align-items: center; + padding: 4em; + font-style: italic; +} + .tc-cards { display: flex; flex-wrap: wrap; diff --git a/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid b/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid index df21e9b16..918878b0d 100644 --- a/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid +++ b/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid @@ -1,22 +1,22 @@ created: 20180905075846391 -modified: 20210611055708739 +modified: 20221207112242775 tags: [[WebServer Guides]] title: Using the external JavaScript template type: text/vnd.tiddlywiki -You can use a special template to externalise TiddlyWiki's core code into a separate file. This configuration allows the browser to cache the core for improved efficiency. +You can use a special template to externalise ~TiddlyWiki's core code into a separate file. This configuration allows the browser to cache the core for improved efficiency. ! Background -TiddlyWiki in the single file configuration ordinarily packs everything into a single file: your data, and the ~JavaScript, CSS and HTML comprising TiddlyWiki itself. This lack of dependencies is usually very convenient: it means that it is impossible for the parts of a TiddlyWiki to become separated, and enormously improves the chances of it still functioning in the future. +~TiddlyWiki in the single file configuration ordinarily packs everything into a single file: your data, and the ~JavaScript, CSS and HTML comprising ~TiddlyWiki itself. This lack of dependencies is usually very convenient: it means that it is impossible for the parts of a ~TiddlyWiki to become separated, and enormously improves the chances of it still functioning in the future. However, there is some inefficiency in this arrangement because the core code is repeatedly loaded and saved every time the content of the wiki is saved. This inefficiency is partially ameliorated when working in the client server configuration because once the wiki is loaded by the browser the synchronisation process only transmits individual tiddlers back and forth to the server. -The remaining inefficiency when working in the client server configuration is that the single page wiki that is initially loaded will contain a copy of the entire core code of TiddlyWiki, making it impossible for the browser to cache it. +The remaining inefficiency when working in the client server configuration is that the single page wiki that is initially loaded will contain a copy of the entire core code of ~TiddlyWiki, making it impossible for the browser to cache it. -! Using the external JavaScript template with the client-server configuration +! Using the external ~JavaScript template with the client-server configuration -The mechanism is activated by setting the [[root-tiddler|WebServer Parameter: root-tiddler]] parameter to `$:/core/save/all-external-js`. This template externalises TiddlyWiki's core JavaScript into a separate file. For example, the following command will start your server with caching enabled. It will transfer the wiki with two GET requests, and the core can be cached by the browser. +The mechanism is activated by setting the [[root-tiddler|WebServer Parameter: root-tiddler]] parameter to `$:/core/save/all-external-js`. This template externalises ~TiddlyWiki's core ~JavaScript into a separate file. For example, the following command will start your server with caching enabled. It will transfer the wiki with two GET requests, and the core can be cached by the browser. ``` tiddlywiki YOUR_WIKI_FOLDER --listen 'root-tiddler=$:/core/save/all-external-js' use-browser-cache=yes @@ -38,11 +38,11 @@ tiddlywiki ./myNewWiki --build listen The above commands perform the following: * Create a new wiki with external JavaScript customization included. -* Start the server with external JavaScript enabled. The server listens on port 8080. Visit http://localhost:8080 in your browser. +* Start the server with external ~JavaScript enabled. The server listens on port 8080. Visit http://localhost:8080 in your browser. To customize your `--build listen` command, see [[tiddlywiki.info Files]] and [[ListenCommand]]. -! Using the external JavaScript template with the single file configuration +! Using the external ~JavaScript template with the single file configuration You can use the "external-js" template with your single file wiki, but this requires that you have ~TiddlyWiki's core ~JavaScript saved alongside your HTML file. You may prefer this configuration, for example, if you have several wikis on a ~WebDav server. (See: [[Saving via WebDAV]]) @@ -64,7 +64,7 @@ The files `index.html` and `tiddlywikicore-5.x.x.js` will be saved in your wiki !! Obtaining the ~TiddlyWiki core in the browser -To download a copy of the TiddlyWiki core JavaScript file from any existing TiddlyWiki, visit the system tiddler $:/core/ui/ExportTiddlyWikiCore and click the download button. (You can search for ''~ExportTiddlyWikiCore'' in the ''Shadows'' tab of $:/AdvancedSearch). +{{$:/core/ui/ExportTiddlyWikiCore}} !! Obtaining the ~TiddlyWiki core with Node.js @@ -87,7 +87,7 @@ tiddlywiki YOUR_WIKI_FOLDER --build tiddlywikicore <<.warning "This procedure is experimental, please take care to backup your data">> -Before you proceed, backup your wiki first! Follow the steps below to upgrade a single-file wiki with the external JavaScript template: +Before you proceed, backup your wiki first! Follow the steps below to upgrade a single-file wiki with the external ~JavaScript template: # Proceed with the [[Upgrade Process for Standalone TiddlyWikis|Upgrading]]. Your wiki will be converted to a full standalone HTML. diff --git a/package.json b/package.json index 68e44ff3c..24023f900 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tiddlywiki", "preferGlobal": "true", - "version": "5.2.4-prerelease", + "version": "5.2.5-prerelease", "author": "Jeremy Ruston ", "description": "a non-linear personal web notebook", "contributors": [ diff --git a/readme.md b/readme.md index 120173bca..548018899 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@

Welcome to TiddlyWiki, a non-linear personal web notebook that anyone can use and keep forever, independently of any corporation.

TiddlyWiki is a complete interactive wiki in JavaScript. It can be used as a single HTML file in the browser or as a powerful Node.js application. It is highly customisable: the entire user interface is itself implemented in hackable WikiText.

Learn more and see it in action at https://tiddlywiki.com/

Developer documentation is in progress at https://tiddlywiki.com/dev/

Join the Community

Official Forums

The new official forum for talking about TiddlyWiki: requests for help, announcements of new releases and plugins, debating new features, or just sharing experiences. You can participate via the associated website, or subscribe via email.

https://talk.tiddlywiki.org/

Note that talk.tiddlywiki.org is a community run service that we host and maintain ourselves. The modest running costs are covered by community contributions.

For the convenience of existing users, we also continue to operate the original TiddlyWiki group (hosted on Google Groups since 2005):

https://groups.google.com/group/TiddlyWiki

Developer Forums

There are several resources for developers to learn more about TiddlyWiki and to discuss and contribute to its development.

Other Forums

Documentation

There is also a discussion group specifically for discussing TiddlyWiki documentation improvement initiatives: https://groups.google.com/group/tiddlywikidocs

-

Installing TiddlyWiki on Node.js

  1. Install Node.js
    • Linux:
      Debian/Ubuntu:
      apt install nodejs
      May need to be followed up by:
      apt install npm
      Arch Linux
      pacman -S tiddlywiki
      (installs node and tiddlywiki)
    • Mac
      brew install node
    • Android
    • Other
  2. Open a command line terminal and type:
    npm install -g tiddlywiki
    If it fails with an error you may need to re-run the command as an administrator:
    sudo npm install -g tiddlywiki (Mac/Linux)
  3. Ensure TiddlyWiki is installed by typing:
    tiddlywiki --version
    • In response, you should see TiddlyWiki report its current version (eg "5.2.3". You may also see other debugging information reported.)
  4. Try it out:
    1. tiddlywiki mynewwiki --init server to create a folder for a new wiki that includes server-related components
    2. tiddlywiki mynewwiki --listen to start TiddlyWiki
    3. Visit http://127.0.0.1:8080/ in your browser
    4. Try editing and creating tiddlers
  5. Optionally, make an offline copy:
    • click the save changes button in the sidebar, OR
    • tiddlywiki mynewwiki --build index

The -g flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.

If you are using Debian or Debian-based Linux and you are receiving a node: command not found error though node.js package is installed, you may need to create a symbolic link between nodejs and node. Consult your distro's manual and whereis to correctly create a link. See github issue 1434.

Example Debian v8.0: sudo ln -s /usr/bin/nodejs /usr/bin/node


+

Installing TiddlyWiki on Node.js

  1. Install Node.js
    • Linux:
      Debian/Ubuntu:
      apt install nodejs
      May need to be followed up by:
      apt install npm
      Arch Linux
      yay -S tiddlywiki
      (installs node and tiddlywiki)
    • Mac
      brew install node
    • Android
    • Other
  2. Open a command line terminal and type:
    npm install -g tiddlywiki
    If it fails with an error you may need to re-run the command as an administrator:
    sudo npm install -g tiddlywiki (Mac/Linux)
  3. Ensure TiddlyWiki is installed by typing:
    tiddlywiki --version
    • In response, you should see TiddlyWiki report its current version (eg "5.2.4". You may also see other debugging information reported.)
  4. Try it out:
    1. tiddlywiki mynewwiki --init server to create a folder for a new wiki that includes server-related components
    2. tiddlywiki mynewwiki --listen to start TiddlyWiki
    3. Visit http://127.0.0.1:8080/ in your browser
    4. Try editing and creating tiddlers
  5. Optionally, make an offline copy:
    • click the save changes button in the sidebar, OR
    • tiddlywiki mynewwiki --build index

The -g flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.

If you are using Debian or Debian-based Linux and you are receiving a node: command not found error though node.js package is installed, you may need to create a symbolic link between nodejs and node. Consult your distro's manual and whereis to correctly create a link. See github issue 1434.

Example Debian v8.0: sudo ln -s /usr/bin/nodejs /usr/bin/node


You can also install prior versions like this:
npm install -g tiddlywiki@5.1.13

Using TiddlyWiki on Node.js

TiddlyWiki5 includes a set of commands for use on the command line to perform an extensive set of operations based on TiddlyWikiFolders, TiddlerFiles.

For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in static HTML:

tiddlywiki --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html

Running tiddlywiki from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.

New in: 5.1.20 First, there can be zero or more plugin references identified by the prefix + for plugin names or ++ for a path to a plugin folder. These plugins are loaded in addition to any specified in the TiddlyWikiFolder.

The next argument is the optional path to the TiddlyWikiFolder to be loaded. If not present, then the current directory is used.

The commands and their individual arguments follow, each command being identified by the prefix --.

tiddlywiki [+<pluginname> | ++<pluginpath>] [<wikipath>] [--<command> [<arg>[,<arg>]]]

For example:

tiddlywiki --version
 tiddlywiki +plugins/tiddlywiki/filesystem +plugins/tiddlywiki/tiddlyweb mywiki --listen