1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Text-slicer: Add support for notes within documents

This commit is contained in:
Jermolene 2016-02-01 21:26:11 +00:00
parent b8aa60cdab
commit 176d2ccd76
8 changed files with 62 additions and 0 deletions

View File

@ -178,6 +178,15 @@ Tiddlers representing images have the following fields:
* ''title'': an automatically generated unique title
* ''type'': appropriate content type for the image (eg "image/jpeg")
!!! Notes
Notes 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:
* ''toc-type'': the text "note"
* ''title'': an automatically generated unique title
* ''text'': the text of the note
* ''tags'': any CSS classes found in the HTML are converted into tags
! Document Metadata, Tags and Classes
[TBD]

View File

@ -21,6 +21,20 @@ tags: $:/tags/Stylesheet
font-size: 1.7em;
}
.tc-slice-note {
color: #800;
padding: 4px 4px 4px 4px;
border: 1px solid #feed77;
background: #feed77;
background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#dede80),color-stop(7%,#feed77),color-stop(92%,#feed77),color-stop(100%,#dede80));
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%);
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%);
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%);
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%);
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%);
<<box-shadow "1px 1px 6px rgba(0,0,0,0.4)">>
}
.tc-document-preview-column .tc-sliced-document-header {
margin-left: 24px;
}

View File

@ -0,0 +1,19 @@
title: $:/plugins/tiddlywiki/text-slicer/templates/interactive/note
\define body()
<div class="tc-slice-note">
<$link tag="div" class="tc-document-tiddler-link tc-document-tiddler">
<$list filter="""[all[current]] $(tv-exclude-filter)$ +[limit[1]]""" variable="item">
<$transclude/>
</$list>
</$link>
</div>
\end
<<body>>

View File

@ -16,6 +16,10 @@ title: $:/plugins/tiddlywiki/text-slicer/templates/interactive/tiddler
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/paragraph" mode="block"/>
</$reveal>
<$reveal type="match" state="!!toc-type" text="note">
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/note" mode="block"/>
</$reveal>
<$reveal type="match" state="!!toc-type" text="list">
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/interactive/list" mode="block"/>
</$reveal>

View File

@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/text-slicer/templates/plain/note
<!-- Don't display notes in plain mode -->

View File

@ -14,6 +14,10 @@ title: $:/plugins/tiddlywiki/text-slicer/templates/plain/tiddler
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/plain/paragraph" mode="block"/>
</$list>
<$list filter="[<toc-type>prefix[note]]" variable="item">
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/plain/note" mode="block"/>
</$list>
<$list filter="[<toc-type>prefix[list]]" variable="item">
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/plain/list" mode="block"/>
</$list>

View File

@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/text-slicer/templates/static/note
<!-- Don't display notes in static mode -->

View File

@ -20,6 +20,12 @@ title: $:/plugins/tiddlywiki/text-slicer/templates/static/tiddler
</$list>
<$list filter="[<toc-type>prefix[note]]" variable="item">
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/note" mode="block"/>
</$list>
<$list filter="[<toc-type>prefix[list]]" variable="item">
<$transclude tiddler="$:/plugins/tiddlywiki/text-slicer/templates/static/list" mode="block"/>