{"title":"$:/plugins/tiddlywiki/text-slicer","name":"Text Slicer","description":"Tools for slicing text into tiddlers","list":"readme docs","dependents":"$:/plugins/tiddlywiki/sax","version":"5.1.22","plugin-type":"plugin","type":"application/json","tiddlers":{"$:/plugins/tiddlywiki/text-slicer/docs/exporters":{"title":"$:/plugins/tiddlywiki/text-slicer/docs/exporters","tags":"$:/plugins/tiddlywiki/text-slicer/docs","caption":"Exporters","text":"Documents can be saved under Node.js, or previewed in the browser.\n\n[TBD]\n"},"$:/plugins/tiddlywiki/text-slicer/docs/internals":{"title":"$:/plugins/tiddlywiki/text-slicer/docs/internals","tags":"$:/plugins/tiddlywiki/text-slicer/docs","caption":"Internals","text":"! Introduction\n\nThe slicing process is performed by a simple automaton that scans the document and applies simple declarative rules to yield a collection of tiddlers.\n\nThe automaton processes the incoming XML document starting with the root element and then recursively visits each child node and their children. Actions are triggered as each component of the document is encountered:\n\n* Opening tags of elements\n* Closing tags of elements\n* Text nodes\n\nComponents are matched against the current set of rules to determine what actions should be performed. They can include a combination of:\n\n* Starting a new tiddler with specified fields\n* Rendering the markup for the current tag into the current tiddler\n* Appending the content of the current text node to the current tiddler\n* Threading tiddlers to their parents using a combination of the `list` and `tags` fields\n\n! Slicing State Data\n\nAs the automaton performs its scan, it maintains the following state information:\n\n* ''chunks'' - an array of tiddlers without titles, addressed by their numeric index. The title field is reused to hold the plain text of the chunk that is later used to generate the final title for the tiddler\n* ''currentChunk'' - the numeric index of the chunk currently being filled, or `null` if there is no current chunk\n* ''parentStack'' - a stack of parent chunks stored as `{chunk: <chunk-index>, actions: <actions>}`\n\nAt the start, the special document chunk is created and pushed onto the stack of parent chunks\n\n! Slicing Rules\n\nSlicing rules are maintained in tiddlers tagged `$:/tags/text-slicer/slicer-rules` with the following fields:\n\n* ''title'' - title of the tiddler containing the listof rules\n* ''name'' - short, human readable name for the set of rules\n* ''inherits-from'' - (optional) the ''name'' field of another set of rules that should be inherited as a base\n* ''text'' - JSON data as described below\n\nThe JSON data is an array of rules, each of which is an object with the following fields:\n\n* ''selector'' - a selector string identifying the components to be matched by this rule\n* ''actions'' - an object describing the actions to be performed when this selector matches a tag\n\n!! Selectors\n\nThe selector format is a simplified form of CSS selectors. They are specified as follows:\n\n* A ''selector'' is a list of one or more ''match expressions'' separated by commas. The rule is triggered if any of the match expressions produce a positive match\n* A ''match expression'' is a list of one or element ''tag names'' separated by spaces. The rule is triggered if the final tag name in the list matches the tag of the current element, and all of the preceding tags in the expression exist as ancestors of the current element in the specified order (but not necessarily as immediate children of one another)\n* A ''tag name'' is the textual name of an element\n* Tag names in match expressions may optionally be separated by a `>` sign surrounded by spaces to impose the requirement that the left hand element be the immediate parent of the right hand element\n\n!!! Example Selectors\n\nThis XML document will be used to illustrate some examples:\n\n```\n<a>\n  <b>\n    <d>one</d>\n  </b>\n  <c>\n    <d>two</d>\n    <e>\n      three\n      <e>\n        four\n      </e>\n    </e>\n  </c>\n</a>\n\n```\n\n|!Selector |!Matches |\n|b |Matches the single `<b>` element |\n|d |Matches both of the two `<d>` elements |\n|c,d |Matches the `<c>` element and both of the two `<d>` elements |\n|c d |Matches the second of the two `<d>` elements |\n|a d |Matches both of the two `<d>` elements |\n|a > d |Doesn't match anything |\n|e |Matches both of the two `<e>` elements |\n|c > e |Matches the outermost of the two `<e>` elements |\n|e > e |Matches the innermost of the two `<e>` elements |\n\n!! Actions\n\nThe ''action'' property of a slicer rule is an object that can have any of the following optional fields:\n\n* ''startNewChunk'' - causes a new chunk to be started on encountering an opening tag. The value is an object containing the fields to be assigned to the new chunk\n* ''isParent'' - causes the new chunk to be marked as a child of the current chunk (boolean flag; only applies if ''startNewChunk'' is set)\n* ''headingLevel'' - arrange heading parents according to level (numerical index; only applies if ''startNewChunk'' and ''isParent'' are set)\n* ''dontRenderTag'' - disables the default rendering of opening and closing tags to the current chunk. By default the tags are rendered as XML tags, but this can be overridden via ''markup'' (boolean; defaults to ''false'')\n* ''isImage'' - identifies an element as representing an HTML image element, with special processing for the ''src'' attribute\n* ''markup'' - optional object with either or both of `{wiki: {prefix: <str>,suffix: <str>}}` and `{html: {prefix: <str>,suffix: <str>}}` allowing the rendered tags to be customised\n"},"$:/plugins/tiddlywiki/text-slicer/docs/model":{"title":"$:/plugins/tiddlywiki/text-slicer/docs/model","tags":"$:/plugins/tiddlywiki/text-slicer/docs","caption":"Document Model","text":"Individual tiddlers are created for each heading, paragraph and list item. They are linked together into a hierarchical outline using lists.\n\nFor example, consider a tiddler titled ''Example'' containing this simple text:\n\n<<<\n! This is a heading\n\nThis is a paragraph.\n\n* And the first list item\n* Second list item\n<<<\n\nIt will be sliced up into:\n\n* a tiddler for the overall document\n** a tiddler for the heading\n*** a tiddler for the paragraph\n*** a tiddler for the list\n**** and a tiddler for each list item\n\nThese tiddlers are bound together using lists: the parent tiddler has a ''list'' field that lists each child in the correct order.\n\n!! Slicing Process\n\nSlicing generates the following component tiddlers.\n\nTiddler titles are generated automatically in most cases (but can subsequently be changed manually). The automatically generated title is made up of concatenating the following elements:\n\n* root text (e.g. ''para'')\n* a dash ''-''\n* the first few words of the text of the item (up to 40 characters), separated with dashes ''-''\n* if necessary, a dash ''-'' and a numerical index to make the title unique\n\nFor example, ''para-how-to-use-pentagonal-tiles 23''.\n\nAny CSS classes used in the original document are assigned as tags to the associated tiddlers.\n\n!!! Document\n\nThe document itself is represented by a tiddler with the following fields:\n\n* ''toc-type'': the text \"document\"\n* ''title'': the text ''\"Sliced up \"'' plus the title of the tiddler that was sliced\n* ''text'': Available for comments about the document\n* ''list'': ordered list of tiddlers making up the root level of this document\n\n!!! Headings\n\nTiddlers representing headings have the following fields:\n\n* ''toc-type'': the text \"heading\"\n* ''toc-heading-level'': the heading level \"h1\", \"h2\", \"h3\" etc.\n* ''title'': an automatically generated unique title\n* ''text'': the text of the heading\n* ''list'': ordered list of tiddlers tagged with this heading (i.e. the child headings, paragraphs and lists displayed under this heading)\n** In addition, any CSS classes found in the HTML are converted into tags\n\n!!! Paragraphs\n\nTiddlers representing paragraphs have the following fields:\n\n* ''toc-type'': the text \"paragraph\"\n* ''title'': an automatically generated unique title\n* ''text'': the text of the paragraph\n* ''tags'': any CSS classes found in the HTML are converted into tags\n\n!!! Lists\n\nLists are represented by several tiddlers: one for the list itself, and one for each item in the list.\n\nThe tiddler representing the list itself has the following fields:\n\n* ''toc-type'': the text \"list\"\n* ''toc-list-type'': the text \"ul\" or \"ol\"\n* ''toc-list-filter'': the default filter used to generate the titles of the list items\n* ''title'': an automatically generated unique title\n* ''list'': ordered list of titles of tiddlers representing the items in this list\n* ''tags'': any CSS classes found in the HTML are converted into tags\n\nThe tiddlers representing items within the list have the following fields:\n\n* ''toc-type'': the text \"item\"\n* ''title'': an automatically generated unique title\n* ''text'': the text of the list item\n* ''tags'': any CSS classes found in the HTML are converted into tags\n\n!!! Definition lists\n\nDefinition lists are represented by several tiddlers: one for the definition list itself, and one for each term and definition in the list.\n\nThe tiddler representing the definition list itself has the following fields:\n\n* ''toc-type'': the text \"def-list\"\n* ''toc-list-filter'': the default filter used to generate the titles of the definition list items\n* ''title'': an automatically generated unique title\n* ''list'': ordered list of titles of tiddlers representing the items (terms and/or definition) in the definition list\n* ''tags'': any CSS classes found in the HTML are converted into tags\n\nThe tiddlers representing terms within the definition list have the following fields:\n\n* ''toc-type'': the text \"term\"\n* ''title'': an automatically generated unique title\n* ''text'': the text of the definition list term\n* ''tags'': any CSS classes found in the HTML are converted into tags\n\nThe tiddlers representing definitions within the definition list have the following fields:\n\n* ''toc-type'': the text \"definition\"\n* ''title'': an automatically generated unique title\n* ''text'' : the text of the definition list definition\n* ''tags'': any CSS classes found in the HTML are converted into tags\n\n!!! Images\n\nTiddlers representing images have the following fields:\n\n* ''toc-type'': the text \"image\"\n* ''title'': an automatically generated unique title\n* ''type'': appropriate content type for the image (eg \"image/jpeg\")\n\n!!! Notes\n\nNotes are available during editing but hidden for static renderings. The slicing mechanism does not generate notes; they can only be subsequently added manually. Tiddlers representing notes have the following fields:\n\n* ''toc-type'': the text \"note\"\n* ''title'': an automatically generated unique title\n* ''text'': the text of the note\n* ''tags'': any CSS classes found in the HTML are converted into tags\n"},"$:/plugins/tiddlywiki/text-slicer/docs/preview":{"title":"$:/plugins/tiddlywiki/text-slicer/docs/preview","tags":"$:/plugins/tiddlywiki/text-slicer/docs","caption":"Preview","text":"The document preview column appears at the left side of the screen. The content of headings can be collapsed and expanded to help navigation. Clicking on a tiddler opens the corresponding tiddler in the main story river.\n\nClicking ''Show toolbar'' causes each tiddler to be preceded by a toolbar showing the underlying title. It can be edited directly to rename the tiddler. References to the tiddler in the ''tags'' and ''list'' are automatically updated to reflect the change, but note that links to the tiddler will not be automatically changed.\n\nThe following theme tweaks should be applied to enable the preview column:\n\n* Set [[story left position|$:/themes/tiddlywiki/vanilla/metrics/storyleft]] to ''400px'' (or more)\n* It is recommended to also set the [[sidebar layout|$:/themes/tiddlywiki/vanilla/options/sidebarlayout]] to ''fluid-fixed''.\n\nTo preview the entire document in a separate window, locate it in the preview column and click the button labelled \"View document\". The document will open in plain text in a new window. The window will be automatically updated as you work on the document.\n"},"$:/plugins/tiddlywiki/text-slicer/docs/usage":{"title":"$:/plugins/tiddlywiki/text-slicer/docs/usage","tags":"$:/plugins/tiddlywiki/text-slicer/docs","caption":"Usage","text":"The tool can slice any tiddler that can be rendered as HTML, including both WikiText and HTML itself.\n\nDocuments created with Microsoft Word will need to be first converted to HTML. The library [[mammoth.js|https://github.com/mwilliamson/mammoth.js]] is recommended for this purpose.\n\n!! Browser\n\nIn the browser, you can slice a monolithic document tiddler using the slicer toolbar button.\n\n!! Node.js\n\nThe `--slice` command allows a tiddler to be sliced under Node.js:\n\n```\ntiddlywiki mywiki --slice SourceDocument --build index\n```\n"},"$:/plugins/tiddlywiki/text-slicer/docs":{"title":"$:/plugins/tiddlywiki/text-slicer/docs","list":"$:/plugins/tiddlywiki/text-slicer/docs/usage $:/plugins/tiddlywiki/text-slicer/docs/preview $:/plugins/tiddlywiki/text-slicer/docs/model $:/plugins/tiddlywiki/text-slicer/docs/exporters $:/plugins/tiddlywiki/text-slicer/docs/internals","text":"! Introduction\n\nThis plugin contains tools to help work with documents that are structured as a hierarchical outline of tiddlers.  The structural relationships within the document are expressed through the `list` and `tags` fields: for example, headings have a list specifying the chunks of content to be shown under the heading.\n\nThe major components within the text slicer plugin include:\n\n* ''the slicer'', a tool that slices up an existing monolithic document according to the headings, lists and paragraphs. It is available as a toolbar button for the browser, or as a command for use under Node.js\n* ''document preview column'', a new sidebar on the left that shows the full text of any documents in the wiki and allows individual tiddlers to be opened with a click\n* ''templates'' for previewing and exporting the individual documents as HTML files\n\nMinor components include:\n\n* a new `list-children` filter that returns all the descendents listed in the `list` field of the selected tiddlers\n* a new canned filter for [[advanced search|$:/AdvancedSearch]] that lists orphans tiddlers that are not part of any document\n\n<<tabs \"[all[tiddlers+shadows]tag[$:/plugins/tiddlywiki/text-slicer/docs]!has[draft.of]]\" \"$:/plugins/tiddlywiki/text-slicer/docs/usage\">>\n"},"$:/plugins/tiddlywiki/text-slicer/readme":{"title":"$:/plugins/tiddlywiki/text-slicer/readme","text":"This plugin contains tools to help slice up long texts into individual tiddlers. It currently works directly with XHTML documents and with Microsoft Word compatible DOCX documents via conversion to HTML.\n\nIt is an expression of the philosophy of TiddlyWiki: that text is easier to re-use and work with if it is sliced up into separate chunks that can be independently manipulated, and then woven back together to make up stories and narratives for publication.\n\n"},"$:/plugins/tiddlywiki/text-slicer/icon":{"title":"$:/plugins/tiddlywiki/text-slicer/icon","tags":"$:/tags/Image","text":"<svg class=\"tc-image-text-slicer tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n    <g fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n        <path d=\"M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z\" ></path>\n        <g transform=\"translate(32.000000, 32.000000) scale(2.19)\" fill=\"#ffffff\">\n            {{$:/plugins/tiddlywiki/text-slicer/images/text-slicer-icon}}\n        </g>\n    </g>\n</svg>"},"$:/plugins/tiddlywiki/text-slicer/images/text-slicer-icon":{"title":"$:/plugins/tiddlywiki/text-slicer/images/text-slicer-icon","tags":"$:/tags/Image","text":"<svg class=\"tc-image-text-slicer tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g fill-rule=\"evenodd\">\n\t\t<path d=\"M78.3637366,56.1312577 L78.3637366,60.2285796 L26.7489717,26.7095593 C23.9558586,24.8956905 23.1577753,21.1490577 24.9741388,18.3521031 C26.7898442,15.5561619 30.5337016,14.7576591 33.3309445,16.5742099 L87.6340125,51.8390346 L84.9731806,51.8390346 L103.852266,39.5788135 L105.182681,41.6274744 L104.070376,43.8022835 C102.858368,43.1824026 101.719662,42.4138485 100.675491,41.5061647 C93.6569185,35.4050129 92.9012893,24.7795163 98.9918187,17.7731637 C105.082348,10.766811 115.709601,10.0363032 122.728174,16.137455 C129.746746,22.2386068 130.502375,32.8641034 124.411846,39.870456 C123.229956,41.2300649 121.856251,42.3760135 120.416666,43.2314984 L94.2434565,60.2285796 L94.2434565,56.1312577 L120.765587,73.3549304 C121.152097,73.6059335 121.506081,73.898207 121.822516,74.2262669 L120.064365,75.9221214 L121.489555,73.938223 C121.915739,74.2443848 122.328975,74.5712591 122.728174,74.9182775 C129.746746,81.0194293 130.502375,91.6449259 124.411846,98.6512786 C118.321316,105.657631 107.694063,106.388139 100.675491,100.286987 C93.6569185,94.1858354 92.9012893,83.5603389 98.9918187,76.5539862 C100.441592,74.8862128 102.178627,73.5416182 104.115112,72.5685999 L105.211846,74.7513028 L103.88143,76.7999638 L84.9731806,64.5208027 L87.6340125,64.5208027 L61.3662147,81.57931 L61.3662147,67.1695775 L78.3637366,56.1312577 Z M114.533131,83.6707925 L115.961891,81.689464 L114.933771,83.9053132 C114.675216,83.7853476 114.424622,83.6467924 114.183613,83.4902793 L113.644945,83.1404643 L114.975362,81.0918038 L113.881545,83.2759699 C111.959385,82.3133637 109.605897,82.7611681 108.179792,84.4017143 C106.463272,86.3763445 106.676536,89.3752164 108.660203,91.0995921 C110.643871,92.8239678 113.643238,92.617794 115.359758,90.6431638 C117.076278,88.6685336 116.863014,85.6696617 114.879347,83.945286 C114.767376,83.8479516 114.651892,83.7564326 114.533131,83.6707925 Z M115.359758,31.8623412 C117.076278,29.8877111 116.863014,26.8888391 114.879347,25.1644635 C112.89568,23.4400878 109.896312,23.6462616 108.179792,25.6208918 C106.463272,27.5955219 106.676536,30.5943939 108.660203,32.3187696 C110.643871,34.0431452 113.643238,33.8369714 115.359758,31.8623412 Z\" fill-rule=\"nonzero\"></path>\n\t\t<g transform=\"translate(0.000000, 46.000000)\">\n\t\t\t<path d=\"M62.9632954,19.5390625 L62.984127,19.5390625 L62.984127,76.87441 C62.984127,79.7051952 60.6450077,82 57.7588318,82 L5.49996847,82 C2.61411765,82 0.274673329,79.7050809 0.274673329,76.87441 L0.274673329,5.12559005 C0.274673329,2.29480483 2.61379258,0 5.49996847,0 L42.7341992,0 L42.7341992,0.0129302741 C44.1445002,-0.0458264988 45.5745556,0.452971616 46.6523962,1.51002434 L61.4328365,16.0053998 C62.4299816,16.9833134 62.9403234,18.2577109 62.9632954,19.5390625 L62.9632954,19.5390625 Z M42.7341992,5.125 L5.50046113,5.125 L5.50046113,76.875 L57.7583392,76.875 L57.7583392,19.5390625 L47.9602131,19.5390625 C45.0739653,19.5390625 42.7341992,17.2466672 42.7341992,14.4138408 L42.7341992,5.125 Z\" ></path>\n\t\t\t<rect x=\"10.7262489\" y=\"23.0625\" width=\"41.8063024\" height=\"5.125\" rx=\"2.5625\"></rect>\n\t\t\t<rect x=\"10.7262489\" y=\"33.3125\" width=\"41.8063024\" height=\"5.125\" rx=\"2.5625\"></rect>\n\t\t\t<rect x=\"10.7262489\" y=\"43.5625\" width=\"41.8063024\" height=\"5.125\" rx=\"2.5625\"></rect>\n\t\t\t<rect x=\"10.7262489\" y=\"53.8125\" width=\"41.8063024\" height=\"5.125\" rx=\"2.5625\"></rect>\n\t\t\t<rect x=\"10.7262489\" y=\"64.0625\" width=\"41.8063024\" height=\"5.125\" rx=\"2.5625\"></rect>\n\t\t\t<rect x=\"10.7262489\" y=\"12.8125\" width=\"26.128939\" height=\"5.125\" rx=\"2.5625\"></rect>\n\t\t</g>\n\t</g>\n</svg>\n"},"$:/language/Help/slice":{"title":"$:/language/Help/slice","description":"Slice a hierarchical document into individual tiddlers","text":"Slices the specified tiddler\n\n```\n--slice <source-title> [<dest-title>] [<slicer-rules>] [<output-mode>]\n```\n\n* ''source-title'': Title of the tiddler to be sliced\n* ''dest-title'': Base title for the generated output tiddlers\n* ''slicer-rules'': Name of the slicer rules to use for the operation (see below)\n* ''output-mode'': \"html\" vs \"wiki\"\n\nThe plugin comes with several built-in sets of slicer rules:\n\n* //html-by-paragraph//: Slice every paragraph into a separate tiddler, threaded by heading\n* //html-by-heading//: Slice every heading into separate threaded tiddlers\n* //html-plain-paragraphs//: Slice every paragraph into a separate tiddler, without formatting or headings\n\nAdvanced users can create or edit their own slicer rules for precise control over the conversion process\n"},"$:/plugins/tiddlywiki/text-slicer/modules/commands/slice.js":{"title":"$:/plugins/tiddlywiki/text-slicer/modules/commands/slice.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/text-slicer/modules/commands/slice.js\ntype: application/javascript\nmodule-type: command\n\nCommand to slice a specified tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\"),\n\ttextSlicer = require(\"$:/plugins/tiddlywiki/text-slicer/modules/slicer.js\");\n\nexports.info = {\n\tname: \"slice\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing parameters\";\n\t}\n\tvar self = this,\n\t\twiki = this.commander.wiki,\n\t\tsourceTitle = this.params[0],\n\t\tdestTitle = this.params[1],\n\t\tslicerRules = this.params[2],\n\t\toutputMode = this.params[3],\n\t\tslicer = new textSlicer.Slicer({\n\t\t\tsourceTiddlerTitle: sourceTitle,\n\t\t\tbaseTiddlerTitle: destTitle,\n\t\t\tslicerRules: slicerRules,\n\t\t\toutputMode: outputMode,\n\t\t\twiki: wiki,\n\t\t\tcallback: function(err,tiddlers) {\n\t\t\t\tif(err) {\n\t\t\t\t\treturn self.callback(err);\n\t\t\t\t}\n\t\t\t\twiki.addTiddlers(tiddlers);\n\t\t\t\tself.callback();\t\n\t\t\t}\n\t\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n","type":"application/javascript","module-type":"command"},"$:/core/modules/filters/list-children.js":{"title":"$:/core/modules/filters/list-children.js","text":"/*\\\ntitle: $:/core/modules/filters/list-children.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all the descendents of a tiddler listed in the \"list\" field\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports[\"list-children\"] = function(source,operator,options) {\n\tvar children = {},\n\t\tprocessTiddler = function(title) {\n\t\t\tvar tiddler = options.wiki.getTiddler(title);\n\t\t\tif(tiddler && !$tw.utils.hop(children,title)) {\n\t\t\t\tchildren[title] = true;\n\t\t\t\tvar list = options.wiki.getTiddlerList(title,operator.operand);\n\t\t\t\tlist.forEach(function(listItem) {\n\t\t\t\t\tif(!$tw.utils.hop(children,listItem)) {\n\t\t\t\t\t\tprocessTiddler(listItem);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\tsource(function(tiddler,title) {\n\t\tprocessTiddler(title);\n\t});\n\treturn Object.keys(children);\n};\n\n})();\n","type":"application/javascript","module-type":"filteroperator"},"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-by-heading.json":{"title":"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-by-heading.json","name":"html-by-heading","caption":"By Heading (HTML)","description":"One tiddler per heading, threaded (HTML)","inherits-from":"html-by-paragraph","type":"application/json","tags":"$:/tags/text-slicer/slicer-rules","text":"[\n\t{\n\t\t\"selector\": \"address,center,fieldset,form,hr,iframe,isindex,noframes,noscript,ol,ul,li,pre,table\",\n\t\t\"actions\": {}\n\t},\n\t{\n\t\t\"selector\": \"blockquote\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"<<<\\n\",\n\t\t\t\t\t\"suffix\": \"<<<\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"dd\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"\\n: \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"dl\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"\\n\",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"dt\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"\\n; \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h1\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h1\"\n\t\t\t},\n\t\t\t\"mergeNext\": true,\n\t\t\t\"setCaption\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 1,\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"! \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h2\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h2\"\n\t\t\t},\n\t\t\t\"mergeNext\": true,\n\t\t\t\"setCaption\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 2,\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"!! \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h3\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h3\"\n\t\t\t},\n\t\t\t\"mergeNext\": true,\n\t\t\t\"setCaption\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 3,\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"!!! \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h4\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h4\"\n\t\t\t},\n\t\t\t\"mergeNext\": true,\n\t\t\t\"setCaption\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 4,\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"!!!! \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h5\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h5\"\n\t\t\t},\n\t\t\t\"mergeNext\": true,\n\t\t\t\"setCaption\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 5,\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"!!!!! \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h6\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h6\"\n\t\t\t},\n\t\t\t\"mergeNext\": true,\n\t\t\t\"setCaption\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 6,\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"!!!!!! \",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"p\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"\",\n\t\t\t\t\t\"suffix\": \"\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"*\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t}\n]\n"},"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-by-paragraph.json":{"title":"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-by-paragraph.json","name":"html-by-paragraph","caption":"By Paragraph (HTML)","description":"One tiddler per paragraph, threaded by heading (HTML)","type":"application/json","tags":"$:/tags/text-slicer/slicer-rules","text":"[\n\t{\n\t\t\"selector\": \"address,center,fieldset,form,hr,iframe,isindex,noframes,noscript,pre,table\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"blockquote\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t},\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"<<<\\n\",\n\t\t\t\t\t\"suffix\": \"<<<\\n\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"body,div,head,html,span\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"dd\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"definition\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"dl\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"def-list\",\n\t\t\t\t\"toc-list-filter\": \"[list<currentTiddler>!has[draft.of]]\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"dt\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"term\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"em,i\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"//\",\n\t\t\t\t\t\"suffix\": \"//\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h1\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 1,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h1\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h2\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 2,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h2\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h3\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 3,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h3\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h4\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 4,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h4\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h5\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 5,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h5\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"h6\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"headingLevel\": 6,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"heading\",\n\t\t\t\t\"toc-heading-level\": \"h6\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"img\",\n\t\t\"actions\": {\n\t\t\t\"isImage\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"li\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"item\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"ol\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"list\",\n\t\t\t\t\"toc-list-type\": \"ol\",\n\t\t\t\t\"toc-list-filter\": \"[list<currentTiddler>!has[draft.of]]\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"p\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"strike\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"~~\",\n\t\t\t\t\t\"suffix\": \"~~\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"strong,b\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"''\",\n\t\t\t\t\t\"suffix\": \"''\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"sub\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \",,\",\n\t\t\t\t\t\"suffix\": \",,\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"sup\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"^^\",\n\t\t\t\t\t\"suffix\": \"^^\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"head > title\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"u\",\n\t\t\"actions\": {\n\t\t\t\"markup\": {\n\t\t\t\t\"wiki\": {\n\t\t\t\t\t\"prefix\": \"__\",\n\t\t\t\t\t\"suffix\": \"__\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"ul\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"isParent\": true,\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"list\",\n\t\t\t\t\"toc-list-type\": \"ul\",\n\t\t\t\t\"toc-list-filter\": \"[list<currentTiddler>!has[draft.of]]\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"*\",\n\t\t\"actions\": {}\n\t}\n]"},"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-linear.json":{"title":"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-linear.json","name":"html-linear","caption":"Linear (HTML)","description":"One tiddler per paragraph in a single linear thread (HTML)","type":"application/json","tags":"$:/tags/text-slicer/slicer-rules","text":"[\n\t{\n\t\t\"selector\": \"li > p\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"p\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t},\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"a\",\n\t\t\"actions\": {\n\t\t\t\"isAnchor\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"address,blockquote,center,dl,dt,fieldset,form,h1,h2,h3,h4,h5,h6,hr,iframe,isindex,noframes,noscript,ol,pre,table,ul\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"br,caption,code,col,colgroup,em,i,dd,li,strike,strong,b,sub,sup,u,tbody,td,tfoot,th,thead,tr\",\n\t\t\"actions\": {\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"img\",\n\t\t\"actions\": {\n\t\t\t\"isImage\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"head\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true,\n\t\t\t\"discard\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"*\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t}\n]"},"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-plain-paragraphs.json":{"title":"$:/plugins/tiddlywiki/text-slicer/slicer-rules/html-plain-paragraphs.json","name":"html-plain-paragraphs","caption":"Plain Paragraphs (HTML)","description":"One tiddler per paragraph, without formatting (HTML)","type":"application/json","tags":"$:/tags/text-slicer/slicer-rules","text":"[\n\t{\n\t\t\"selector\": \"address,blockquote,center,dd,dt,h1,h2,h3,h4,h5,h6,li,p\",\n\t\t\"actions\": {\n\t\t\t\"startNewChunk\": {\n\t\t\t\t\"toc-type\": \"paragraph\"\n\t\t\t},\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t},\n\t{\n\t\t\"selector\": \"*\",\n\t\t\"actions\": {\n\t\t\t\"dontRenderTag\": true\n\t\t}\n\t}\n]\n"},"$:/plugins/tiddlywiki/text-slicer/modules/slicer.js":{"title":"$:/plugins/tiddlywiki/text-slicer/modules/slicer.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/text-slicer/modules/slicer.js\ntype: application/javascript\nmodule-type: library\n\nSlice a tiddler or DOM document into individual tiddlers\n\nvar slicer = new textSlicer.Slicer(doc,{\n\t\tslicerRules: JSON data defining slicer rules -or- title of rules taken from tiddlers tagged $:/tags/text-slicer/slicer-rules\n\t\tsourceTiddlerTitle: tiddler to slice -or-\n\t\tsourceText: text to slice\n\t\toutputMode: \"html\" (default) -or- \"wiki\"\n\t\tbaseTiddlerTitle: \"MySlicedTiddlers-\"\n\t\trole: \"sliced-content\"\n\t\tcallback: function(err,tiddlers)\n\t});\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction Slicer(options) {\n\t// Quick tests\n\tthis.testSlicerRuleMatching();\n\t// Marshal parameters\n\tthis.sourceTiddlerTitle = options.sourceTiddlerTitle;\n\tthis.sourceText = options.sourceText;\n\tthis.wiki = options.wiki;\n\tthis.role = options.role || \"sliced-html\";\n\tthis.outputMode = options.outputMode || \"html\";\n\tthis.escapeWikiText = options.escapeWikiText || false;\n\tthis.callbackFn = options.callback;\n\t// Get the slicer rules\n\tvar nameSlicerRules = null;\n\tif(!options.slicerRules) {\n\t\tnameSlicerRules = \"html-by-paragraph\";\n\t\tthis.slicerRules = this.loadSlicerRules(nameSlicerRules);\n\t} else if(typeof options.slicerRules === \"string\") {\n\t\tnameSlicerRules = options.slicerRules;\n\t\tthis.slicerRules = this.loadSlicerRules(nameSlicerRules);\n\t} else {\n\t\tthis.slicerRules = options.slicerRules;\n\t}\n\t// Set up the base tiddler title\n\tthis.baseTiddlerTitle = this.getBaseTiddlerTitle(options.baseTiddlerTitle);\n\t// Initialise state\n\tthis.namespaces = {}; // Hashmap of URLs\n\tthis.chunks = []; // Array of tiddlers without titles, addressed by their index. We use the title field to hold the plain text content\n\tthis.currentChunk = null; // Index of the chunk currently being written to\n\tthis.parentStack = []; // Stack of parent chunks {chunk: chunk index,actions:}\n\tthis.elementStack = []; // Stack of {tag:,isSelfClosing:,actions:}\n\tthis.titleCounts = {}; // Hashmap of counts of prefixed titles that have been issued\n\t// Set up the document tiddler as top level heading\n\tthis.chunks.push({\n\t\t\"toc-type\": \"document\",\n\t\ttitle: this.baseTiddlerTitle,\n\t\ttext: \"<div class='tc-table-of-contents'><<toc-selective-expandable \\\"\\\"\\\"\" + this.baseTiddlerTitle + \"document\\\"\\\"\\\">></div>\",\n\t\tlist: [],\n\t\ttags: [],\n\t\trole: this.role,\n\t\t\"slicer-rules\": nameSlicerRules,\n\t\t\"slicer-output-mode\": this.outputMode\n\t});\n\tthis.parentStack.push({chunk: 0, actions: this.getMatchingSlicerRuleActions(\"(document)\")});\n\tthis.insertPrecedingChunk({\n\t\t\"toc-type\": \"anchor\",\n\t\t\"title\": this.baseTiddlerTitle + \"-anchor-\"\n\t});\n\t// Set up the parser\n\tvar sax = require(\"$:/plugins/tiddlywiki/sax/sax.js\");\n\tthis.sax = sax.parser(false,{\n\t\txmlns: true,\n\t\tlowercase: true\n\t});\n\tthis.sax.onerror = this.onError.bind(this);\n\tthis.sax.onopennamespace = this.onOpenNamespace.bind(this);\n\tthis.sax.onclosenamespace = this.onCloseNamespace.bind(this);\n\tthis.sax.onopentag = this.onOpenTag.bind(this);\n\tthis.sax.onclosetag = this.onCloseTag.bind(this);\n\tthis.sax.ontext = this.onText.bind(this);\n\tthis.sax.onend = this.onEnd.bind(this);\n\t// Start streaming the data\n\tthis.sax.write(this.getSourceText());\n\tthis.sax.close();\n}\n\nSlicer.prototype.callback = function(err,tiddlers) {\n\tvar self = this;\n\t$tw.utils.nextTick(function() {\n\t\tself.callbackFn(err,tiddlers);\n\t});\n};\n\nSlicer.prototype.loadSlicerRules = function(name) {\n\t// Collect the available slicer rule tiddlers\n\tvar self = this,\n\t\ttitles = this.wiki.getTiddlersWithTag(\"$:/tags/text-slicer/slicer-rules\"),\n\t\ttiddlers = {},\n\t\trules = {},\n\t\truleNames = [];\n\ttitles.forEach(function(title) {\n\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\ttiddlers[tiddler.fields.name] = tiddler;\n\t\trules[tiddler.fields.name] = self.wiki.getTiddlerData(title,[]);\n\t});\n\t// Follow the inheritance trail to get a stack of slicer rule names\n\tvar n = name;\n\tdo {\n\t\truleNames.push(n);\n\t\tn = tiddlers[n] && tiddlers[n].fields[\"inherits-from\"];\n\t} while(n && ruleNames.indexOf(n) === -1);\n\t// Concatenate the slicer rules\n\trules = ruleNames.reduce(function(accumulator,name) {\n\t\treturn accumulator.concat(rules[name]);\n\t},[]);\n\treturn rules;\n};\n\nSlicer.prototype.getMatchingSlicerRuleActions = function(name) {\n\tvar rule = this.searchSlicerRules(name,this.slicerRules,this.elementStack);\n\tif(!rule) {\n\t\treturn {};\n\t} else {\n\t\treturn rule.actions;\n\t}\n};\n\nSlicer.prototype.testSlicerRuleMatching = function() {\n\tvar tests = [\n\t\t\t{\n\t\t\t\ttest: this.searchSlicerRules(\"title\",[\n\t\t\t\t\t\t{selector: \"title,head,body\", rules: true},\n\t\t\t\t\t\t{selector: \"body\", rules: true}\n\t\t\t\t\t],[\n\t\t\t\t\t\t{tag:\"head\"}\n\t\t\t\t\t]),\n\t\t\t\tresult: \"title,head,body\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: this.searchSlicerRules(\"body\",[\n\t\t\t\t\t\t{selector: \"title,head,body\", rules: true},\n\t\t\t\t\t\t{selector: \"body\", rules: true}\n\t\t\t\t\t],[\n\t\t\t\t\t\t{tag:\"head\"}\n\t\t\t\t\t]),\n\t\t\t\tresult: \"title,head,body\"\n\t\t\t},\n\t\t\t{\t\n\t\t\t\ttest: this.searchSlicerRules(\"title\",[\n\t\t\t\t\t\t{selector: \"head > title\", rules: true},\n\t\t\t\t\t\t{selector: \"title\", rules: true}\n\t\t\t\t\t],[\n\t\t\t\t\t\t{tag:\"head\"}\n\t\t\t\t\t]),\n\t\t\t\tresult: \"head > title\"\n\t\t\t}\n\t\t],\n\t\tresults = tests.forEach(function(test,index) {\n\t\t\tif(test.test.selector !== test.result) {\n\t\t\t\tthrow \"Failing test \" + index + \", returns \" + test.test.selector + \" instead of \" + test.result;\n\t\t\t}\n\t\t});\n};\n\nSlicer.prototype.searchSlicerRules = function(name,rules,elementStack) {\n\treturn rules.find(function(rule) {\n\t\t// Split and trim the selectors for this rule\n\t\treturn !!rule.selector.split(\",\").map(function(selector) {\n\t\t\t\treturn selector.trim();\n\t\t\t// Find the first selector that matches, if any\n\t\t\t}).find(function(selector) {\n\t\t\t\t// Split and trim the parts of the selector\n\t\t\t\tvar parts = selector.split(\" \").map(function(part) {\n\t\t\t\t\treturn part.trim();\n\t\t\t\t});\n\t\t\t\t// * matches any element\n\t\t\t\tif(parts.length === 1 && parts[0] === \"*\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// Make a copy of the element stack so that we can be destructive\n\t\t\t\tvar elements = elementStack.slice(0).concat({tag: name}),\n\t\t\t\t\tnextElementMustBeAtTopOfStack = true,\n\t\t\t\t\tcurrentPart = parts.length - 1;\n\t\t\t\twhile(currentPart >= 0) {\n\t\t\t\t\tif(parts[currentPart] === \">\") {\n\t\t\t\t\t\tnextElementMustBeAtTopOfStack = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(!nextElementMustBeAtTopOfStack) {\n\t\t\t\t\t\t\twhile(elements.length > 0 && elements[elements.length - 1].tag !== parts[currentPart]) {\n\t\t\t\t\t\t\t\telements.pop();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(elements.length === 0 || elements[elements.length - 1].tag !== parts[currentPart]) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telements.pop();\n\t\t\t\t\t\tnextElementMustBeAtTopOfStack = false;\n\t\t\t\t\t}\n\t\t\t\t\tcurrentPart--;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t});\n};\n\nSlicer.prototype.getBaseTiddlerTitle = function(baseTiddlerTitle) {\n\tif(baseTiddlerTitle) {\n\t\treturn baseTiddlerTitle\t\t\n\t} else {\n\t\tif(this.sourceTiddlerTitle) {\n\t\t\treturn \"Sliced up \" + this.sourceTiddlerTitle + \":\";\n\t\t} else {\n\t\t\treturn \"SlicedTiddler\";\n\t\t}\n\t}\n};\n\nSlicer.prototype.getSourceText = function() {\n\tif(this.sourceTiddlerTitle) {\n\t\tvar tiddler = this.wiki.getTiddler(this.sourceTiddlerTitle);\n\t\tif(!tiddler) {\n\t\t\tconsole.log(\"Tiddler '\" + this.sourceTiddlerTitle + \"' does not exist\");\n\t\t\treturn \"\";\n\t\t}\n\t\tif(tiddler.fields.type === \"text/html\" || tiddler.fields.type === \"text/xml\" || (tiddler.fields.type || \"\").slice(-4) === \"+xml\") {\n\t\t\treturn tiddler.fields.text;\n\t\t} else {\n\t\t\treturn this.getTiddlerAsHtml(tiddler);\n\t\t}\n\t} else {\n\t\treturn this.sourceText;\n\t}\n};\n\nSlicer.prototype.getTiddlerAsHtml = function(tiddler) {\n\tvar widgetNode = this.wiki.makeTranscludeWidget(tiddler.fields.title,{\n\t\t\tdocument: $tw.fakeDocument,\n\t\t\tparseAsInline: false,\n\t\t\timportPageMacros: true}),\n\t\tcontainer = $tw.fakeDocument.createElement(\"div\");\n\twidgetNode.render(container,null);\n\treturn [\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.1//EN\\\" \\\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\\\">\",\"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\",\"<head>\",\"</head>\",\"<body>\",container.innerHTML,\"</body>\",\"</html>\"].join(\"\\n\");\n};\n\n\nSlicer.prototype.getImmediateParent = function() {\n\treturn this.parentStack.slice(-1)[0];\n};\n\nSlicer.prototype.onError = function(e) {\n\tconsole.error(\"Sax error: \", e)\n\t// Try to resume after errors\n\tthis.sax.error = null;\n\tthis.sax.resume();\n};\n\nSlicer.prototype.onOpenNamespace = function(info) {\n\tthis.namespaces[info.prefix] = info.uri;\n};\n\nSlicer.prototype.onCloseNamespace = function(info) {\n};\n\nSlicer.prototype.onOpenTag = function(node) {\n\tvar actions = this.getMatchingSlicerRuleActions(node.name);\n\t// Create an anchor if we encounter an ID\n\tif(node.attributes.id) {\n\t\tthis.insertPrecedingChunk({\n\t\t\t\"toc-type\": \"anchor\",\n\t\t\t\"title\": this.baseTiddlerTitle + \"-anchor-\" + node.attributes.id.value\n\t\t});\n\t}\n\t// Check for an element that should start a new chunk\n\tif(actions.startNewChunk) {\n\t\t// If this is a heading, pop off any higher or equal level headings first\n\t\tif(actions.isParent && actions.headingLevel) {\n\t\t\tvar parentActions = this.getImmediateParent().actions;\n\t\t\twhile(parentActions.isParent && parentActions.headingLevel && parentActions.headingLevel >= actions.headingLevel) {\n\t\t\t\tthis.parentStack.pop();\n\t\t\t\tparentActions = this.getImmediateParent().actions;\n\t\t\t}\n\t\t}\n\t\t// Start the new chunk\n\t\tthis.startNewChunk(actions.startNewChunk);\n\t\t// If this is a parent then also add it to the parent stack\n\t\tif(actions.isParent) {\n\t\t\tthis.parentStack.push({chunk: this.currentChunk, actions: actions});\n\t\t}\n\t}\n\t// Render the tag inline in the current chunk unless we should ignore it\n\tif(!actions.dontRenderTag) {\n\t\tif(actions.isImage) {\n\t\t\tthis.onOpenImage(node);\n\t\t} else if(actions.isAnchor) {\n\t\t\tthis.onOpenAnchor(node);\n\t\t} else {\n\t\t\tvar markupInfo = actions.markup && actions.markup[this.outputMode];\n\t\t\tif(markupInfo) {\n\t\t\t\tthis.addTextToCurrentChunk(markupInfo.prefix);\n\t\t\t} else {\n\t\t\t\tthis.addTextToCurrentChunk(\"<\" + node.name + (node.isSelfClosing ? \"/\" : \"\") + \">\");\n\t\t\t}\n\t\t}\n\t}\n\t// Remember whether this tag is self closing\n\tthis.elementStack.push({tag: node.name,isSelfClosing: node.isSelfClosing, actions: actions, node: node});\n};\n\nSlicer.prototype.onOpenAnchor = function(node) {\n\tif(node.attributes.href) {\n\t\tvar value = node.attributes.href.value;\n\t\tif(value.indexOf(\"https://\") === 0 || value.indexOf(\"http://\") === 0) {\n\t\t\t// External link\n\t\t\tthis.addTextToCurrentChunk(\"<a href=\\\"\" + value + \"\\\"  target=\\\"_blank\\\" rel=\\\"noopener noreferrer\\\">\");\n\t\t} else {\n\t\t\t// Internal link\n\t\t\tvar parts = value.split(\"#\"),\n\t\t\t\tbase = parts[0],\n\t\t\t\thash = parts[1] || \"\",\n\t\t\t\ttitle = $tw.utils.resolvePath(base,this.baseTiddlerTitle) + \"-anchor-\" + hash;\n\t\t\tthis.addTextToCurrentChunk(\"<$link to=\\\"\" + title + \"\\\">\");\t\t\t\n\t\t}\n\t}\n};\n\nSlicer.prototype.onCloseAnchor = function(elementInfo) {\n\tif(elementInfo.node.attributes.href) {\n\t\tvar value = elementInfo.node.attributes.href.value;\n\t\tif(value.indexOf(\"https://\") === 0 || value.indexOf(\"http://\") === 0) {\n\t\t\t// External link\n\t\t\tthis.addTextToCurrentChunk(\"</a>\");\n\t\t} else {\n\t\t\t// Internal link\n\t\t\tthis.addTextToCurrentChunk(\"</$link>\");\n\t\t}\n\t}\n};\n\nSlicer.prototype.onOpenImage = function(node) {\n\tvar url = node.attributes.src.value;\n\tif(url.slice(0,5) === \"data:\") {\n\t\t// var parts = url.slice(5).split(\",\");\n\t\t// this.chunks.push({\n\t\t// \ttitle: ,\n\t\t// \ttext: parts[1],\n\t\t// \ttype: parts[0].split[\";\"][0],\n\t\t// \trole: this.role\n\t\t// });\n\t}\n\tthis.addTextToCurrentChunk(\"[img[\" + $tw.utils.resolvePath(url,this.baseTiddlerTitle) + \"]]\");\n};\n\nSlicer.prototype.onCloseTag = function(name) {\n\tvar e = this.elementStack.pop(),\n\t\tactions = e.actions,\n\t\tselfClosing = e.isSelfClosing;\n\t// Set the caption if required\n// TODO\n// \tif(actions.setCaption) {\n// \t\tthis.chunks[this.currentChunk].caption = this.chunks[this.currentChunk].title;\n// \t}\n\t// Render the tag\n\tif(actions.isAnchor) {\n\t\tthis.onCloseAnchor(e);\n\t} else if (!actions.dontRenderTag && !selfClosing) {\n\t\tvar markupInfo = actions.markup && actions.markup[this.outputMode];\n\t\tif(markupInfo) {\n\t\t\tthis.addTextToCurrentChunk(markupInfo.suffix);\n\t\t} else {\n\t\t\tthis.addTextToCurrentChunk(\"</\" + name + \">\");\t\t\t\n\t\t}\n\t}\n\t// Check for an element that started a new chunk\n\tif(actions.startNewChunk) {\n\t\tif(!actions.mergeNext) {\n\t\t\tthis.currentChunk = null;\t\t\t\n\t\t}\n\t\t// If this is a parent and not a heading then also pop it from the parent stack\n\t\tif(actions.isParent && !actions.headingLevel) {\n\t\t\tthis.parentStack.pop();\n\t\t}\n\t}\n};\n\nSlicer.prototype.onText = function(text) {\n\tvar self = this;\n\t// Discard the text if we're inside an element with actions.discard set true\n\tif(this.elementStack.some(function(e) {return e.actions.discard;})) {\n\t\treturn;\n\t}\n\t// Optionally escape common character sequences that might be parsed as wikitext\n\ttext = $tw.utils.htmlEncode(text);\n\tif(this.escapeWikiText) {\n\t\t$tw.utils.each([\"[[\",\"{{\",\"__\",\"''\",\"//\",\",,\",\"^^\",\"~~\",\"`\",\"--\",\"\\\"\\\"\",\"@@\"],function(str) {\n\t\t\tvar replace = str.split(\"\").map(function(c) {\n\t\t\t\treturn \"&#\" + c.charCodeAt(0) + \";\";\n\t\t\t}).join(\"\");\n\t\t\ttext = text.replace(new RegExp($tw.utils.escapeRegExp(str),\"mg\"),replace);\n\t\t});\n\t}\n\tthis.addTextToCurrentChunk(text);\n\tthis.addTextToCurrentChunk(text,\"caption\");\n};\n\nSlicer.prototype.onEnd = function() {\n\tthis.callback(null,this.chunks);\n};\n\nSlicer.prototype.addTextToCurrentChunk = function(str,field) {\n\tfield = field || \"text\";\n\tif(this.currentChunk === null && str.trim() !== \"\") {\n\t\tthis.startNewChunk({\n\t\t\ttitle: this.makeTitle(\"paragraph\"),\n\t\t\t\"toc-type\": \"paragraph\"\n\t\t});\n\t}\n\tif(this.currentChunk !== null) {\n\t\tthis.chunks[this.currentChunk][field] += str;\n\t}\n};\n\nSlicer.prototype.startNewChunk = function(fields) {\n\tvar title = fields.title || this.makeTitle(fields[\"toc-type\"]);\n\tvar parentChunk = this.chunks[this.getImmediateParent().chunk];\n\tthis.chunks.push($tw.utils.extend({},{\n\t\ttitle: title,\n\t\ttext: \"\",\n\t\tcaption: \"\",\n\t\ttags: [parentChunk.title],\n\t\tlist: [],\n\t\trole: this.role\n\t},fields));\n\tthis.currentChunk = this.chunks.length - 1;\n\tparentChunk.list.push(title);\n};\n\nSlicer.prototype.insertPrecedingChunk = function(fields) {\n\tif(!fields.title) {\n\t\tthrow \"Chunks need a title\"\n\t}\n\tif(!this.currentChunk) {\n\t\tthis.startNewChunk(fields);\n\t\tthis.currentChunk = null;\n\t} else {\n\t\tvar parentChunk = this.chunks[this.getImmediateParent().chunk],\n\t\t\tindex = this.chunks.length - 1;\n\t\t// Insert the new chunk\n\t\tthis.chunks.splice(index,0,$tw.utils.extend({},{\n\t\t\ttext: \"\",\n\t\t\tcaption: \"\",\n\t\t\ttags: [parentChunk.title],\n\t\t\tlist: [],\n\t\t\trole: this.role\n\t\t},fields));\n\t\t// Adjust the current chunk pointer\n\t\tthis.currentChunk += 1;\n\t\t// Insert a pointer to the new chunk in the parent\n\t\tparentChunk.list.splice(parentChunk.list.length - 1,0,fields.title);\t\t\n\t}\n};\n\nSlicer.prototype.isBlank = function(s) {\n\treturn (/^[\\s\\xA0]*$/g).test(s);\n};\n\nSlicer.prototype.makeTitle = function(prefix) {\n\tprefix = prefix  || \"\";\n\tvar count = (this.titleCounts[prefix] || 0) + 1;\n\tthis.titleCounts[prefix] = count;\n\treturn this.baseTiddlerTitle + \"-\" + prefix + \"-\" + count;\n};\n\nexports.Slicer = Slicer;\n\n})();\n","type":"application/javascript","module-type":"library"},"$:/plugins/tiddlywiki/text-slicer/modules/startup/slicer-startup.js":{"title":"$:/plugins/tiddlywiki/text-slicer/modules/startup/slicer-startup.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/text-slicer/modules/startup/slicer-startup.js\ntype: application/javascript\nmodule-type: startup\n\nSetup the root widget event handlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar textSlicer = require(\"$:/plugins/tiddlywiki/text-slicer/modules/slicer.js\");\n\n// Export name and synchronous status\nexports.name = \"slicer\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\n// Install the root widget event handlers\nexports.startup = function() {\n\t// Check sax is installed\n\tif(!$tw.utils.hop($tw.modules.titles,\"$:/plugins/tiddlywiki/sax/sax.js\")) {\n\t\t// Make a logger\n\t\tvar logger = new $tw.utils.Logger(\"text-slicer\");\n\t\tlogger.alert(\"The plugin 'text-slicer' requires the 'sax' plugin to be installed\");\n\t}\n\t// Add tm-slice-tiddler event handler\n\t$tw.rootWidget.addEventListener(\"tm-slice-tiddler\",function(event) {\n\t\tvar slicer = new textSlicer.Slicer({\n\t\t\tsourceTiddlerTitle: event.param,\n\t\t\tslicerRules: event.paramObject && event.paramObject.slicerRules,\n\t\t\toutputMode: event.paramObject && event.paramObject.outputMode,\n\t\t\tbaseTiddlerTitle: event.paramObject && event.paramObject.destTitle,\n\t\t\trole: event.paramObject && event.paramObject.role,\n\t\t\twiki: $tw.wiki,\n\t\t\tcallback: function(err,tiddlers) {\n\t\t\t\tif(err) {\n\t\t\t\t\tlogger.alert(\"Slicer error: \" + err);\n\t\t\t\t} else {\n\t\t\t\t\t$tw.wiki.addTiddlers(tiddlers);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n};\n\n})();\n","type":"application/javascript","module-type":"startup"},"$:/plugins/tiddlywiki/text-slicer/styles":{"title":"$:/plugins/tiddlywiki/text-slicer/styles","tags":"$:/tags/Stylesheet","text":"\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock\n\n.tc-document-preview-column {\n\tposition: fixed;\n\toverflow-y: auto;\n\toverflow-x: visible;\n\t-webkit-overflow-scrolling: touch;\n    background-color: <<colour page-background>>;\n\tright: auto;\n\tleft: 0;\n\ttop: 0;\n\tbottom: 0;\n\twidth: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}};\n\tfont-size: 0.9em;\n}\n\n.tc-sliced-document-title {\n\tfont-size: 1.7em;\n}\n\n.tc-slice-note {\n    color: #800;\n    padding: 4px 4px 4px 4px;\n    border: 1px solid #feed77;\n    background: #feed77;\n    background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#dede80),color-stop(7%,#feed77),color-stop(92%,#feed77),color-stop(100%,#dede80));\n    background: -webkit-linear-gradient(72deg,rgba(255, 255, 255, 0.5) 8%,rgba(255, 255, 255, 0.1) 80%), -webkit-linear-gradient(top,#dede80 0,#feed77 7%,#feed77 92%,#dede80 100%);\n    background: -moz-linear-gradient(72deg,rgba(255, 255, 255, 0.5) 8%,rgba(255, 255, 255, 0.1) 80%), -moz-linear-gradient(top,#dede80 0,#feed77 7%,#feed77 92%,#dede80 100%);\n    background: -o-linear-gradient(72deg,rgba(255, 255, 255, 0.5) 8%,rgba(255, 255, 255, 0.1) 80%), -o-linear-gradient(top,#dede80 0,#feed77 7%,#feed77 92%,#dede80 100%);\n    background: -ms-linear-gradient(72deg,rgba(255, 255, 255, 0.5) 8%,rgba(255, 255, 255, 0.1) 80%), -ms-linear-gradient(top,#dede80 0,#feed77 7%,#feed77 92%,#dede80 100%);\n    background: linear-gradient(72deg,rgba(255, 255, 255, 0.5) 8%,rgba(255, 255, 255, 0.1) 80%), linear-gradient(top,#dede80 0,#feed77 7%,#feed77 92%,#dede80 100%);\n\t<<box-shadow \"1px 1px 6px rgba(0,0,0,0.4)\">>\n}\n\n.tc-document-preview-column .tc-sliced-document-header {\n\tmargin-left: 24px;\n}\n\n.tc-document-preview-column .tc-sliced-document {\n\tmargin-bottom: 3px;\n}\n\n.tc-view-template-document-tiddler-wrapper,\n.tc-edit-template-document-tiddler-wrapper {\n    border-top: 2px solid #D6A2A2;\n    margin-left: -42px;\n    margin-right: -42px;\n    margin-bottom: -42px;\n    padding-left: 42px;\n    padding-right: 42px;\n    background: #FFE3E3;\n    padding-bottom: 10px;\n}\n\n.tc-edit-template-document-tiddler-wrapper {\n\tbackground: #A3A3D7;\n}\n\ndiv.tc-view-template-document-tiddler-heading a,\ndiv.tc-edit-template-document-tiddler-heading a {\n\tborder: 1px solid #D6A2A2;\n\tbackground: #fff;\n\tborder-radius: 16px;\n    padding: 0px 4px 0px 4px;\n    margin: 2px 4px 2px 4px;\n    white-space: nowrap;\n    display: inline-block;\n}\n\ndiv.tc-view-template-document-tiddler-heading a:hover,\ndiv.tc-edit-template-document-tiddler-heading a:hover {\n\tborder: 1px solid <<colour background>>;\n\ttext-decoration: none;\n\tcolor: <<colour background>>;\n\tbackground: <<colour foreground>>;\n}\n\n.tc-view-template-document-tiddler-heading-icon,\n.tc-edit-template-document-tiddler-heading-icon {\n\twidth: 42px;\n\ttext-align: center;\n    margin-left: -42px;\n    margin-right: -42px;\n    position: absolute;\n}\n\n.tc-view-template-document-tiddler-subheading,\n.tc-edit-template-document-tiddler-subheading {\n\tfont-size: 0.7em;\n\tfont-weight: bold;\n\tcolor: <<colour muted-foreground>>;\n}\n\n.tc-view-template-document-tiddler-heading-icon svg,\n.tc-edit-template-document-tiddler-heading-icon svg {\n\tfill: <<colour background>>;\t\n}\n\n.tc-view-template-document-tiddler {\n\tfont-size: 0.9em;\n}\n\n.tc-document-tiddler {\n\tfont-family: Georgia, Times, 'Times New Roman', serif;\n}\n\n.tc-text-slicer-rename input {\n\tdisplay: block;\n\twidth: 100%;\n}\n\n.tc-document-tiddler-link {\n\tcursor: pointer;\n}\n\n.tc-document-tiddler-link:hover {\n    background: <<color background>>;\n}\n\n.tc-document-tiddler-toolbar {\n\tposition: absolute;\n\twidth: 24px;\n\ttext-align: center;\n}\n\n.tc-document-preview-column .tc-sliced-document-body {\n\tmargin-left: 24px;\n}\n\n.tc-document-preview-column .tc-document-tiddler-toolbar {\n\tmargin-left: -24px;\n}\n\n.tc-table-of-contents .tc-slice-toolbar button {\n\tcolor: inherit;\n\tbackground-color: inherit;\n}\n\n.tc-tiddler-frame .tc-document-tiddler-toolbar {\n    left: 0;\n    width: 42px;\n}\n\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/def-list":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/def-list","text":"\\define body()\n<dl>\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n<$list filter={{!!toc-list-filter}} template=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler\"/>\n</$list>\n</dl>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/definition":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/definition","text":"\\define body()\n<$link tag=\"dd\" class=\"tc-document-tiddler-link\">\n\n<$transclude/>\n\n</$link>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/document":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/document","text":"\\define config-document-status()\n$:/state/plugins/tiddlywiki/text-slicer/show-preview-document/$(tv-heading-status-config-prefix)$/$(currentTiddler)$\n\\end\n\n\\define config-show-toolbar()\n$:/state/plugins/tiddlywiki/text-slicer/show-toolbar/$(currentTiddler)$\n\\end\n\n\\define config-show-metadata()\n$:/state/plugins/tiddlywiki/text-slicer/show-metadata/$(currentTiddler)$\n\\end\n\n\\define config-heading-status()\n$:/state/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$\n\\end\n\n\\define body()\n<$set name=\"tv-heading-status-config-title\" value=<<config-heading-status>>>\n<$set name=\"tv-show-toolbar\" value={{$(config-show-toolbar)$}}>\n<div class=\"tc-sliced-document\">\n<div class=\"tc-sliced-document-header\">\n<div class=\"tc-document-tiddler-toolbar\">\n<$reveal type=\"nomatch\" state=<<config-document-status>> text=\"close\" default=\"open\" tag=\"div\">\n<$button set=<<config-document-status>> setTo=\"close\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<config-document-status>> text=\"close\" default=\"open\" tag=\"div\">\n<$button set=<<config-document-status>> setTo=\"open\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n</div>\n<h1 class=\"tc-sliced-document-title\">''Document'': <$link><$view field=\"title\"/></$link></h1>\n</div>\n<$reveal type=\"nomatch\" state=<<config-document-status>> text=\"close\" default=\"open\" tag=\"div\">\n{{||$:/plugins/tiddlywiki/text-slicer/ui/document/header}}\n<div class='tc-sliced-document-body'>\n<$set name=\"tv-show-toolbar\" value={{$(config-show-toolbar)$}}>\n<$set name=\"tv-exclude-filter\" value={{!!toc-exclude-filter}}>\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler\"/>\n</$set>\n</$set>\n</div>\n</$reveal>\n</div>\n</$set>\n</$set>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/heading":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/heading","text":"\\define config-heading-status()\n$(tv-heading-status-config-title)$/$(tv-heading-status-config-prefix)$/$(currentTiddler)$\n\\end\n\n\\define body(level:\"h1\")\n<$set name=\"tv-heading-status-config-title\" value=<<config-heading-status>>>\n<div class=\"tc-document-tiddler\">\n<div class=\"tc-document-tiddler-toolbar\">\n<$reveal type=\"nomatch\" state=<<tv-heading-status-config-title>> text=\"close\" default=<<tv-default-heading-state>> tag=\"div\">\n<$button set=<<tv-heading-status-config-title>> setTo=\"close\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<tv-heading-status-config-title>> text=\"close\" default=<<tv-default-heading-state>> tag=\"div\">\n<$button set=<<tv-heading-status-config-title>> setTo=\"open\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n</div>\n<$link tag=\"$level$\" class=\"tc-document-tiddler-link\">\n<$transclude/>\n</$link>\n<$reveal type=\"nomatch\" state=<<tv-heading-status-config-title>> text=\"close\" default=<<tv-default-heading-state>> tag=\"div\">\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler\"/>\n</$reveal>\n</div>\n</$set>\n\\end\n\n<$macrocall $name=\"body\" level={{!!toc-heading-level}}/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/image":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/image","text":"\\define body()\n<$link tag=\"div\" class=\"tc-document-tiddler-link tc-document-tiddler\">\n\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n<$transclude/>\n\n</$list>\n\n</$link>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/item":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/item","text":"\\define body()\n<$link tag=\"li\" class=\"tc-document-tiddler-link\">\n\n<$transclude/>\n\n</$link>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/list":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/list","text":"\\define body(type:\"ul\")\n<$type$>\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n<$list filter={{!!toc-list-filter}} template=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler\"/>\n</$list>\n</$type$>\n\\end\n\n<$macrocall $name=\"body\" type={{!!toc-list-type}}/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/note":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/note","text":"\\define body()\n<div class=\"tc-slice-note\">\n\n<$link tag=\"div\" class=\"tc-document-tiddler-link tc-document-tiddler\">\n\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n<$transclude/>\n\n</$list>\n\n</$link>\n\n</div>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/paragraph":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/paragraph","text":"\\define body()\n<$link tag=\"div\" class=\"tc-document-tiddler-link tc-document-tiddler\">\n\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n<$transclude/>\n\n</$list>\n\n</$link>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/term":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/term","text":"\\define body()\n<$link tag=\"dt\" class=\"tc-document-tiddler-link\">\n\n<$transclude/>\n\n</$link>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler","text":"\\define if(condition,then,else)\n<$list filter=\"\"\"$condition$ +[limit[1]]\"\"\" emptyMessage=\"\"\"$else$\"\"\" variable=\"ignore\">\n$then$\n</$list>\n\\end\n\n\\define include-component(type)\n<<if \"[{!!toc-type}match[$type$]]\" \"\"\"\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/$type$\" mode=\"block\"/>\n\"\"\">>\n\\end\n\n<$list filter=\"[<tv-show-toolbar>match[yes]]\" variable=\"hasToolbar\">\n{{||$:/plugins/tiddlywiki/text-slicer/ui/tiddler/toolbar}}\n</$list>\n\n<<include-component \"document\">>\n<<include-component \"heading\">>\n<<include-component \"paragraph\">>\n<<include-component \"note\">>\n<<include-component \"list\">>\n<<include-component \"item\">>\n<<include-component \"image\">>\n<<include-component \"def-list\">>\n<<include-component \"term\">>\n<<include-component \"definition\">>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/def-list":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/def-list","text":"\\define body()\n<dl>\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n<$list filter={{!!toc-list-filter}} template=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler\"/>\n</$list>\n</dl>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/definition":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/definition","text":"\\define body()\n<dd>\n\n<$transclude/>\n\n</dd>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/document":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/document","text":"<$set name=\"tv-exclude-filter\" value={{!!toc-exclude-filter}}>\n\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler\"/>\n\n</$set>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/heading":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/heading","text":"\\define body(level:\"h1\")\n<$level$>\n<$transclude/>\n</$level$>\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler\"/>\n\\end\n\n<$macrocall $name=\"body\" level={{!!toc-heading-level}}/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/image":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/image","text":"<$transclude/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/item":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/item","text":"\\define body()\n<li>\n\n<$transclude/>\n\n</li>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/list":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/list","text":"\\define body(type:\"ul\")\n<$type$>\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n<$list filter={{!!toc-list-filter}} template=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler\"/>\n</$list>\n</$type$>\n\\end\n\n<$macrocall $name=\"body\" type={{!!toc-list-type}}/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/note":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/note","text":"<!-- Don't display notes in plain mode -->\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/paragraph":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/paragraph","text":"\\define body()\n<div>\n\n<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n<$transclude/>\n\n</$list>\n\n</div>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/term":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/term","text":"\\define body()\n<dt>\n\n<$transclude/>\n\n</dt>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler","text":"<$vars toc-type={{!!toc-type}}>\n\n<$list filter=\"[<toc-type>match[document]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/document\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[heading]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/heading\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[paragraph]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/paragraph\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[note]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/note\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[list]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/list\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[item]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/item\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[image]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/image\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[def-list]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/def-list\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[term]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/term\" mode=\"block\"/>\n</$list>\n\n<$list filter=\"[<toc-type>match[definition]]\" variable=\"item\">\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/definition\" mode=\"block\"/>\n</$list>\n\n</$vars>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/def-list":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/def-list","text":"<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n`<dl class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$list filter={{!!toc-list-filter}} template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n\n`</dl>`\n\n</$list>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/definition":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/definition","text":"`<dd class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$transclude/>\n\n`</dd>`\n\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/document":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/document","text":"<$set name=\"tv-exclude-filter\" value={{!!toc-exclude-filter}}>\n\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n\n</$set>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/heading":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/heading","text":"`<`<$text text={{!!toc-heading-level}}/>` class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$view field=\"text\" format=\"htmlencodedplainwikified\"/>\n\n`</`<$text text={{!!toc-heading-level}}/>`>`\n\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes","text":"<$list filter=\"[all[current]tags[]addprefix[$:/_DocumentTags/]has[title]]\"><$view field=\"css-class\"/> </$list>"},"$:/plugins/tiddlywiki/text-slicer/templates/static/image":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/image","text":"<$reveal state=\"!!_canonical_uri\" type=\"match\" text=\"\">\n\n`<img src=\"data:`<$view format=\"text\" field=\"type\"/>`;base64,`<$view format=\"text\" field=\"text\"/>`\" class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n</$reveal>\n\n<$reveal state=\"!!_canonical_uri\" type=\"nomatch\" text=\"\">\n\n`<img src=\"`<$text text=<<tv-external-image-path>>/><$view field=\"title\" format=\"doubleurlencoded\"/>`\" class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n</$reveal>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/item":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/item","text":"`<li class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$transclude/>\n\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n\n`</li>`\n\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/list":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/list","text":"<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n`<`<$text text={{!!toc-list-type}}/>` class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$list filter={{!!toc-list-filter}} template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n\n`</`<$text text={{!!toc-list-type}}/>`>`\n\n</$list>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/note":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/note","text":"<!-- Don't display notes in static mode -->\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/paragraph":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/paragraph","text":"<$list filter=\"\"\"[all[current]] $(tv-exclude-filter)$ +[limit[1]]\"\"\" variable=\"item\">\n\n`<p class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$view field=\"text\" format=\"htmlencodedplainwikified\"/>\n\n`</p>`\n\n</$list>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/term":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/term","text":"`<dt class=\"`{{||$:/plugins/tiddlywiki/text-slicer/templates/static/helpers/classes}}`\">`\n\n<$transclude/>\n\n`</dt>`\n\n<$list filter=\"[list<currentTiddler>!has[draft.of]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler\"/>\n"},"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler":{"title":"$:/plugins/tiddlywiki/text-slicer/templates/static/tiddler","text":"<$vars toc-type={{!!toc-type}}>\n\n<$list filter=\"[<toc-type>match[document]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/document\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[heading]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/heading\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[paragraph]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/paragraph\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[note]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/note\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[list]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/list\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[item]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/item\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[image]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/image\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[def-list]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/def-list\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[term]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/term\" mode=\"block\"/>\n\n</$list>\n\n<$list filter=\"[<toc-type>match[definition]]\" variable=\"item\">\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/static/definition\" mode=\"block\"/>\n\n</$list>\n\n</$vars>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/document/header":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/document/header","text":"\\define metadatafield()\n<tr>\n<td>\n''<$transclude tiddler=<<listItem>> field=\"caption\"/>''\n</td>\n<td>\n<$reveal type=\"match\" state=\"\"\"$(listItem)$!!field-type\"\"\" text=\"string\">\n<$edit-text field={{$(listItem)$!!field}}/>\n</$reveal>\n<$reveal type=\"match\" state=\"\"\"$(listItem)$!!field-type\"\"\" text=\"list\">\n<$edit-text tag=\"textarea\" field={{$(listItem)$!!field}}/>\n</$reveal>\n</td>\n</tr>\n\\end\n\n<div class=\"tc-sliced-document-header\">\n\n''Exclude filter'': <$edit-text field=\"toc-exclude-filter\"/>\n\n<$checkbox tiddler=<<config-show-toolbar>> field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> Show toolbar </$checkbox> <$checkbox tiddler=<<config-show-metadata>> field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> Show metadata</$checkbox> <$button>\n<$action-sendmessage $message=\"tm-open-window\" $param=<<currentTiddler>> template=\"$:/plugins/tiddlywiki/text-slicer/templates/plain/document\"/>\nView document\n</$button>\n\n<$reveal state=<<config-show-metadata>> default=\"no\" type=\"match\" text=\"yes\">\n<table>\n<tbody>\n<$list filter=\"[all[system+tiddlers]tag[$:/tags/DocumentMetaData]]\" variable=\"listItem\">\n<<metadatafield>>\n</$list>\n</tbody>\n</table>\n</$reveal>\n\n\n</div>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/edit-template-segment":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/edit-template-segment","tags":"$:/tags/EditTemplate","text":"\\define edit-field(name,tag:\"input\")\n$name$:\n\n<$edit-text field=\"\"\"$name$\"\"\" tag=\"$tag$\" class=\"tc-edit-texteditor\"/>\n\\end\n\n<$reveal type=\"nomatch\" state=\"!!toc-type\" text=\"\">\n\n<div class=\"tc-edit-template-document-tiddler-wrapper\">\n\n<div class=\"tc-edit-template-document-tiddler-heading\">\n\n<div class=\"tc-edit-template-document-tiddler-heading-icon\">\n\n{{$:/core/images/file}}\n\n</div>\n\n<div class=\"tc-edit-template-document-tiddler-subheading\">\n\n<$view field=\"toc-type\"/>\n\n</div>\n\n<<edit-field \"list\" tag:\"textarea\">>\n\n</div>\n\n</div>\n\n</$reveal>\n\n"},"$:/plugins/tiddlywiki/text-slicer/filters/Orphans":{"title":"$:/plugins/tiddlywiki/text-slicer/filters/Orphans","tags":"$:/tags/Filter","filter":"[has[toc-type]] -[toc-type[document]list-children[]]","description":"[Text-slicer] Tiddlers that are not part of any document","text":""},"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/empty":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/empty","text":"<div class=\"tc-sliced-document-header\">\n\nCreate a document by slicing an existing tiddler\n\n---\n\n[[Help|$:/plugins/tiddlywiki/text-slicer/docs]]\n\n</div>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/multiple":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/multiple","text":"Show document: <$select tiddler=\"$:/plugins/tiddlywiki/text-slicer/config/currentDocument\">\n<$list filter=\"[toc-type[document]!has[draft.of]sort[title]]\">\n<option value=<<currentTiddler>>><$view field=\"title\"/></option>\n</$list>\n</$select>\n\n<$tiddler tiddler={{$:/plugins/tiddlywiki/text-slicer/config/currentDocument}}>\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/document\"/>\n\n</$tiddler>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/single":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/single","text":"<$list filter=\"[toc-type[document]!has[draft.of]sort[title]limit[1]]\" template=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/document\"/>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/preview-column":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/preview-column","tags":"$:/tags/AboveStory","text":"<$scrollable fallthrough=\"no\" class=\"tc-document-preview-column\">\n\n<$vars\n\ttv-default-heading-state=\"open\"\n>\n\n<$list filter=\"[toc-type[document]!has[draft.of]sort[title]limit[1]]\" emptyMessage={{$:/plugins/tiddlywiki/text-slicer/ui/preview-column/empty}}>\n\n<$list filter=\"[toc-type[document]!has[draft.of]sort[title]butfirst[1]limit[1]]\" emptyMessage={{$:/plugins/tiddlywiki/text-slicer/ui/preview-column/single}} template=\"$:/plugins/tiddlywiki/text-slicer/ui/preview-column/multiple\"/>\n\n</$list>\n\n</$vars>\n\n</$scrollable>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/slice-modal":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/slice-modal","footer":"<$button message=\"tm-close-tiddler\">Cancel</$button> <$button><$action-sendmessage $message=\"tm-close-tiddler\"/><$action-sendmessage $message=\"tm-slice-tiddler\" $param=<<currentTiddler>> slicerRules={{$:/config/plugins/text-slicer/slice-rule}} outputMode={{$:/config/plugins/text-slicer/output-mode}} destTitle={{$:/config/plugins/text-slicer/base-title}}/>Slice</$button>","subtitle":"Slicing \"<$text text=<<currentTiddler>>/>\" into chunks","text":"''Choose how the tiddler should be sliced''\n\nPrefix for extracted tiddlers: <$edit-text tiddler=\"$:/config/plugins/text-slicer/base-title\" default={{{ [[Sliced up ]addsuffix<currentTiddler>addsuffix[:]] }}} tag=\"input\" size=\"30\"/>\n\n<$select tiddler=\"$:/config/plugins/text-slicer/slice-rule\" default=\"html-by-paragraph\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/text-slicer/slicer-rules]!has[draft.of]]\">\n<option value={{!!name}}><$text text={{!!description}}/></option>\n</$list>\n</$select>\n\nOutput mode: <$select tiddler=\"$:/config/plugins/text-slicer/output-mode\" default=\"html\">\n<option value=\"html\">HTML</option>\n<option value=\"wiki\">Wiki text</option>\n</$select>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/slice-toolbar-button":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/slice-toolbar-button","tags":"$:/tags/ViewToolbar","list-before":"$:/core/ui/Buttons/edit","caption":"{{$:/plugins/tiddlywiki/text-slicer/images/text-slicer-icon}} Slice text tiddler","description":"Slice this text tiddler by headings and lists","text":"\\whitespace trim\n\n\\define hint()\nSlice this text tiddler into chunks\n\\end\n\n<$list filter=\"[<currentTiddler>!is[image]!is[binary]]\" variable=\"ignore\">\n<$button tooltip=<<hint>> aria-label=<<hint>> class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-modal\" $param=\"$:/plugins/tiddlywiki/text-slicer/ui/slice-modal\" currentTiddler=<<currentTiddler>>/>\n<$list filter=\"[<tv-config-toolbar-icons>match[yes]]\">\n{{$:/plugins/tiddlywiki/text-slicer/images/text-slicer-icon}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>match[yes]]\">\n<span class=\"tc-btn-text\"> Slice tiddler</span>\n</$list>\n</$button>\n</$list>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/tiddler/toolbar/title":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/tiddler/toolbar/title","tags":"$:/tags/TextSlicerToolbar","text":"\\define renameProxyTitle()\n$:/state/plugins/tiddlywiki/text-slicer/rename-$(currentTiddler)$\n\\end\n\n\\define body()\n<div class=\"tc-text-slicer-rename\">\n<$edit-text tag=\"input\" tiddler=<<renameProxyTitle>> placeholder=\"Rename\" default=<<currentTiddler>>/>\n<$reveal type=\"nomatch\" state=\"\"\"$(renameProxyTitle)$\"\"\" text=<<currentTiddler>> default=<<currentTiddler>>>\n<$button>\n<$action-deletetiddler $tiddler=<<renameProxyTitle>>/>\ncancel\n</$button>\n<$button>\n<$action-sendmessage $message=\"tm-rename-tiddler\" from=<<currentTiddler>> to={{$(renameProxyTitle)$}}/>\n<$action-deletetiddler $tiddler=<<renameProxyTitle>>/>\nrename\n</$button>\n<$set name=\"proxy-title\" value={{$(renameProxyTitle)$}}>\n<$list filter=\"\"\"[<proxy-title>is[tiddler]]\"\"\">\nWarning: tiddler already exists\n</$list>\n</$set>\n</$reveal>\n</div>\n\\end\n\n<<body>>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/tiddler/toolbar":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/tiddler/toolbar","text":"<div class=\"tc-slice-toolbar\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TextSlicerToolbar]!has[draft.of]]\" variable=\"listItem\"><$transclude tiddler=<<listItem>>/></$list>\n</div>\n"},"$:/plugins/tiddlywiki/text-slicer/ui/view-template-segment":{"title":"$:/plugins/tiddlywiki/text-slicer/ui/view-template-segment","tags":"$:/tags/ViewTemplate","text":"\\define config-heading-status()\n$:/state/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$\n\\end\n\n<$reveal type=\"nomatch\" state=<<folded-state>> text=\"hide\" retain=\"yes\" animate=\"yes\">\n\n<$reveal type=\"nomatch\" state=\"!!toc-type\" text=\"\">\n\n<div class=\"tc-view-template-document-tiddler-wrapper\">\n\n<div class=\"tc-view-template-document-tiddler-heading\">\n\n<div class=\"tc-view-template-document-tiddler-heading-icon\">\n\n{{$:/core/images/file}}\n\n</div>\n\n<div class=\"tc-view-template-document-tiddler-subheading\">\n\n<$view field=\"toc-type\"/>\n\n</div>\n\nParents: <$list filter=\"[all[current]listed[]!is[system]]\" emptyMessage=\"None\">\n<$link><$view field=\"title\"/></$link>\n</$list>\n\n</div>\n\n<div class=\"tc-view-template-document-tiddler\">\n\n<$vars\n\ttv-default-heading-state=\"close\"\n\ttv-heading-status-config-prefix=\"view-template\"\n\ttv-heading-status-config-title=<<config-heading-status>>\n>\n\n<$transclude tiddler=\"$:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler\"/>\n\n</$vars>\n\n</div>\n\n</div>\n\n</$reveal>\n\n</$reveal>\n"}}}