1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Merge branch 'tiddlywiki-com'

This commit is contained in:
jeremy@jermolene.com 2020-12-06 13:56:43 +00:00
commit 36fe519eff
10 changed files with 85 additions and 16 deletions

View File

@ -1,5 +1,6 @@
created: 20140710185051844
modified: 20140710185339032
modified: 20201002010124844
title: wikimethod module type
tags: moduletypes
The startup module [[$:/core/modules/startup/load-modules.js]] in the TiddlyWiki core plug-in loads all modules of type``wikimethod`` and puts their exported functions into the wiki store.

View File

@ -0,0 +1,55 @@
created: 20201002010134640
modified: 20201002012758239
tags: moduletypes dev
title: indexer modules
Indexer modules maintain indexes of tiddlers organized in a manner that's more efficient for different types of access, typically to speed up things like certain filter operators. An example of this would be the tag indexer - it's much faster to maintain a lookup table listing which tiddlers have a given tag than to iterate over //all// of the tiddlers in a wiki and ask each of them if they have the tag you're interested in!
Indexer modules have a `module-type` of `indexer`, and the indexers that are included with TiddlyWiki can be found under `core/modules/indexers`.
! Methods
Indexer modules must export a constructor function, which takes the current wiki object as its only argument. The object built by the construction function must implement the following methods:
!! `init()`
This performs any initial setup required by an indexer.
!! `rebuild()`
This rebuilds an index from scratch, usually after a large number of changes have happened to a wiki.
!! `update(updateDescriptor)`
This is called every time a tiddler is added, changed, or deleted. The `updateDescriptor` value is an object with two fields - `old` and `new` - which represent the pre-update and post-update state of the tiddler, respectively. Each of these has three fields of their own:
* `tiddler` - the state of the tiddler (may be `null`)
* `shadow` - a boolean indicating whether or not the tiddler is a shadow
* `exists` - a boolean indicating whether or not the tiddler exists
For example, let's say you have an indexer `idx` and you create a tiddler T with the text "test" - that would result in your indexer's `update` method being called like this:
```javascript
idx.update({
old: { tiddler: null, shadow: false, exists: false },
new: { tiddler: new $tw.Tiddler({title: 'T', text: 'test'}), shadow: false, exists: true }
});
```
If you then change the text from "test" to "testing", `update` would be called like this:
```javascript
idx.update({
old: { tiddler: new $tw.Tiddler({title: 'T', text: 'test'}), shadow: false, exists: true },
new: { tiddler: new $tw.Tiddler({title: 'T', text: 'testing'}), shadow: false, exists: true }
});
```
And finally, if you delete T, `update` will be called like this:
```javascript
idx.update({
old: { tiddler: new $tw.Tiddler({title: 'T', text: 'testing'}), shadow: false, exists: true },
new: { tiddler: null, shadow: false, exists: false }
});
```

View File

@ -7,7 +7,7 @@ When you edit a tiddler on https://tiddlywiki.com you will see a small ribbon in
If you are using Node.js, you can replicate this feature for your own TiddlyWiki-based site as follows:
# Make sure the following setting is included in the `tiddlywiki.info` file in your WikiFolder:
# Make sure the following setting is included in the <$link to="tiddlywiki.info Files">`tiddlywiki.info`</$link> file in your [[wiki folder|TiddlyWikiFolders]]:
#> <pre><code> "config": {
"retain-original-tiddler-path": true
}</code></pre>

View File

@ -20,9 +20,13 @@ Keyboard shortcuts are available for common editing operations within the Text E
<<.from-version 5.1.18>> : New ''global'' Keyboard shortcuts:
* Creating a new tiddler (defaults to <kbd>alt-N</kbd> )
* Creating a new journal (defaults to <kbd>alt-J</kbd> )
* Creating a new image (defaults to <kbd>alt-I</kbd> )
|!Action |!Default Shortcut|
|Creating a new tiddler |<kbd>alt-N</kbd> |
|Creating a new journal |<kbd>alt-J</kbd> |
|Creating a new image |<kbd>alt-I</kbd> |
|Focusing sidebar search |<<.from-version 5.1.20>><kbd>ctrl-shift-F</kbd> |
|Toggling the sidebar |<<.from-version 5.1.20>><kbd>shift-alt-S</kbd> |
|Advanced search |<<.from-version 5.1.20>><kbd>ctrl-shift-A</kbd> |
The current shortcuts can be inspected and customised in the "Keyboard Shortcuts" tab of the [[Control Panel|$:/ControlPanel]] <<.icon $:/core/images/options-button>>.

View File

