Skip to content

Commit

Permalink
Added pruning rule for palettes
Browse files Browse the repository at this point in the history
  • Loading branch information
flibbles committed Jan 15, 2025
1 parent b9528a7 commit ac7e3d5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
33 changes: 33 additions & 0 deletions plugins/uglify/prune/palettetheme.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
title: $:/plugins/flibbles/uglify/prune/palette-theme
caption: Unused palettes and themes

"""

Palletes

""" +[bl[]]

"""Language materials""" +[bl[]]
[prefix[$:/language/Docs/PaletteColours/]]
[prefix[$:/language/ControlPanel/Palette/]]
$:/language/Switcher/Subtitle/palette

"""Buttons""" +[bl[]]
$:/core/ui/Buttons/palette
$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/palette
$:/language/Buttons/Palette/Caption
$:/language/Buttons/Palette/Hint

"""Control Panel""" +[bl[]]
$:/core/ui/ControlPanel/Palette
$:/PaletteManager
$:/snippets/paletteswitcher
$:/snippets/paletteeditor
$:/snippets/palettepreview
$:/snippets/currpalettepreview

"""Switcher configuration""" +[bl[]]
$:/config/SwitcherTargets/palette

"""All unused palettes""" +[bl[]]
[tag[$:/tags/Palette]!match{$:/palette}!match[$:/palettes/Vanilla]]
9 changes: 9 additions & 0 deletions tiddlers/Pruning/palette-theme.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Pruning/palette-theme
caption: palette-theme
tags: Pruning

This pruning rule removes all unused palettes and themes, as well as the infrastructure to modify them. In short, it commits your tiddlywiki to whatever appearance customization it already has.

This is useful for production-ready tiddlywikis that have already been customized.

(The below list of removed tiddlers includes all non-vanilla palettes, but in reality, this rule will keep whatever palette your wiki is using.)
2 changes: 1 addition & 1 deletion tiddlers/Source_Maps.tid
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tags: Documentation Concept

Uglify supports javascript Source Mapping. This is when the server supplies your browser with uglified javascript to use, but if you open your browser's web developer tools, your browser can requests original versions of the javascript from the server, along with a "source map", which maps the executing uglified code to the pretty original versions, thus allowing you to seemlessly debug using pretty code while still reaping the benefits of compressed code.

Source Mapping only works when TW5-Uglify is used [[in conjunction with a Node.JS server|Uglify on Node.JS]]. A standalone Tiddlywiki cannot source map, because it has no server from which to request original files.
Source Mapping can work both when used [[in conjunction with a Node.JS server|Uglify on Node.JS]], but also with standalone wikis! The sourcemaps and original javavascript will be in directories right next to your tiddlywiki file. See [[Publishing Wikis]] for details on how to do this.

!! Source Mapping is not perfect

Expand Down

0 comments on commit ac7e3d5

Please sign in to comment.