-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10b2480
commit 41768d2
Showing
19 changed files
with
194 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
created: 20211003071732972 | ||
creator: 林一二 | ||
modified: 20211003071932534 | ||
modified: 20240327083343535 | ||
modifier: 林一二 | ||
tags: TW-Locator | ||
title: TW-Locator例子:当前知识库的目录 | ||
type: text/vnd.tiddlywiki | ||
|
||
```html | ||
<$macrocall $name="locator-view" baseTitle=欢迎来到太微! /> | ||
``` | ||
|
||
<$macrocall $name="locator-view" baseTitle=欢迎来到太微! /> | ||
<<wikitext-example """<$macrocall $name="locator-view" baseTitle=欢迎来到太微! />""">> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
created: 20220217093924811 | ||
creator: 林一二 | ||
modified: 20220217093935274 | ||
modified: 20240327083933952 | ||
modifier: 林一二 | ||
tags: 太微背景介绍 | ||
title: 中文文档 | ||
type: text/vnd.tiddlywiki | ||
|
||
[[TiddlyWiki官网|https://tiddlywiki.com/]]和一系列社区提供了太微完善的教程,但访问较为缓慢,不熟悉英文的爱好者请阅读由[[@BramChen|https://github.com/BramChen]]大佬翻译的[[TiddlyWiki 舞 - 官方基础文档简体中文版|https://bramchen.github.io/tw5-docs/zh-Hans/]] | ||
[[TiddlyWiki官网|https://tiddlywiki.com/]]和一系列[[社区|社区联系方式]]提供了太微完善的教程,不熟悉英文的爱好者请阅读由[[@BramChen|https://github.com/BramChen]]大佬翻译的[[TiddlyWiki 舞 - 官方基础文档简体中文版|https://bramchen.github.io/tw5-docs/zh-Hans/]] | ||
|
||
但太微官网主要关心太微核心的功能,没法装下二次创作的所有生态信息,而太微最关键的是社区和插件。因此我们建设了中文文档来介绍太微千千万万的插件和开发者组成的社区内容。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
created: 20210902045831297 | ||
creator: 林一二 | ||
modified: 20230207160827487 | ||
modified: 20240327083038726 | ||
modifier: 林一二 | ||
tags: 欢迎来到太微! | ||
title: 基础知识 | ||
type: text/vnd.tiddlywiki | ||
|
||
对官方文档基础知识的延伸解释和简单补充,也包含一些新手常见的问题。 | ||
|
||
如果你有编程经验,可以之后去看看[[太微原理]]。 | ||
!! 除了编辑笔记以外,还有哪些功能? | ||
|
||
* [[布局]]是各种全屏应用,包括白板、日历和游戏化等 | ||
* [[自动化]]你的笔记整理流程 | ||
* 从[[TiddlyWiki发行版本介绍]]中选择你的客户端和保存备份方式 | ||
|
||
!! 筛选器、宏、变量、界面级联? | ||
|
||
* 筛选器:用类似 DataLog / SQL 的语法执行 JS 的 map、filter 等函数,筛选出笔记库里的笔记 | ||
* 宏:在编译期替换文本,再提供给维基语法解析器 | ||
* 变量:保存文本内容,在用维基文本写低代码应用时,实现类似提供上下文的功能 | ||
* 界面级联:像 CSS 一样,允许插件提供的界面覆盖应用本身的界面 | ||
如果你有编程经验,可以之后去看看[[太微原理]],入门[[插件开发]]。 | ||
|
||
* [[筛选器]]:用类似 DataLog / SQL 的语法执行 JS 的 map、filter 等函数,筛选出笔记库里的笔记 | ||
* [[宏]]:在编译期替换文本,再提供给维基语法解析器 | ||
* [[变量]]:保存文本内容,在用维基文本写低代码应用时,实现类似提供上下文的功能 | ||
* 界面[[级联]]:像 CSS 一样,允许插件提供的界面覆盖应用本身的界面 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
created: 20240327080537288 | ||
creator: 林一二 | ||
modified: 20240327080646381 | ||
modifier: 林一二 | ||
tags: 开发布局 | ||
title: 如何制作布局插件 | ||
|
||
!! 布局插件JS部分 | ||
|
||
插件就是打包的笔记。插件提供的新视图一般用来展示一个微件。 | ||
|
||
布局不一定要有 JS ,可以创建完全由 Wikitext 组成的布局。不过这里先假设你要用 JS 写一个微件,然后在布局里展示这个微件。例如先创建一个日历微件的 JS 侧代码 | ||
|
||
src/calendar-widget/widget.ts | ||
|
||
``` | ||
import { Calendar } from '@fullcalendar/core'; | ||
import type { Widget as IWidget } from 'tiddlywiki'; | ||
import './widget.css'; | ||
|
||
const Widget = (require('$:/core/modules/widgets/widget.js') as { widget: typeof IWidget }).widget; | ||
|
||
class CalendarWidget extends Widget { | ||
/** | ||
* Lifecycle method: Render this widget into the DOM | ||
*/ | ||
render(parent: Node, _nextSibling: Node): void { | ||
this.#calendar = new Calendar(this.#mountElement, { ...settings }); | ||
this.#calendar?.render(); | ||
parent.appendChild(this.#containerElement); | ||
} | ||
} | ||
|
||
exports.widget = CalendarWidget; | ||
``` | ||
|
||
!! Wikitext部分 | ||
|
||
然后通过元信息文件,保存这个笔记的标题、标签、类型等元信息 | ||
|
||
src/calendar-widget/widget.js.meta | ||
|
||
``` | ||
creator: LinOnetwo | ||
title: $:/plugins/linonetwo/tw-calendar/calendar-widget/widget.js | ||
type: application/javascript | ||
module-type: widget | ||
hide-body: yes | ||
``` | ||
|
||
之后就可以在维基文本侧使用定义的微件,用类似 XML 的语法使用它 `<$calendar height="100vh" />` | ||
|
||
``` | ||
title: $:/plugins/linonetwo/tw-calendar/tiddlywiki-ui/PageLayout/CalendarLayout | ||
name: Calendar | ||
description: view tiddlers in agenda or calendar by their date related fields | ||
tags: $:/tags/Layout | ||
|
||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] | ||
|
||
<$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}> | ||
|
||
<main class="tw-calendar-layout-main-area"> | ||
<$calendar height="100vh" /> | ||
</main> | ||
|
||
</$navigator> | ||
``` | ||
|
||
通过给这个笔记加上 `tags: $:/tags/Layout` 这个标签,它就会被太微的框架部分使用到,展示在可用视图列表里 | ||
|
||
并在它的 title 作为 `$:/layout` 这个笔记的内容时,替换掉默认的故事流视图,全屏展示这个新的视图。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
created: 20230305122730862 | ||
creator: 林一二 | ||
modified: 20240327082120285 | ||
modifier: 林一二 | ||
tags: 高级知识 | ||
title: 布局 | ||
type: text/vnd.tiddlywiki | ||
|
||
[[布局(Layout)|https://bramchen.github.io/tw5-docs/zh-Hans/#Alternative%20page%20layouts]]是太微提供多种全屏界面的方案。 | ||
|
||
类似全屏的 App。太微是一个数据库,基于条目数据,可以运行很多个不同的全屏应用,也就是一个个不同的布局。 | ||
|
||
效果可见[[多布局切换功能]]。 | ||
|
||
作为开发者,你可以了解[[开发布局]]。使用者,可以到 CPL 上查看带 `Layout` 标签的插件。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.