2013 年我曾經發表了 TiddlyWiki 的 NodeTreePlugin(目前在 GitHub 上還找得到!)(另外我也重新上傳了 TiddlyWiki 檔)
或是先移植 TiddlyWiki 5 的這個 plugin 裡所含的 CSS?好像簡單得多。
<div list-tree> * 是誰太勇敢 * 說喜歡離別 * 只要今天不要明天 * 眼睜睜看著愛從指縫 * 中溜走 * 還說再見 * 不夠時間好好來恨你 * 終於明白恨人不容易 * 不願愛得沒有答案結局 </div>
↑初步成功,但有點小 bug,不知是否 DW 產生清單的 HTML 太複雜還是怎樣,下面這段 CSS 的效果:
/* top-level: Lines if multiple top elements. No lines if single top element. */ .list-tree > li:last-of-type:before { display:none; } .list-tree > li:first-of-type:before { border-top: {{!!list-tree-thickness}} solid {{!!list-tree-color}}; } .list-tree > li:before { border-left: {{!!list-tree-thickness}} solid {{!!list-tree-color}}; height: 100%;}
竟然沒出來
<html><div class="list-tree"></html> * Starry, starry night * Paint your palette blue and gray * Look out on a summer's day * With eyes that know the darkness in my soul * Shadows on the hills * Sketch the trees and daffodils * Catch the breeze and the winter chills * In colors on the snowy linen land * Now I understand * What you tried to say to me * And how you suffered for your sanity * And how you tried to set them free * They would not listen, they did not know how * Perhaps they'll listen now <html></div></html>
→ Need help with last mile to port a nice "ListTree" style - DokuWiki User Forum24)
/* top-level: Lines if multiple top elements. No lines if single top element. */ .list-tree > ul > li:last-of-type:before { display:none; } .list-tree > ul > li:first-of-type:before { border-top: 2px solid silver; } .list-tree > ul > li:before { border-left: 2px solid silver; height: 100%; } .list-tree > ul > li:after { border-left: 0; }
↑就正常了!自己解決了!(原理)
ul.list-tree > li
= 最頂層div.list-tree > ul > li
∴要插一層 ul
20200916 嘗試:
NodeTree class | 備註 | 取代為 DW 元素 |
---|---|---|
.nt-ti | 「tree item」樹枝 | .nodetree ul > li |
.nt-ts | 「tree separator」枝與枝間的分隔 | .nodetree ol > li |
.nt-tl | 「tree list」整個樹狀清單 | .nodetree ul |
.nt-tp | 「tree parent?」樹狀清單的上層元素 | .nodetree div.tp |
@import "nodetree.css";
plugin»wrap»noPrefix
裡加上 nodetree
<div nodetree> * 行嗎 * 來棵樹 * 吧 </div>
↑效果沒出來,就還是一般的 bullet list 樣
@import "/dw/conf/nodetree.css";
→ 403 Forbidden
@import "/conf/nodetree.css";
→ 404 Not found
div.tp p { margin: 0; }
(原本 p 都有一個 10px 的上下 margin ← 拿掉)