mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-28 23:54:45 +00:00
Introduce "innerwiki" plugin
From the readme: This plugin enables TiddlyWiki to embed a modified copy of itself (an "innerwiki"). The primary motivation is to be able to produce screenshot illustrations that are automatically up-to-date with the appearance of TiddlyWiki as it changes over time, or to produce the same screenshot in different languages
This commit is contained in:
61
plugins/tiddlywiki/innerwiki/doc/docs.tid
Normal file
61
plugins/tiddlywiki/innerwiki/doc/docs.tid
Normal file
@@ -0,0 +1,61 @@
|
||||
title: $:/plugins/tiddlywiki/innerwiki/docs
|
||||
|
||||
! `<$innerwiki>` widget
|
||||
|
||||
The `<$innerwiki>` widget encapsulates an embedded wiki. It starts as a blank copy of the current wiki and can have additional payload tiddlers added via embedded `<$data>` widgets (see below).
|
||||
|
||||
It supports the following attributes:
|
||||
|
||||
|!Attribute |!Description |
|
||||
|template |Specifies the template to be used to generate the base wiki (defaults to $:/plugins/tiddlywiki/innerwiki/template) |
|
||||
|width |Width in pixels of the virtual screen for rendering the embedded wiki |
|
||||
|height |Height in pixels of the virtual screen for rendering the embedded wiki |
|
||||
|style |CSS style definitions to be added to the DIV wrapper around the IFRAME containing the embedded wiki |
|
||||
|class |CSS classes to be added to the DIV wrapper around the IFRAME containing the embedded wiki |
|
||||
|filename |Base filename for saving a screenshot of the embedded wiki under Node.js (excludes file extension) |
|
||||
|clipLeft |Position in pixels of the left edge of the clip rectangle (optional) |
|
||||
|clipTop |Position in pixels of the top edge of the clip rectangle (optional) |
|
||||
|clipWidth |Width in pixels of the clip rectangle (optional) |
|
||||
|clipHeight |Height in pixels of the clip rectangle (optional) |
|
||||
|
||||
! `<$data>` widget
|
||||
|
||||
The `<$data>` widget is used within the `<$innerwiki>` widget to specify payload tiddlers to be added to the innerwiki.
|
||||
|
||||
It supports the following attributes:
|
||||
|
||||
|!Attribute |!Description |
|
||||
|$tiddler |The title of a tiddler to be used as a payload tiddler (optional) |
|
||||
|$filter |A filter string identifying tiddlers to be used as payload tiddlers (optional) |
|
||||
|//any attribute<br>not starting<br>with $// |Field values to be assigned to the payload tiddler(s) |
|
||||
|
||||
It can be used in three different ways:
|
||||
|
||||
* Without the `$tiddler` or `$filter` attributes, the remaining attributes provide the fields for a single payload tiddler
|
||||
* With the `$tiddler` attribute present, the payload tiddler takes its fields from that tiddler with the remaining attributes overriding those fields
|
||||
* With the `$filter` attribute present, the payload is a copy of all of the tiddlers identified by the filter, with the remaining attributes overriding those fields of each one
|
||||
|
||||
This example injects a copy of the "HelloThere" tiddler with the addition of the field "custom" set to "Alpha":
|
||||
|
||||
```
|
||||
<$data $tiddler="HelloThere" custom="Alpha"/>
|
||||
```
|
||||
|
||||
This example injects all image tiddlers with the addition of the field "custom" set to "Beta":
|
||||
|
||||
```
|
||||
<$data $filter="[is[image]]" custom="Beta"/>
|
||||
```
|
||||
|
||||
! `screenshot` command
|
||||
|
||||
Saves PNG screenshots of the `<$innerwiki>` widgets rendered by a set of tiddlers identified by a filter.
|
||||
|
||||
```
|
||||
--screenshot <filter> <deviceScaleFactor>
|
||||
```
|
||||
|
||||
* ''filter'': a filter identifying the tiddlers to be rendered, from which the individual `<$innerwiki>` widgets are screenshotted
|
||||
* ''deviceScaleFactor'': a scale factor for the screenshot (optional; defaults to 1)
|
||||
|
||||
A deviceScaleFactor of 4 or 5 gives high quality screenshots suitable for print use.
|
||||
Reference in New Issue
Block a user