Docu-macros: Missing .controlpanel-tab Theme-tweaks

38 views
Skip to first unread message

Pau Deluca

unread,
Apr 27, 2016, 2:17:43 AM4/27/16
to tiddl...@googlegroups.com
Hi!

I'd need some advise to add the ControlPanel tab "Theme Tweaks" to the documentation macro <<.controlpanel-tab [parameter]>> or to define a new equivalent macro.

The difficulty I find there is that "Theme Tweaks" tab is not defined like $:/core/ui/ControlPanel/Info or $:/core/ui/ControlPanel/Appearance, but (logically enough) as $:/themes/tiddlywiki/[theme]/themetweaks, as its contents should vary depending on the chosen theme -even if it doesn't-, which also makes that the translatable lines of that tab cannot be included in the translators plugin, but must be directly translated in the tiddler theme by theme.

My attempts to fiddle in the macro definition are by now sterile.

Thanks for all help.

P.-)


Pau Deluca

unread,
Apr 27, 2016, 5:27:47 AM4/27/16
to tiddl...@googlegroups.com
SOLVED:

I finally found a way to add ThemeTweaks to the list of available parameters of the macro <<.controlpanel-tab ....>>:

  • I created a tiddler named $:/core/ui/ControlPanel/ThemeTweaks, tagged as $:/tags/ControlPanel,
  • text body transcludes the tiddler $:/themes/tiddlywiki/vanilla/themetweaks,
  • field caption receives the value of the translated tab's name. In this case "Ajustes del tema"
This keeps the tab ThemeTweaks in the control panel whilst allowing the usage of <<.controlpanel-tab ThemeTweaks>>, while $:/themes/tiddlywiki/vanilla/themetweaks remains untouched and available for future updates with -as long as I can test- no further problem.

Using the name  $:/_core/ui/ControlPanel/ThemeTweaks makes the tab to appear in the control panel, but doesn't solve the macro issue.

With your permission, I will prepare a ThemeTweaks tab-patch, as well as the corresponding update of the parameter list in the documentation.

P.-)

P.S.: I presume that a similar solution could work for the info-tab Sources.

Jeremy Ruston

unread,
Apr 27, 2016, 5:31:52 AM4/27/16
to tiddl...@googlegroups.com
Hi Pau

The difficulty is that the ThemeTweaks tab is not part of the core; it is part of the “Vanilla” theme plugin. So it should not be named with a $:/core prefix.

The `controlpanel-tab` is defined like this:

\define .controlpanel-tab(_) <<.tab "$:/core/ui/ControlPanel/$_$">>

Could you perhaps just invoke the underlying `tab` macro directly:

<<.tab "$:/themes/tiddlywiki/vanilla/themetweaks">>

Best wishes

Jeremy.


On 27 Apr 2016, at 10:27, Pau Deluca <pau...@alamier.com> wrote:

SOLVED:

I finally found a way to add ThemeTweaks to the list of available parameters of the macro <<.controlpanel-tab ....>>:

  • I created a tiddler named $:/core/ui/ControlPanel/ThemeTweaks, tagged as $:/tags/ControlPanel,
  • text body transcludes the tiddler $:/themes/tiddlywiki/vanilla/themetweaks,
  • field caption receives the value of the translated tab's name. In this case "Ajustes del tema"
This keeps the tab ThemeTweaks in the control panel whilst allowing the usage of <<.controlpanel-tab ThemeTweaks>>, while $:/themes/tiddlywiki/vanilla/themetweaks remains untouched and available for future updates with -as long as I can test- no further problem.

Using the name  $:/_core/ui/ControlPanel/ThemeTweaks makes the tab to appear in the control panel, but doesn't solve the macro issue.

With your permission, I will prepare a ThemeTweaks tab-patch, as well as the corresponding update of the parameter list in the documentation.

P.-)


El miércoles, 27 de abril de 2016, 8:17:43 (UTC+2), Pau Deluca escribió:
Hi!

I'd need some advise to add the ControlPanel tab "Theme Tweaks" to the documentation macro <<.controlpanel-tab [parameter]>> or to define a new equivalent macro.

The difficulty I find there is that "Theme Tweaks" tab is not defined like $:/core/ui/ControlPanel/Info or $:/core/ui/ControlPanel/Appearance, but (logically enough) as $:/themes/tiddlywiki/[theme]/themetweaks, as its contents should vary depending on the chosen theme -even if it doesn't-, which also makes that the translatable lines of that tab cannot be included in the translators plugin, but must be directly translated in the tiddler theme by theme.

My attempts to fiddle in the macro definition are by now sterile.

Thanks for all help.

P.-)



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f86408f3-1d41-4124-85ac-4bd7462fedea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pau Deluca

unread,
Apr 27, 2016, 6:28:41 AM4/27/16
to TiddlyWiki
I've just commit and PR a workaround:

I've created a core tiddler tagged as a control panel tab, that transcludes the contents of the plugin. This leaves the plugin untouched and reads the name of the tab from the core tiddler (and I presume that it would allow that further theme customisations including a theme-tweaks feature could be added to the control panel, maybe as a filter, rather than as a direct transclusion of a particular plugin tiddler).

The patch seems to work fine, so <<.controlpanel-tab Theme-tweaks>> retrieves the caption field from the newly created core tiddler and shows the contents of the plugin tiddler.

I presume that I could take a similar approach to add Sources to the parameters of .info-tab, so <<.info-tab Sources>> retrieves the translated tab name.

Does it seem right?

P.-)

Jeremy Ruston

unread,
Apr 27, 2016, 6:37:08 AM4/27/16
to tiddl...@googlegroups.com
Hi Pau

Sorry for the confusion.

The approach you’re suggesting won’t work. The trouble is that the theme tweaks tab is part of the “vanilla” theme plugin, and not part of the core. That means that it would be wrong to embed it in a tiddler with the $:/core prefix.

Can you use the approach I suggested below of invoking the <<.tab>> macro directly?

Best wishes

Jeremy



Reply all
Reply to author
Forward
0 new messages