UNPKG

tiddlywiki-production

Version:
1 lines 96.6 kB
$tw.preloadTiddler({"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","text":"{\"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\\\\\\\"