@ -7,9 +7,9 @@ First of all: ''Keep calm!''
{{$:/deprecated}}
For ~TiddlyWiki it means, that you should not use this mechanism for new content anymore! ''AND you should update your existing content''!
For ~TiddlyWiki it means that you should not use this mechanism for new content anymore, ''AND you should update your existing content''!
Deprecated features have a marker. see: [[Custom styles by tag]]
Deprecated features have a marker. See: [[How to apply custom styles by tag]]
''Tiddlers tagged `$:/deprecated`''

View File

@ -8,8 +8,8 @@ type: text/vnd.tiddlywiki
<span class="doc-from-version">{{$:/core/images/warning}} New in: $version$</span>
\end
\define .deprecated-since(version, superseeded:"TODO-Link")
<$button to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: $version$ </$button> use [[$superseeded$]] instead!
\define .deprecated-since(version, superseded:"TODO-Link")
<$button to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: $version$ </$button>. Use [[$superseded$]] instead
\end
<pre><$view field="text"/></pre>

View File

@ -5,6 +5,6 @@ tags: [[WebServer Parameters]]
title: WebServer Parameter: tiddler-render-type
type: text/vnd.tiddlywiki
The [[web server configuration parameter|WebServer Parameters]] ''tiddler-render-type'' is used to specify the render type for serving ordinary, non-system tiddlers in the [[read-only single tiddler view|Using the read-only single tiddler view]]. The default value is `text/html`, causing the full HTML of the rendered output to be returned. Alternatively, `text/html` can be used to cause the raw text of rendered system tiddlers to be returned.
The [[web server configuration parameter|WebServer Parameters]] ''tiddler-render-type'' is used to specify the render type for serving ordinary, non-system tiddlers in the [[read-only single tiddler view|Using the read-only single tiddler view]]. The default value is `text/html`, causing the full HTML of the rendered output to be returned. Alternatively, `text/plain` can be used to cause the raw text of rendered system tiddlers to be returned.
<<.tip "This setting may be overwritten by specifying the `_render_type` field of a tiddler.">>

View File

@ -37,5 +37,5 @@ So-called global macros are implemented within the main page template ([[$:/core
<<.from-version "5.1.18">> The `\import` [[pragma|Pragma]] is an alternative syntax for using the ImportVariablesWidget. For example, the previous example could be expressed as:
```
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
```

View File

@ -1,6 +1,6 @@
caption: HTML
created: 20131205160816081
modified: 20161021102422842
modified: 20201125094415933
tags: WikiText
title: HTML in WikiText
type: text/vnd.tiddlywiki
@ -22,6 +22,14 @@ To get the content of an HTML element to be parsed in block mode, the opening ta
Without the two linebreaks, the tag content will be parsed in inline mode which means that block mode formatting such as wikitext tables, lists and headings is not recognised.
! Self closing elements
The following tags are treated as 'void'. This means that `<tag>` is treated as if it were `<tag/>`, and that no terminating `</tag>` is needed (if one is provided it will be ignored and treated as plain text).
* `<area>`, `<base>`, `<br>`, `<col>`, `<command>`, `<embed>`, `<hr>`, `<img>`, `<input>`, `<keygen>`, `<link>`, `<meta>`, `<param>`, `<source>`, `<track>`, `<wbr>`
If you dont close any other tag then it will behave as if the missing closing tag were at the end of the tiddler.
! Attributes
In an extension of conventional HTML syntax, attributes of elements/widgets can be specified in several different ways:

View File

@ -1,5 +1,5 @@
created: 20150330155120127
modified: 20191014091943444
modified: 20201205104857625
tags: [[Working with TiddlyWiki]]
title: Performance
type: text/vnd.tiddlywiki
@ -28,4 +28,5 @@ TiddlyWiki ships with defaults that are designed to get the best out of modern d
** Note that the field indexer currently defaults to indexing field values of less than 128 characters; longer values can still be searched for, but no index will be constructed
** Also note that the “field” operator is also used when the operator name is a fieldname, so, for example, `[all[shadows+tiddlers]caption[x]...` is optimised.
* Use the [[throttling|RefreshThrottling]] feature of the RefreshMechanism judiciously
* Keep in mind that ''transcluding separate tiddlers is more performant than heavy use of macros'' and the difference can be significant in some situations. The result of parsing each tiddler is cached and reused the next time if the tiddler has not changed. The same technique cannot be used for macros and they have to be re-parsed every time, as they are not global but local to the widget tree.
* Where possible ''use the SetWidget or VarsWidget with filters instead of the WikifyWidget'' for declaring variables and string concatenation. The performance of the wikify mechanism is relatively poor as there is no opportunity to cache the parse tree or widget tree.