From 32099b85d3b12f9e590274cb7550e3e531131706 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 21 Jun 2014 11:17:04 +0100 Subject: [PATCH] Add table of contents to tw5.com --- core/language/en-GB/SideBar.multids | 1 + editions/tw5.com/tiddlers/TableOfContents.tid | 335 ++++++++++++++++++ themes/tiddlywiki/vanilla/base.tid | 52 ++- 3 files changed, 387 insertions(+), 1 deletion(-) create mode 100644 editions/tw5.com/tiddlers/TableOfContents.tid diff --git a/core/language/en-GB/SideBar.multids b/core/language/en-GB/SideBar.multids index b2daeac2f..e18dd924e 100644 --- a/core/language/en-GB/SideBar.multids +++ b/core/language/en-GB/SideBar.multids @@ -1,6 +1,7 @@ title: $:/language/SideBar/ All/Caption: All +Contents/Caption: Contents Drafts/Caption: Drafts Missing/Caption: Missing More/Caption: More diff --git a/editions/tw5.com/tiddlers/TableOfContents.tid b/editions/tw5.com/tiddlers/TableOfContents.tid new file mode 100644 index 000000000..7db42e21c --- /dev/null +++ b/editions/tw5.com/tiddlers/TableOfContents.tid @@ -0,0 +1,335 @@ +title: TableOfContents +list-after: $:/core/ui/SideBar/Open +tags: $:/tags/SideBar +caption: {{$:/language/SideBar/Contents/Caption}} + +\define toc-heading(caption,body) +<$reveal type="nomatch" state=<> text="show"> +<$button set=<> setTo="show" class="btn-invisible">▹ $caption$ + + +<$reveal type="match" state=<> text="show"> +<$button set=<> setTo="hide" class="btn-invisible">▿ $caption$ + + +<$reveal type="match" state=<> text="show" retain="yes" animate="yes"> + +$body$ + + +\end +
+ +# Guide +## <> +## <> +## <> +## <> +## <> +# Reference +## <> +## <> +## <> +## <> +## <> +## <> +# Advanced +## <> +## <> +# About +## <> +## <> + +
diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index db27856c0..e3cbbefe1 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -530,6 +530,7 @@ a.tw-tiddlylink-external:hover { width: 1%; /* Makes this column be as narrow as possible */ text-align: right; font-style: italic; + font-weight: 200; } .tw-view-field-value { @@ -1054,7 +1055,7 @@ canvas.tw-edit-bitmapeditor { } .tw-tab-content { - padding-top: 14px; + margin-top: 14px; } .tw-tab-content.tw-vertical { @@ -1234,4 +1235,53 @@ canvas.tw-edit-bitmapeditor { border: 1px solid #000; } +/* +** Table of contents +*/ +.tw-sidebar-lists .tw-table-of-contents { + white-space: nowrap; +} + +.tw-table-of-contents ol { + list-style-type: none; + padding-left: 0; +} + +.tw-table-of-contents ol ol { + padding-left: 1em; +} + +.tw-table-of-contents li { + font-size: 1.0em; + font-weight: bold; +} + +.tw-table-of-contents li a { + font-weight: bold; +} + +.tw-table-of-contents li li { + font-size: 0.95em; + font-weight: normal; + line-height: 1.4; +} + +.tw-table-of-contents li li a { + font-weight: normal; +} + +.tw-table-of-contents li li li { + font-size: 0.95em; + font-weight: 200; + line-height: 1.5; +} + +.tw-table-of-contents li li li a { + font-weight: bold; +} + +.tw-table-of-contents li li li li { + font-size: 0.95em; + font-weight: 200; +}