Improved code-body - Provides additional features when viewing code-body

Please find attached a single tiddler Improved code-body.json (2.9 KB) It demonstrates a few interesting things including a bookmarklet and delivery by tiddler.

Drop this on any wiki and import, open the tiddler “Improved code-body” and read the instructions there in.

The link provided can be clicked to install an “Improved code-body” feature by replacing the core tiddler $:/core/ui/ViewTemplate/body/code with a new one.

  • The Bonus is however the link can also be dragged to your bookmarks, or favorites to install these features on any wiki, with a click of the bookmarklet.

What are the features in Improved code-body?

On all tiddlers with code-body=yes or those automatically set in the “view template body” cascade you can now do the following;

  • Mouse over the code for a tooltip
  • Click and drag text to select to the clipboard (always could)
  • ctrl-click to edit the code tiddler
  • shift-click to copy the whole tiddlers text field to the clipboard
  • alt-click to toggle the display of fields below the code

Other features demonstrated in this simple solution;

  • Delivery of bookmarklets by tiddler
  • Using bookmarklets defined in a tiddler
  • Dragging bookmarklets into your browser for reuse
  • Demonstrates the use of a function to generate a tiddler title
  • Demonstrates the use of a ghost tiddler to store information about a tiddler
    • Relink can be configured to maintain these.

Feedback appreciated.

2 Likes