diff --git a/plugins/tiddlywiki/text-slicer/docs.tid b/plugins/tiddlywiki/text-slicer/docs.tid index 13d4f6bd8..561e41eea 100644 --- a/plugins/tiddlywiki/text-slicer/docs.tid +++ b/plugins/tiddlywiki/text-slicer/docs.tid @@ -44,7 +44,10 @@ The document itself is represented by a tiddler with the following fields: * ''toc-type'': the text "document" * ''title'': the text ''"Sliced up "'' plus the title of the tiddler that was sliced -* ''text'': left blank for description of the document +* ''text'': Available for comments about the document +* ''list'': ordered list of tiddlers making up the root level of this document + +Note that the relationship between the document and component tiddlers is that the components are listed in the ''list'' field. This differs from the relationship between headings and their components, which use the ''tags'' field of the components to tie them to the heading. The purpose of this difference is to make it possible to clone doument tiddlers without losing the connection to the constituent parts. !!! Headings diff --git a/plugins/tiddlywiki/text-slicer/export-full-doc.tid b/plugins/tiddlywiki/text-slicer/export-full-doc.tid new file mode 100644 index 000000000..fae17b167 --- /dev/null +++ b/plugins/tiddlywiki/text-slicer/export-full-doc.tid @@ -0,0 +1,4 @@ +title: $:/plugins/tiddlywiki/text-slicer/templates/export-full-doc +tags: $:/tags/ViewTemplate + +<$list filter="[list!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/template-tiddler" listItem="item"/> diff --git a/plugins/tiddlywiki/text-slicer/slicer.js b/plugins/tiddlywiki/text-slicer/slicer.js index 1ac4bbb8e..1422e69f2 100644 --- a/plugins/tiddlywiki/text-slicer/slicer.js +++ b/plugins/tiddlywiki/text-slicer/slicer.js @@ -164,16 +164,17 @@ Slicer.prototype.processNode = function(domNode) { var tagName = domNode.tagName.toLowerCase(); if(tagName === "h1" || tagName === "h2" || tagName === "h3" || tagName === "h4") { if(!this.isBlank(text)) { + title = this.makeUniqueTitle("heading",text); parentTitle = this.popParentStackUntil(tagName); tags = [parentTitle]; if(domNode.className.trim() !== "") { tags = tags.concat(domNode.className.split(" ")); } - this.addToList(parentTitle,text); + this.addToList(parentTitle,title); this.parentStack.push({type: tagName, title: this.addTiddler({ "toc-type": "heading", "toc-heading-level": tagName, - title: this.makeUniqueTitle("heading",text), + title: title, text: text, list: [], tags: tags diff --git a/plugins/tiddlywiki/text-slicer/styles.tid b/plugins/tiddlywiki/text-slicer/styles.tid index a7fba5226..0126e8494 100644 --- a/plugins/tiddlywiki/text-slicer/styles.tid +++ b/plugins/tiddlywiki/text-slicer/styles.tid @@ -21,6 +21,11 @@ tags: $:/tags/Stylesheet margin-left: 24px; } +.tc-document-preview-column .tc-sliced-document { + margin-bottom: 3px; + border-bottom: 2px solid <>; +} + .tc-view-template-document-tiddler-heading { border-top: 2px solid <>; } @@ -29,11 +34,6 @@ tags: $:/tags/Stylesheet font-size: 0.9em; } -.tc-sliced-document { - margin-bottom: 3px; - border-bottom: 2px solid <>; -} - .tc-document-tiddler { font-family: Georgia, Times, 'Times New Roman', serif; } @@ -57,7 +57,7 @@ tags: $:/tags/Stylesheet text-align: center; } -.tc-document-preview-column .tc-table-of-contents { +.tc-document-preview-column .tc-sliced-document-body { margin-left: 24px; } diff --git a/plugins/tiddlywiki/text-slicer/template-document.tid b/plugins/tiddlywiki/text-slicer/template-document.tid index c8a4b21bc..260857e6e 100644 --- a/plugins/tiddlywiki/text-slicer/template-document.tid +++ b/plugins/tiddlywiki/text-slicer/template-document.tid @@ -21,13 +21,15 @@ $:/config/plugins/tiddlywiki/text-slicer/heading-status/$(currentTiddler)$ <$checkbox tiddler=<> field="text" checked="yes" unchecked="no" default="no"> Show toolbar +{{||$:/plugins/tiddlywiki/text-slicer/templates/view-document}} + -
+
<$set name="tv-show-toolbar" value={{$(config-show-toolbar)$}}> -<$list filter="[tag!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/template-tiddler" listItem="item"/> +<$list filter="[list!has[draft.of]]" template="$:/plugins/tiddlywiki/text-slicer/templates/template-tiddler" listItem="item"/> diff --git a/plugins/tiddlywiki/text-slicer/template-heading.tid b/plugins/tiddlywiki/text-slicer/template-heading.tid index 7a12081d3..c35e7115b 100644 --- a/plugins/tiddlywiki/text-slicer/template-heading.tid +++ b/plugins/tiddlywiki/text-slicer/template-heading.tid @@ -8,6 +8,8 @@ $(tv-heading-status-config-title)$/$(currentTiddler)$ <$set name="tv-heading-status-config-title" value=<>>
+ +<$list filter="[!prefix[no]]" variable="hasToolbar"> <$reveal type="nomatch" state=<> text="open" default=<>> <$button set=<> setTo="open" class="tc-btn-invisible"> {{$:/core/images/down-arrow}} @@ -18,6 +20,8 @@ $(tv-heading-status-config-title)$/$(currentTiddler)$ {{$:/core/images/right-arrow}} + +
<$link tag="$level$" class="tc-document-tiddler-link"> <$view field="text"/> diff --git a/plugins/tiddlywiki/text-slicer/template-view-document.tid b/plugins/tiddlywiki/text-slicer/template-view-document.tid new file mode 100644 index 000000000..30c6d6aec --- /dev/null +++ b/plugins/tiddlywiki/text-slicer/template-view-document.tid @@ -0,0 +1,6 @@ +title: $:/plugins/tiddlywiki/text-slicer/templates/view-document + +<$button> +<$action-sendmessage $message="tm-open-window" $param=<> template="$:/plugins/tiddlywiki/text-slicer/templates/export-full-doc" tv-show-toolbar="no" tv-show-gadgets="no"/> +View document + diff --git a/plugins/tiddlywiki/text-slicer/toolbar-title.tid b/plugins/tiddlywiki/text-slicer/toolbar-title.tid index 03c3680d6..98e3b9359 100644 --- a/plugins/tiddlywiki/text-slicer/toolbar-title.tid +++ b/plugins/tiddlywiki/text-slicer/toolbar-title.tid @@ -18,6 +18,11 @@ cancel <$action-deletetiddler $tiddler=<>/> rename +<$set name="proxy-title" value={{$(renameProxyTitle)$}}> +<$list filter="""[is[tiddler]]"""> +Warning: tiddler already exists + +
\end