1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Fix toc indentation problem (#7627)

* fix toc indentation problem

* add caption to Third & Fourth toc tiddlers to see caption-handling

* reset modified fields
This commit is contained in:
Mario Pietsch 2023-07-22 13:41:19 +02:00 committed by GitHub
parent 160cc0e9a9
commit b000f20283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 10 deletions

View File

@ -7,7 +7,7 @@ tags: $:/tags/Macro
\define toc-caption() \define toc-caption()
\whitespace trim \whitespace trim
<span class="tc-toc-caption"> <span class="tc-toc-caption tc-tiny-gap-left">
<$set name="tv-wikilinks" value="no"> <$set name="tv-wikilinks" value="no">
<$transclude field="caption"> <$transclude field="caption">
<$view field="title"/> <$view field="title"/>
@ -145,7 +145,7 @@ tags: $:/tags/Macro
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}> <$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item"> <$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
<li class=<<toc-item-class>>> <li class=<<toc-item-class>>>
<$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>"> <$list filter="[all[current]tagging[]$sort$limit[1]]" variable="ignore" emptyMessage="""<$button class="tc-btn-invisible">{{$:/core/images/blank}}</$button><span class="toc-item-muted"><<toc-caption>></span>""">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open"> <$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep"> <$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$transclude tiddler=<<toc-closed-icon>> /> <$transclude tiddler=<<toc-closed-icon>> />

View File

@ -1,6 +1,8 @@
caption: Fourth-Caption
created: 20150221194405000 created: 20150221194405000
modified: 20211114013601188 modified: 20211114013601188
tags: Contents [[Table-of-Contents Demonstrations]] tags: Contents [[Table-of-Contents Demonstrations]]
title: Fourth title: Fourth
type: text/vnd.tiddlywiki
<<.toc-lorem>> <<.toc-lorem>>

View File

@ -2,5 +2,15 @@ created: 20150221194423000
modified: 20211114013601189 modified: 20211114013601189
tags: SecondThree [[Table-of-Contents Demonstrations]] tags: SecondThree [[Table-of-Contents Demonstrations]]
title: SecondThreeThree title: SecondThreeThree
toc-link: no
type: text/vnd.tiddlywiki
''Important''
It's important that this tiddler has no "child" to be able to visually test every possible toc code-path.
* This tiddler has a field ''toc-link: no''
* Do not tag any other tiddler with the title of this one
<<.toc-lorem>>

View File

@ -1,7 +1,9 @@
caption: Third-Caption
created: 20150221194436000 created: 20150221194436000
list: ThirdOne ThirdTwo ThirdThree list: ThirdOne ThirdTwo ThirdThree
modified: 20211114013601191 modified: 20211114013601191
tags: Contents [[Table-of-Contents Demonstrations]] tags: Contents [[Table-of-Contents Demonstrations]]
title: Third title: Third
type: text/vnd.tiddlywiki
<<.toc-lorem>> <<.toc-lorem>>

View File

@ -2779,15 +2779,11 @@ input.tc-palette-manager-colour-input {
white-space: nowrap; white-space: nowrap;
} }
.tc-table-of-contents button { .tc-table-of-contents button,
.tc-table-of-contents .toc-item-muted {
color: <<colour sidebar-foreground>>; color: <<colour sidebar-foreground>>;
} }
button + .tc-toc-caption,
button > .tc-toc-caption{
margin-left: .25em;
}
.tc-table-of-contents svg { .tc-table-of-contents svg {
width: 0.7em; width: 0.7em;
height: 0.7em; height: 0.7em;