2016-10-18 08:13:52 +00:00
caption: wikify
2016-04-22 07:36:29 +00:00
created: 20160321144949700
2024-12-08 19:56:35 +00:00
modified: 20241206233352509
2016-04-22 07:36:29 +00:00
tags: Widgets
2016-10-18 08:13:52 +00:00
title: WikifyWidget
type: text/vnd.tiddlywiki
2016-04-22 07:36:29 +00:00
! Introduction
2024-12-08 19:56:35 +00:00
The <<.wid wikify>> widget parses and renders a string of text and assigns the result to a specified [[variable|Variables]]. The new value of the variable is available to the content within the <<.wid wikify>> widget.
2016-04-22 07:36:29 +00:00
! Content and Attributes
2024-12-08 19:56:35 +00:00
The content of the <<.wid wikify>> widget is the scope for the value assigned to the variable.
2016-04-22 07:36:29 +00:00
|!Attribute |!Description |
|name |The name of the variable to assign |
|text |The text to parse and render |
|type |The ContentType of the text (defaults to `text/vnd.tiddlywiki`) |
2022-01-23 09:44:01 +00:00
|mode |The parse mode: [[block|Block Mode WikiText]] (the default) or [[inline|Inline Mode WikiText]] |
2016-04-22 07:36:29 +00:00
|output |Keyword indicating the desired output type, defaulting to `text` (see below) |
The available output types are:
|!Keyword |!Description |
|text |Return the plain text of the rendered output (ie HTML tags are omitted) |
2016-10-18 08:13:52 +00:00
|formattedtext |Return the plain text with simple text formatting of the rendered output (ie HTML tags are omitted) |
2016-04-22 07:36:29 +00:00
|html |Return the rendered HTML of the output |
|parsetree |Return a formatted JSON representation of the parse tree |
|widgettree |Return a formatted JSON representation of the widget tree |
2024-12-05 12:25:22 +00:00
! Examples
!! Using a widget as a value
<<testcase "TestCases/WikifyWidget/WidgetValue/Success">>
<<testcase "TestCases/WikifyWidget/WidgetValue/Fail">>
!! Accurate word count
<<testcase "TestCases/WikifyWidget/WordCount/Success">>
<<testcase "TestCases/WikifyWidget/WordCount/Fail">>
!! Exporting rendered html
<<testcase "TestCases/WikifyWidget/RenderHTML">>
2024-12-08 19:56:35 +00:00
!! Rendering parameterised SVG for use in stylesheets
<<testcase "TestCases/WikifyWidget/RenderSVGURI">>