mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-30 12:00:28 +00:00
bc448ce1fd
* Add warning in document tiddler toolbar if tiddler already exists * Live preview document in new window * Fix slicer.js bug that was preventing the list field of headings from being filled in correctly * Rationalise some class names
94 lines
3.7 KiB
Plaintext
94 lines
3.7 KiB
Plaintext
title: $:/plugins/tiddlywiki/text-slicer/docs
|
|
|
|
!! Introduction
|
|
|
|
Individual tiddlers are created for each heading, paragraph and list item. They are linked together into a hierarchical outline using TiddlyWiki's tagging mechanism.
|
|
|
|
For example, consider a tiddler titled ''Example'' containing this simple text:
|
|
|
|
<<<
|
|
! This is a heading
|
|
|
|
This is a paragraph.
|
|
|
|
* And the first list item
|
|
* Second list item
|
|
<<<
|
|
|
|
It will be sliced up into:
|
|
|
|
* a tiddler for the overall document
|
|
** a tiddler for the heading
|
|
*** a tiddler for the paragraph
|
|
*** a tiddler for the list
|
|
**** and a tiddler for each list item
|
|
|
|
These tiddlers are bound together using tagging: child tiddlers are tagged with the title of their parent, and the parent tiddler has a ''list'' field that lists each child in the correct order.
|
|
|
|
!! Slicing Process
|
|
|
|
Slicing generates the following component tiddlers.
|
|
|
|
Tiddler 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:
|
|
|
|
* root text (e.g. ''para'')
|
|
* a dash ''-''
|
|
* the first few words of the text of the item (up to 40 characters), separated with dashes ''-''
|
|
* if necessary, a dash ''-'' and a numerical index to make the title unique
|
|
|
|
For example, ''para-how-to-use-pentagonal-tiles 23''.
|
|
|
|
!!! Document
|
|
|
|
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'': 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
|
|
|
|
Tiddlers representing headings have the following fields:
|
|
|
|
* ''toc-type'': the text "heading"
|
|
* ''toc-heading-level'': the heading level "h1", "h2", "h3" etc.
|
|
* ''title'': an automatically generated unique title
|
|
* ''text'': the text of the heading
|
|
* ''list'': ordered list of tiddlers tagged with this heading (i.e. the child headings, paragraphs and lists displayed under this heading)
|
|
* ''tags'': tagged with the title of the parent heading
|
|
** In addition, any CSS classes found in the HTML are converted into tags
|
|
|
|
!!! Paragraphs
|
|
|
|
Tiddlers representing paragraphs have the following fields:
|
|
|
|
* ''toc-type'': the text "paragraph"
|
|
* ''title'': an automatically generated unique title
|
|
* ''text'': the text of the paragraph
|
|
* ''tags'': tagged with the title of the parent heading
|
|
** In addition, any CSS classes found in the HTML are converted into tags
|
|
|
|
!!! Lists
|
|
|
|
Lists are represented by several tiddlers: one for the list itself, and one for each item in the list.
|
|
|
|
The tiddler representing the list itself has the following fields:
|
|
|
|
* ''toc-type'': the text "list"
|
|
* ''toc-list-type'': the text "ul" or "ol"
|
|
* ''title'': an automatically generated unique title
|
|
* ''text'': the default filter used to generate the titles of the list items
|
|
* ''list'': ordered list of titles of tiddlers representing the items in this list
|
|
* ''tags'': tagged with the title of the parent heading
|
|
** In addition, any CSS classes found in the HTML are converted into tags
|
|
|
|
The tiddlers representing items within the list have the following fields:
|
|
|
|
* ''toc-type'': the text "item"
|
|
* ''title'': an automatically generated unique title
|
|
* ''text'': the text of the list item
|
|
* ''tags'': tagged with the title of the tiddler representing the list itself
|