切換選單
切換偏好設定選單
切換個人選單
尚未登入
若您做出任何編輯,會公開您的 IP 位址。

「TiddlyWiki」:修訂間差異

出自H.-H.'s Wiki
Hsins留言 | 貢獻
建立內容為「== 部署服務 == <syntaxhighlight lang="javascript"> const tw = require('tiddlywiki').TiddlyWiki(); tw.boot.argv = ["wiki", "--listen", "credentials=../users.csv", "readers=(anon)", "writers=(authenticated)", "admin=H.-H."]; tw.boot.boot(); </syntaxhighlight>」的新頁面
 
Hsins留言 | 貢獻
無編輯摘要
 
第6行: 第6行:
tw.boot.boot();
tw.boot.boot();
</syntaxhighlight>
</syntaxhighlight>
== 使用技巧 ==
=== 建立日誌條目時,自動設定類型 ===
在安裝完 <code>Markdown</code> 插件後,可以將 Tiddler 的類型設置為 <code>text/markdown</code> 來使用 Markdown 語法進行編輯,然而 TiddlyWiki 核心組件 <code>Core</code> 中所提供的 "建立一個新的日誌條目(Create a new journal tiddler)" 按鈕,並不會預設類型為 <code>text/markdown</code> 而需要手動設定。
如果要變更建立日誌條目時的行為,可以編輯 <code>$:/core/ui/Actions/new-journal</code> 條目:<syntaxhighlight lang="tid">
\whitespace trim
\function get-tags() [<textFieldTags>] [<tagsFieldTags>] +[join[ ]]
<$let journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="<$transclude $variable='now' format=<<journalTitleTemplate>>/>">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}} type="text/markdown"/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text=<<journalText>> type="text/markdown"/>
</$reveal>
</$wikify>
</$let>
</syntaxhighlight>亦即在原有的基礎上,在 <code><$action-sendmessage></code> 中添加 <code>type="text/markdown"</code> 設定。

於 2025年2月13日 (四) 10:57 的最新修訂

部署服務

const tw = require('tiddlywiki').TiddlyWiki();

tw.boot.argv = ["wiki", "--listen", "credentials=../users.csv", "readers=(anon)", "writers=(authenticated)", "admin=H.-H."];
tw.boot.boot();

使用技巧

建立日誌條目時,自動設定類型

在安裝完 Markdown 插件後,可以將 Tiddler 的類型設置為 text/markdown 來使用 Markdown 語法進行編輯,然而 TiddlyWiki 核心組件 Core 中所提供的 "建立一個新的日誌條目(Create a new journal tiddler)" 按鈕,並不會預設類型為 text/markdown 而需要手動設定。

如果要變更建立日誌條目時的行為,可以編輯 $:/core/ui/Actions/new-journal 條目:

\whitespace trim
\function get-tags() [<textFieldTags>] [<tagsFieldTags>] +[join[ ]]
<$let journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="<$transclude $variable='now' format=<<journalTitleTemplate>>/>">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}} type="text/markdown"/>
</$reveal>
<$reveal type="match" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text=<<journalText>> type="text/markdown"/>
</$reveal>
</$wikify>
</$let>

亦即在原有的基礎上,在 <$action-sendmessage> 中添加 type="text/markdown" 設定。