From 8ad35a94116a1ce139a76b0815982a8d61ce252f Mon Sep 17 00:00:00 2001 From: "Carmine T. Guida" <35237506+carmineguida@users.noreply.github.com> Date: Sun, 7 May 2023 13:07:06 -0400 Subject: [PATCH 01/35] Signing the CLA (#7437) --- licenses/cla-individual.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index 6be49c5e0..45095164f 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -527,3 +527,5 @@ Andrea Octo, @andrigamerita, 2023/02/24 HuanC Fu, @hffqyd, 2023/03/03 Michelle Saad, @michsa, 2023-03-08 + +Carmine Guida, @carmineguida 2023-05-17 From 8f4b22110c1626fd192432110d00e8c9a95638b0 Mon Sep 17 00:00:00 2001 From: "Carmine T. Guida" <35237506+carmineguida@users.noreply.github.com> Date: Sun, 7 May 2023 17:45:34 -0400 Subject: [PATCH 02/35] Added a comma (#7438) --- licenses/cla-individual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index 45095164f..873450447 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -528,4 +528,4 @@ HuanC Fu, @hffqyd, 2023/03/03 Michelle Saad, @michsa, 2023-03-08 -Carmine Guida, @carmineguida 2023-05-17 +Carmine Guida, @carmineguida, 2023-05-17 From 2ab28cc2b862726b016a234acde01500f401869c Mon Sep 17 00:00:00 2001 From: Mateusz Wilczek <36714554+mateuszwilczek@users.noreply.github.com> Date: Wed, 10 May 2023 17:38:58 +0200 Subject: [PATCH 03/35] Add documentation on translink macro (#7426) * Update Using Excise.tid Rephrase the last paragraph (note). Fix some minor formatting. * Update WidgetMessage_ tm-edit-text-operation.tid Add link to `translink Macro` * Create TranslinkMacro.tid * Create translink.tid --- .../tw5.com/tiddlers/howtos/Using Excise.tid | 14 +++++-------- .../tiddlers/macros/TranslinkMacro.tid | 21 +++++++++++++++++++ .../tiddlers/macros/examples/translink.tid | 9 ++++++++ .../WidgetMessage_ tm-edit-text-operation.tid | 2 +- 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 editions/tw5.com/tiddlers/macros/TranslinkMacro.tid create mode 100644 editions/tw5.com/tiddlers/macros/examples/translink.tid diff --git a/editions/tw5.com/tiddlers/howtos/Using Excise.tid b/editions/tw5.com/tiddlers/howtos/Using Excise.tid index ef3be9a96..7d618a3b9 100644 --- a/editions/tw5.com/tiddlers/howtos/Using Excise.tid +++ b/editions/tw5.com/tiddlers/howtos/Using Excise.tid @@ -1,22 +1,18 @@ created: 20160810122928198 -modified: 20160810122934291 +modified: 20230505104214168 tags: [[Editor toolbar]] title: Using Excise type: text/vnd.tiddlywiki - ! Excise text From the EditorToolbar you can export selected text to a new tiddler and insert a [[link|Linking in WikiText]] [[Transclusion]] or [[macro|Macros]] in its place. Click ''Excise text'' (<<.icon $:/core/images/excise>>), input name of the new tiddler, and choose excise method. !! How to excise text # Highlight the relevant piece of text -#Click ''Excise text'' (<<.icon $:/core/images/excise>>) +# Click ''Excise text'' (<<.icon $:/core/images/excise>>) # Give the new tiddler a title. -# Chosse if the new tiddler will be tagged with the title of the current tiddler''*''. -# Choose replacing method. [[link|Linking in WikiText]] [[Transclusion]] or [[macro|Macros]]. - +# Chosse if the new tiddler will be tagged with the title of the current tiddler (see note below). +# Choose replacing method: [[link|Linking in WikiText]], [[transclusion|Transclusion]], or [[macro|Macros]]. # Click the ''{{$:/language/Buttons/Excise/Caption/Excise}}'' button - - -''*NOTE:'' If you choose tic the option to `Tag new tiddler with the title of this tiddler`. The tag will be the'' draft title''. If you create a new tiddler (or clone an existing one), the draft title and the tag, will be `New Tiddler`. __You have to save the tiddler and re-edit it to get the new title as tag.__ +<<.strong Note!>> If you choose the option to `Tag new tiddler with the title of this tiddler`, the new tiddler will be tagged with the name of the current tiddler before it has been edited. If you have changed the title of the current tiddler, save it first and edit it again to perform excision with this option. diff --git a/editions/tw5.com/tiddlers/macros/TranslinkMacro.tid b/editions/tw5.com/tiddlers/macros/TranslinkMacro.tid new file mode 100644 index 000000000..2e486e501 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/TranslinkMacro.tid @@ -0,0 +1,21 @@ +created: 20230505090333510 +modified: 20230505090333510 +tags: Macros [[Core Macros]] +title: translink Macro +type: text/vnd.tiddlywiki +caption: translink + +The <<.def translink>> [[macro|Macros]] returns a frame with the title and [[transcluded|Transclusion]] text of a chosen tiddler. The title links to the transcluded tiddler. + +If the chosen tiddler is missing, an appropriate message will be shown instead of the transcluded text. + +This is the default macro used when [[excising|Using Excise]] text and replacing it with a macro. + +!! Parameters + +; title +: The title of the tiddler to be transcluded +; mode +: The mode of the [[transclude widget|TranscludeWidget]] used inside the macro, defaults to `block` + +<<.macro-examples "translink">> diff --git a/editions/tw5.com/tiddlers/macros/examples/translink.tid b/editions/tw5.com/tiddlers/macros/examples/translink.tid new file mode 100644 index 000000000..aaf8b8aa0 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/examples/translink.tid @@ -0,0 +1,9 @@ +created: 20230505092952569 +modified: 20230505092952569 +tags: [[translink Macro]] [[Macro Examples]] +title: translink Macro (Examples) +type: text/vnd.tiddlywiki + +<$macrocall $name=".example" n="1" eg="""<>"""/> +<$macrocall $name=".example" n="2" eg="""<>"""/> +<$macrocall $name=".example" n="3" eg="""<>"""/> diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid index 8788ceac0..9737c3b24 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid @@ -13,7 +13,7 @@ Excises the currently selected text into a new tiddler and replaces it with a li |!Name |!Description | |title |Title of the new tiddler the selected content is excised to| |type |Type of the replacement to be inserted: Can be one of <<.value "transclude">>, <<.value "link">> or <<.value "macro">>| -|macro |In case //type=<<.value "macro">>//, specifies the name of the macro to be inserted. The title of the new tiddler is provided as the first parameter to the macro. Defaults to the ''translink'' macro| +|macro |In case //type=<<.value "macro">>//, specifies the name of the macro to be inserted. The title of the new tiddler is provided as the first parameter to the macro. Defaults to the [[translink macro|translink Macro]]| |tagnew |If '<<.value "yes">>', will tag the new tiddler with the title of the tiddler currently being edited | From db6b4f17e86a1f1d5feae2a6a0997eaeb0a7aeba Mon Sep 17 00:00:00 2001 From: Mateusz Wilczek <36714554+mateuszwilczek@users.noreply.github.com> Date: Wed, 10 May 2023 22:57:15 +0200 Subject: [PATCH 04/35] Improve translink macro, fixes 4877 (#7425) * Improve translink macro Changes: - Change styles to adapt colours to the current palette, instead of hard-coded white inside black box with grey borders. - Simplify the design to a single div (inspired by the Community links on tiddlywiki.com), instead of two nested contrasting divs. Comments: - I found pre-border and pre-background to be the most consistently readable across the default palettes (better than relying on e.g. tiddler-border, tiddler-background, page-background, code-border, code-background). Cupertino Dark, Gruvbox Dark, Nord, Solar Flare, Spartan Day, Spartan Night, Spartan Day, and Twilight have same or very similar pre-border and pre-background colours, so if the macro is nested (translinking a tiddler that contains a translink), the inner frames are not distinguishable, but I think it's an acceptable edge case. - Padding is defined separately for block and inline modes of the macro to make it appear consistent. * Update translink macro Change the `

` styling so that it is only applied to the transcluded tiddler's title and not to any potential `

` in its text. * Update translink macro Change the class-constructing filter so that the empty message is displayed with consistent padding in block mode. * Update translink.tid * Add styles for translink macro to vanilla/base.tid Split `pre` element styling, to allow part of it be reused with `.tc-pre-border` (used by translink macro). Add `.tc-big-bold` class under Other utility classes (used by translink macro). * Update base.tid Add `.tc-big-bold` class under Other utility classes (used by translink macro). * Update translink.tid Update `tc-pre-border` class name to match the one in vanilla/base.tid * Update translink.tid Simplify by always wrapping transclusion in `

` element (adjusts padding when inline mode or tiddler missing). * Update translink.tid Localise missing tiddler message (`$:/language/MissingTiddler/Hint`) * Update vanilla/base.tid - Modify class `tc-pre-background`, so that it can be applied to elements other than `pre`. The styling of `pre` remains unchanged, it is only split into two parts, for one part to be reused in the `tc-pre-background` class (used e.g. in translink macro). - Add `tc-big-v-gap` and `tc-big-bold` in the *Other utility classes* section (used e.g. in translink macro). * Update translink.tid Improve styling to depend only on classes specified in vanilla/base.tid * Update base.tid Update class `tc-translink` and CSS selectors to make styling the translink macro easier * Update translink.tid Change the classes of elements, so that changing the style is possible by modifying the stylesheet only * Update base.tid Add selectors to support new inline mode in translink macro * Update translink.tid Change behaviour of the inline mode, now the whole macro is inline, not just the transcluded text. * Update base.tid Fix padding of tc-translink class to account for multiline inline content. * Update base.tid Remove pseudo-element parentheses from inline translink macro * Update translink.tid Add parentheses around inline macro --- core/wiki/macros/translink.tid | 22 +++++++++++++++++----- themes/tiddlywiki/vanilla/base.tid | 26 +++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/core/wiki/macros/translink.tid b/core/wiki/macros/translink.tid index 1a1f54c99..9cc465422 100644 --- a/core/wiki/macros/translink.tid +++ b/core/wiki/macros/translink.tid @@ -3,14 +3,26 @@ tags: $:/tags/Macro \define translink(title,mode:"block") \whitespace trim -

+<$list filter="[<__mode__>match[block]]"> +