├── vercel.json ├── renovate.json ├── tiddlers ├── system │ ├── $__DefaultTiddlers.tid │ ├── $__config_Server_AllowAllExternalFilters.tid │ ├── FileSystemPaths.tid │ ├── $__core_ui_sideBar_timeline.tid │ ├── $__languages_zh-Hans.json.meta │ ├── $__snippets_LayoutSwitcher.tid │ ├── $__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid │ ├── $__plugins_Gk0Wk_CPL-Repo.json.meta │ ├── $__themes_tiddlywiki_vanilla.json.meta │ ├── $__plugins_tiddlywiki_confetti.json.meta │ ├── $__plugins_tiddlywiki_qrcode.json.meta │ ├── $__plugins_xp_splashscreen.json.meta │ ├── $__plugins_tiddlywiki_browser-sniff.json.meta │ ├── $__plugins_tiddlywiki_highlight.json.meta │ ├── $__plugins_tiddlywiki_dynaview.json.meta │ ├── $__plugins_kixam_moment.json.meta │ ├── $__plugins_linonetwo_tw-react.json.meta │ ├── $__plugins_BTC_TiddlyFlex.json.meta │ ├── $__plugins_wikilabs_palette-switcher.json.meta │ ├── $__plugins_telmiger_rpn.json.meta │ ├── $__plugins_tiddlywiki_dynannotate.json.meta │ ├── $__plugins_dullroar_sitemap.json.meta │ ├── $__plugins_wikilabs_edit-tabs.json.meta │ ├── $__plugins_mat_field-value-selector.json.meta │ ├── $__plugins_wikilabs_palette-watch.json.meta │ ├── $__plugins_kixam_datepicker.json.meta │ ├── $__plugins_telmiger_HarveyBalls.json.meta │ ├── $__plugins_telmiger_EditorCounter.json.meta │ ├── $__plugins_flibbles_relink-markdown.json.meta │ ├── $__plugins_flibbles_relink.json.meta │ ├── $__plugins_kookma_toc.json.meta │ ├── $__plugins_kookma_utility.json.meta │ ├── $__plugins_kookma_favorites.json.meta │ ├── $__plugins_kookma_todolist.json.meta │ ├── $__plugins_kookma_shiraz.json.meta │ ├── $__plugins_flibbles_relink-titles.json.meta │ ├── $__plugins_kookma_hsl.json.meta │ ├── $__plugins_flibbles_relink-fieldnames.json.meta │ ├── $__plugins_kookma_commander.json.meta │ ├── $__plugins_telmiger_PluginSize.json.meta │ ├── $__plugins_dullroar_sitemap.json │ ├── $__plugins_linonetwo_in-tagtree-of.json │ ├── $__plugins_mat_field-value-selector.json │ ├── $__plugins_linonetwo_github-external-image.json │ ├── $__plugins_Gk0Wk_focused-tiddler.json │ ├── $__plugins_linonetwo_tag-tree-picker-macro.json │ ├── $__plugins_Gk0Wk_sidebar-resizer.json │ ├── $__plugins_linonetwo_open-in-external-app.json │ ├── $__plugins_wikilabs_palette-watch.json │ ├── $__plugins_linonetwo_copy-on-select.json │ ├── $__plugins_telmiger_PluginSize.json │ ├── $__plugins_wikilabs_edit-tabs.json │ ├── $__plugins_linonetwo_simple-layout-launcher.json │ ├── $__plugins_linonetwo_opened-tiddlers-bar.json │ ├── $__plugins_flibbles_relink-titles.json │ ├── $__plugins_tiddlywiki_browser-sniff.json │ ├── $__plugins_linonetwo_title-caption.json │ ├── $__plugins_Gk0Wk_page-toc.json │ └── $__plugins_linonetwo_zx-script.json ├── favicon.ico ├── favicon.ico.meta ├── TiddlyWikiIconBlue.png.tid ├── TiddlyWikiIconBlack.png.tid ├── TiddlyWikiIconWhite.png.tid ├── TheBrain.tid └── Index.tid ├── files ├── TiddlyWikiIconBlack.png ├── TiddlyWikiIconBlue.png └── TiddlyWikiIconWhite.png ├── .prettierrc.js ├── .editorconfig ├── package.json ├── workbox-config.js ├── public ├── manifest.webmanifest └── service-worker.js ├── .gitignore ├── scripts ├── html-minifier-terser.config.json └── build-wiki.mjs ├── .github └── workflows │ ├── gh-pages.yml │ └── upgrade.yml ├── README_zh-CN.md ├── tiddlywiki.info └── README.md /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "github": { 3 | "silent": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /tiddlers/system/$__DefaultTiddlers.tid: -------------------------------------------------------------------------------- 1 | title: $:/DefaultTiddlers 2 | type: text/vnd.tiddlywiki 3 | 4 | Index -------------------------------------------------------------------------------- /tiddlers/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiddly-gittly/Tiddlywiki-NodeJS-Github-Template/HEAD/tiddlers/favicon.ico -------------------------------------------------------------------------------- /tiddlers/system/$__config_Server_AllowAllExternalFilters.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/Server/AllowAllExternalFilters 2 | 3 | yes -------------------------------------------------------------------------------- /tiddlers/favicon.ico.meta: -------------------------------------------------------------------------------- 1 | created: 20200605110941797 2 | modified: 20200605110941797 3 | title: favicon.ico 4 | type: image/x-icon -------------------------------------------------------------------------------- /files/TiddlyWikiIconBlack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiddly-gittly/Tiddlywiki-NodeJS-Github-Template/HEAD/files/TiddlyWikiIconBlack.png -------------------------------------------------------------------------------- /files/TiddlyWikiIconBlue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiddly-gittly/Tiddlywiki-NodeJS-Github-Template/HEAD/files/TiddlyWikiIconBlue.png -------------------------------------------------------------------------------- /files/TiddlyWikiIconWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiddly-gittly/Tiddlywiki-NodeJS-Github-Template/HEAD/files/TiddlyWikiIconWhite.png -------------------------------------------------------------------------------- /tiddlers/system/FileSystemPaths.tid: -------------------------------------------------------------------------------- 1 | title: $:/config/FileSystemPaths 2 | 3 | [is[system]!has[draft.of]search-replace:g:regexp[/|\\],[_]addprefix[system/]] -------------------------------------------------------------------------------- /tiddlers/TiddlyWikiIconBlue.png.tid: -------------------------------------------------------------------------------- 1 | _canonical_uri: files/TiddlyWikiIconBlue.png 2 | created: 20250131194425622 3 | modified: 20250131194425622 4 | title: TiddlyWikiIconBlue.png 5 | type: image/png -------------------------------------------------------------------------------- /tiddlers/TiddlyWikiIconBlack.png.tid: -------------------------------------------------------------------------------- 1 | _canonical_uri: files/TiddlyWikiIconBlack.png 2 | created: 20250131194425622 3 | modified: 20250131194425622 4 | title: TiddlyWikiIconBlack.png 5 | type: image/png -------------------------------------------------------------------------------- /tiddlers/TiddlyWikiIconWhite.png.tid: -------------------------------------------------------------------------------- 1 | _canonical_uri: files/TiddlyWikiIconWhite.png 2 | created: 20250131194425622 3 | modified: 20250131194425622 4 | title: TiddlyWikiIconWhite.png 5 | type: image/png -------------------------------------------------------------------------------- /tiddlers/system/$__core_ui_sideBar_timeline.tid: -------------------------------------------------------------------------------- 1 | tags: $:/tags/Macro 2 | title: $:/core/ui/sideBar/timeline 3 | type: text/vnd.tiddlywiki 4 | 5 | \define timeline-title() <$transclude field="caption"><$view field="title"/> 6 | -------------------------------------------------------------------------------- /tiddlers/system/$__languages_zh-Hans.json.meta: -------------------------------------------------------------------------------- 1 | author: BramChen 2 | core-version: >=5.0.8 3 | dependents: 4 | description: 简体中文 5 | name: zh-Hans 6 | plugin-type: language 7 | title: $:/languages/zh-Hans 8 | type: application/json 9 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__snippets_LayoutSwitcher.tid: -------------------------------------------------------------------------------- 1 | caption: {{$:/language/ControlPanel/LayoutSwitcher/Caption}} 2 | tags: $:/tags/ControlPanel/Appearance 3 | title: $:/snippets/LayoutSwitcher 4 | type: text/vnd.tiddlywiki 5 | 6 | <> -------------------------------------------------------------------------------- /tiddlers/system/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid: -------------------------------------------------------------------------------- 1 | created: 20200408112506281 2 | creator: 林一二 3 | modified: 20220508040000119 4 | modifier: 林一二 5 | title: $:/themes/tiddlywiki/vanilla/metrics/sidebarwidth 6 | type: text/vnd.tiddlywiki 7 | 8 | 35vw -------------------------------------------------------------------------------- /tiddlers/TheBrain.tid: -------------------------------------------------------------------------------- 1 | caption: TheBrain 2 | tags: $:/tags/SideBar 3 | title: TheBrain 4 | type: text/vnd.tiddlywiki 5 | 6 | <$echarts $tiddler="$:/plugins/Gk0Wk/echarts/addons/TheBrain.js" aliasField="caption" levels="2" graphTitle="The Brain View" $height="100%" /> 7 | -------------------------------------------------------------------------------- /tiddlers/Index.tid: -------------------------------------------------------------------------------- 1 | title: Index 2 | type: text/vnd.tiddlywiki 3 | 4 | Click {{$:/core/images/edit-button}} button on top-right of this card to start edit. 5 | 6 | Visit [[教程 (Chinese)|https://tw-cn.netlify.app/]] or [[Official Site (English)|https://tiddlywiki.com/]] to learn. -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_Gk0Wk_CPL-Repo.json.meta: -------------------------------------------------------------------------------- 1 | author: Gk0Wk 2 | description: Essential and powerful plugin manager and library 3 | list: readme tree 4 | name: CPL Repo 5 | plugin-type: plugin 6 | title: $:/plugins/Gk0Wk/CPL-Repo 7 | type: application/json 8 | version: 2025.10.25 -------------------------------------------------------------------------------- /tiddlers/system/$__themes_tiddlywiki_vanilla.json.meta: -------------------------------------------------------------------------------- 1 | author: JeremyRuston 2 | core-version: >=5.0.0 3 | dependents: 4 | description: Basic theme 5 | name: Vanilla 6 | plugin-priority: 0 7 | plugin-type: theme 8 | title: $:/themes/tiddlywiki/vanilla 9 | type: application/json 10 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_confetti.json.meta: -------------------------------------------------------------------------------- 1 | author: tiddlywiki 2 | dependents: 3 | description: Animated confetti effect 4 | list: readme 5 | name: Confetti 6 | plugin-type: plugin 7 | stability: STABILITY_2_STABLE 8 | title: $:/plugins/tiddlywiki/confetti 9 | type: application/json 10 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_qrcode.json.meta: -------------------------------------------------------------------------------- 1 | author: Zeno Zeng 2 | dependents: 3 | description: QR Code generator 4 | list: readme docs examples license 5 | name: QR Code 6 | plugin-type: plugin 7 | stability: STABILITY_2_STABLE 8 | title: $:/plugins/tiddlywiki/qrcode 9 | type: application/json 10 | version: 5.3.8 -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | singleQuote: true, 4 | tabWidth: 2, 5 | trailingComma: 'all', 6 | printWidth: 160, 7 | arrowParens: 'always', 8 | jsxBracketSameLine: true, 9 | jsxSingleQuote: false, 10 | quoteProps: 'as-needed', 11 | bracketSpacing: true, 12 | useTabs: false, 13 | }; 14 | -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_xp_splashscreen.json.meta: -------------------------------------------------------------------------------- 1 | author: kl 2 | created: 20210127031225269 3 | dependents: 4 | description: Switch splash screen 5 | list: readme 6 | modified: 20231004050404986 7 | name: Splash Screen 8 | plugin-type: plugin 9 | title: $:/plugins/xp/splashscreen 10 | type: application/json 11 | version: 0.2.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_browser-sniff.json.meta: -------------------------------------------------------------------------------- 1 | author: tiddlywiki 2 | dependents: 3 | description: Browser feature detection 4 | list: readme usage 5 | name: Browser Sniff 6 | plugin-type: plugin 7 | stability: STABILITY_2_STABLE 8 | title: $:/plugins/tiddlywiki/browser-sniff 9 | type: application/json 10 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_highlight.json.meta: -------------------------------------------------------------------------------- 1 | author: Joao Bolila 2 | dependents: 3 | description: Highlight.js syntax highlighting 4 | list: readme usage license 5 | name: Highlight 6 | plugin-type: plugin 7 | stability: STABILITY_2_STABLE 8 | title: $:/plugins/tiddlywiki/highlight 9 | type: application/json 10 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_dynaview.json.meta: -------------------------------------------------------------------------------- 1 | author: tiddlywiki 2 | dependents: 3 | description: Dynamic scrolling and zooming effects 4 | list: readme docs examples config 5 | name: Dynaview 6 | plugin-type: plugin 7 | stability: STABILITY_2_STABLE 8 | title: $:/plugins/tiddlywiki/dynaview 9 | type: application/json 10 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kixam_moment.json.meta: -------------------------------------------------------------------------------- 1 | author: kixam 2 | core-version: >=5.1.8 3 | dependents: 4 | description: moment.js plugin for TiddlyWiki5 5 | list: readme license 6 | name: moment 7 | plugin-type: plugin 8 | source: https://github.com/kixam/TW5-moment.js 9 | title: $:/plugins/kixam/moment 10 | type: application/json 11 | version: 2.24.0 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_tw-react.json.meta: -------------------------------------------------------------------------------- 1 | author: LinOnetwo 2 | core-version: >=5.3.0 3 | dependents: 4 | description: Allow using ReactJS Components in TW widget. 5 | list: readme tree 6 | name: ReactJS 7 | plugin-type: plugin 8 | stability: STABILITY_2_STABLE 9 | title: $:/plugins/linonetwo/tw-react 10 | type: application/json 11 | version: 1.0.0 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_BTC_TiddlyFlex.json.meta: -------------------------------------------------------------------------------- 1 | author: Simon Huber 2 | core-version: >=5.3.3 3 | dependents: 4 | description: A Flexbox Layout for TiddlyWiki5 5 | list: readme license 6 | name: TiddlyFlex 7 | plugin-type: plugin 8 | source: https://github.com/BurningTreeC/TiddlyFlex 9 | title: $:/plugins/BTC/TiddlyFlex 10 | type: application/json 11 | version: 0.8.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_wikilabs_palette-switcher.json.meta: -------------------------------------------------------------------------------- 1 | author: Mario Pietsch 2 | core-version: >=5.3.1 3 | dependents: 4 | description: Advanced Palette Switcher 5 | list: readme history license 6 | name: Palette Switcher 7 | plugin-type: plugin 8 | stability: STABILITY_2_STABLE 9 | title: $:/plugins/wikilabs/palette-switcher 10 | type: application/json 11 | version: 1.0.0 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_telmiger_rpn.json.meta: -------------------------------------------------------------------------------- 1 | author: Thomas Elmiger 2 | core-version: >=5.1.14 3 | dependents: 4 | description: rpn – Basic Math in Reverse Polish Notation 5 | list: readme usage examples fields support 6 | name: rpn 7 | plugin-type: plugin 8 | source: https://tid.li/tw5/plugins.html 9 | title: $:/plugins/telmiger/rpn 10 | type: application/json 11 | version: 0.7.3 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_dynannotate.json.meta: -------------------------------------------------------------------------------- 1 | author: JeremyRuston 2 | core-version: >=5.0.0 3 | dependents: $:/plugins/tiddlywiki/dynaview 4 | description: Dynamic content annotation 5 | list: readme examples 6 | name: Dynannotate 7 | plugin-type: plugin 8 | stability: STABILITY_2_STABLE 9 | title: $:/plugins/tiddlywiki/dynannotate 10 | type: application/json 11 | version: 5.3.8 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_dullroar_sitemap.json.meta: -------------------------------------------------------------------------------- 1 | author: Jim Lehmer 2 | core-version: >=5.0.8 3 | created: 20211017092821582 4 | dependents: 5 | description: TiddlyWiki5 plugin to generate sitemap.xml. 6 | modified: 20211017092821582 7 | plugin-type: plugin 8 | source: https://github.com/dullroar/TW5-sitemap 9 | title: $:/plugins/dullroar/sitemap 10 | type: application/json 11 | version: 0.0.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_wikilabs_edit-tabs.json.meta: -------------------------------------------------------------------------------- 1 | author: Mario Pietsch 2 | core-version: >=5.1.15 3 | dependents: 4 | description: Internal link- or edit-buttons are added to tabs if selected 5 | list: readme history license 6 | name: Edit Tabs 7 | plugin-type: plugin 8 | stability: STABILITY_0_DEPRECATED 9 | title: $:/plugins/wikilabs/edit-tabs 10 | type: application/json 11 | version: 3.0.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_mat_field-value-selector.json.meta: -------------------------------------------------------------------------------- 1 | author: Mat von TWaddle 2 | core-version: >=5.1.22 3 | created: 20211017092928672 4 | dependents: 5 | description: Shows a dropdown listing existing field values for that field name. 6 | list: readme 7 | modified: 20211017092928672 8 | plugin-type: plugin 9 | title: $:/plugins/mat/field-value-selector 10 | type: application/json 11 | version: 0.0.1 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_wikilabs_palette-watch.json.meta: -------------------------------------------------------------------------------- 1 | author: Mario Pietsch 2 | core-version: >=5.3.1 3 | dependents: $:/plugins/wikilabs/palette-switcher 4 | description: Advanced Palette Watch 5 | list: readme history license 6 | name: Palette Watch 7 | plugin-type: plugin 8 | stability: STABILITY_1_EXPERIMENTAL 9 | title: $:/plugins/wikilabs/palette-watch 10 | type: application/json 11 | version: 0.9.1 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kixam_datepicker.json.meta: -------------------------------------------------------------------------------- 1 | author: kixam 2 | core-version: >=5.1.8 3 | dependents: $:/plugins/kixam/moment 4 | description: datepicker plugin for TiddlyWiki5, based on Pikaday version 1.6.1 5 | list: readme license usage 6 | name: datepicker 7 | plugin-type: plugin 8 | source: https://github.com/kixam/TW5-datepicker 9 | title: $:/plugins/kixam/datepicker 10 | type: application/json 11 | version: 0.5.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_telmiger_HarveyBalls.json.meta: -------------------------------------------------------------------------------- 1 | author: Thomas Elmiger 2 | core-version: >=5.1.14 3 | created: 20211017093000010 4 | dependents: 5 | description: HarveyBalls 6 | list: readme alternatives credits 7 | modified: 20211017093000010 8 | name: HarveyBalls 9 | plugin-type: plugin 10 | source: https://tid.li/tw5/plugins.html 11 | title: $:/plugins/telmiger/HarveyBalls 12 | type: application/json 13 | version: 0.0.6 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_telmiger_EditorCounter.json.meta: -------------------------------------------------------------------------------- 1 | author: Thomas & Jed 2 | core-version: >=5.1.13 3 | created: 20211017092959768 4 | dependents: 5 | description: EditorCounter & Autosaver 6 | list: readme settings credits support 7 | modified: 20211017092959768 8 | name: EditorCounter 9 | plugin-type: plugin 10 | source: https://tid.li/tw5/plugins.html 11 | title: $:/plugins/telmiger/EditorCounter 12 | type: application/json 13 | version: 0.6.6 -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.scss] 11 | indent_size = 2 12 | 13 | [*.js] 14 | indent_size = 2 15 | 16 | [*.jsx] 17 | indent_size = 2 18 | 19 | [*.ts] 20 | indent_size = 2 21 | 22 | [*.tsx] 23 | indent_size = 2 24 | 25 | [*.vue] 26 | indent_size = 2 27 | 28 | [Makefile] 29 | indent_style = tab 30 | -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_flibbles_relink-markdown.json.meta: -------------------------------------------------------------------------------- 1 | author: Flibbles 2 | core-version: >=5.1.22 3 | dependents: 4 | description: Markdown support for Relink 5 | list: readme 6 | name: Relink Markdown 7 | parent-plugin: $:/plugins/flibbles/relink 8 | plugin-type: plugin 9 | source: https://github.com/flibbles/tw5-relink 10 | stability: STABILITY_2_STABLE 11 | title: $:/plugins/flibbles/relink-markdown 12 | type: application/json 13 | version: 2.5.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_flibbles_relink.json.meta: -------------------------------------------------------------------------------- 1 | author: Flibbles 2 | core-version: >=5.1.22 3 | demo: http://flibbles.github.io/tw5-relink/ 4 | dependents: 5 | description: Flexibility when relinking renamed tiddlers 6 | list: readme configuration license 7 | name: Relink 8 | plugin-type: plugin 9 | source: https://github.com/flibbles/tw5-relink 10 | stability: STABILITY_2_STABLE 11 | title: $:/plugins/flibbles/relink 12 | type: application/json 13 | version: 2.5.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_toc.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >=5.2.5 3 | dependents: 4 | description: Table of contents and navigation builder 5 | list: readme license history 6 | name: Toc 7 | packaged-by: Gatha on 11th August 2025, 13:41:56 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TOC 12 | stability: STABILITY_2_STABLE 13 | title: $:/plugins/kookma/toc 14 | type: application/json 15 | version: 1.6.3 -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "run": "npx tiddlywiki . --listen port=8080", 4 | "build": "zx ./scripts/build-wiki.mjs", 5 | "clean": "rimraf public-dist", 6 | "update": "npm-check-updates -u" 7 | }, 8 | "devDependencies": { 9 | "html-minifier-terser": "7.2.0", 10 | "npm-check-updates": "^19.1.2", 11 | "rimraf": "^6.1.2", 12 | "tiddlywiki": "^5.3.8", 13 | "uglify-js": "3.19.3", 14 | "workbox-cli": "7.4.0", 15 | "zx": "^8.8.5" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_utility.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >5.3.5 3 | dependents: 4 | description: Small tools for authors and developers 5 | list: readme license history 6 | name: Utility 7 | packaged-by: Gatha on 7th July 2025, 22:39:00 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TW-Utility 12 | stability: STABILITY_2_STABLE 13 | title: $:/plugins/kookma/utility 14 | type: application/json 15 | version: 3.2.3 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_favorites.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >=5.3.5 3 | dependents: 4 | description: Create favorites, organize in folders 5 | list: readme license history 6 | name: Favorites 7 | packaged-by: Gatha on 7th July 2025, 18:42:56 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TW-Favorites 12 | stability: STABILITY_2_STABLE 13 | title: $:/plugins/kookma/favorites 14 | type: application/json 15 | version: 4.9.0 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_todolist.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >=5.1.23 3 | dependents: 4 | description: Organize, prioritize, and plan your work 5 | list: readme license history 6 | name: Todolist 7 | packaged-by: Gatha on 24th July 2025, 00:11:55 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TW-Todolist 12 | stability: STABILITY_2_STABLE 13 | title: $:/plugins/kookma/todolist 14 | type: application/json 15 | version: 1.5.1 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_shiraz.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >=5.3.5 3 | dependents: 4 | description: Extended markups, tables, images, styles, and procedures 5 | list: readme license history 6 | name: Shiraz 7 | packaged-by: Gatha on 26th September 2025, 19:52:36 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TW-Shiraz 12 | stability: STABILITY_1_EXPERIMENTAL 13 | title: $:/plugins/kookma/shiraz 14 | type: application/json 15 | version: 3.0.14 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_flibbles_relink-titles.json.meta: -------------------------------------------------------------------------------- 1 | author: Flibbles 2 | core-version: >=5.1.22 3 | demo: http://flibbles.github.io/tw5-relink/ 4 | dependents: 5 | description: Renames tiddlers with titles derived from Relinked tiddler 6 | list: readme configuration 7 | name: Relink Titles 8 | parent-plugin: $:/plugins/flibbles/relink 9 | plugin-type: plugin 10 | source: https://github.com/flibbles/tw5-relink 11 | stability: STABILITY_2_STABLE 12 | title: $:/plugins/flibbles/relink-titles 13 | type: application/json 14 | version: 2.5.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_hsl.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >=5.2.0 3 | dependents: 4 | description: Extract the content and stand out specific lines and/or line ranges 5 | list: readme license history 6 | name: Highlight Selected Lines 7 | packaged-by: Gatha on 26th July 2025, 00:15:00 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TW-Hsl 12 | stability: STABILITY_2_STABLE 13 | title: $:/plugins/kookma/hsl 14 | type: application/json 15 | version: 1.2.2 -------------------------------------------------------------------------------- /workbox-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "globDirectory": "public-dist/", 3 | "maximumFileSizeToCacheInBytes": 1024 * 1024 * 256, 4 | "globPatterns": [ 5 | "**/*.{ico,html,js,json,png,svg,jpg,jpeg,webp,gif,pdf,css,doc,docx,xsl,xslx,ppt,pptx,xml,opml,yaml,bmp,tiff,rtf,txt,heic,heif,woff,woff2,ogg,ogm,ogv,webm,mp4,mp3,m4a,md,tid,enex,bib,epub,octet-stream,multids,tiddler,recipe,htm,hta,m3u8,avi,rm,rmvb,wma,wav,mid,flv,ttf,otf,font,eot,fon,ttc}" 6 | ], 7 | "swDest": "public-dist/service-worker.js", 8 | "swSrc": "public/service-worker.js" 9 | }; -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_flibbles_relink-fieldnames.json.meta: -------------------------------------------------------------------------------- 1 | author: Flibbles 2 | core-version: >=5.1.22 3 | demo: http://flibbles.github.io/tw5-relink/ 4 | dependents: 5 | description: Renames field names with titles matching Relinked tiddlers 6 | list: readme reference 7 | name: Relink Field Names 8 | parent-plugin: $:/plugins/flibbles/relink 9 | plugin-type: plugin 10 | source: https://github.com/flibbles/tw5-relink 11 | stability: STABILITY_2_STABLE 12 | title: $:/plugins/flibbles/relink-fieldnames 13 | type: application/json 14 | version: 2.5.2 -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_kookma_commander.json.meta: -------------------------------------------------------------------------------- 1 | author: Mohammad Rahmani 2 | core-version: >=5.3.5 3 | dependents: 4 | description: Streamline tiddler management: bulk operations for titles, tags, and fields 5 | list: readme license history 6 | name: Tiddler Commander 7 | packaged-by: Gatha on 7th July 2025, 22:40:23 8 | parent-plugin: 9 | plugin-priority: 10 | plugin-type: plugin 11 | source: https://github.com/kookma/TW-Commander 12 | stability: STABILITY_2_STABLE 13 | title: $:/plugins/kookma/commander 14 | type: application/json 15 | version: 2.1.14 -------------------------------------------------------------------------------- /public/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "background_color": "white", 3 | "theme_color": "white", 4 | "description": "TiddlyWiki", 5 | "display": "standalone", 6 | "icons": [ 7 | { 8 | "src": "/TiddlyWikiIconBlack.png", 9 | "sizes": "256x256", 10 | "type": "image/png" 11 | }, 12 | { 13 | "src": "/TiddlyWikiIconWhite.png", 14 | "sizes": "144x144", 15 | "type": "image/png" 16 | } 17 | ], 18 | "name": "TiddlyWiki", 19 | "short_name": "Tiddly", 20 | "lang": "zh-CN", 21 | "start_url": "/", 22 | "scope": "/" 23 | } -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_telmiger_PluginSize.json.meta: -------------------------------------------------------------------------------- 1 | author: Thomas Elmiger 2 | core-version: >=5.3.0 3 | created: 20231220192621897 4 | dependents: $:/plugins/telmiger/EditorCounter $:/plugins/telmiger/HarveyBalls $:/plugins/telmiger/rpn 5 | description: calculate the extra weight 6 | list: readme support license 7 | modified: 20231231115549406 8 | name: Plugin Size 9 | packaged-by: Gatha on 31st December 2023, 12:11:56 10 | plugin-type: plugin 11 | source: https://tid.li/tw5/plugins.html 12 | tags: 13 | title: $:/plugins/telmiger/PluginSize 14 | type: application/json 15 | version: 1.0.1 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | output 4 | public-dist 5 | $__StoryList.tid 6 | settings/settings.json 7 | tiddlers/subwiki/ 8 | 9 | # ignore some change from plugin that will only change "modified" field 10 | $__keepstate_* 11 | # for TiddlyWiki 12 | dist/ 13 | output/ 14 | tiddlers/**/$__language.tid 15 | tiddlers/**/$__StoryList.tid 16 | tiddlers/**/$__StoryList_*.tid 17 | tiddlers/**/$__palette.tid 18 | tiddlers/**/$__layout.tid 19 | tiddlers/**/$__keepstate_* 20 | tiddlers/**/$__Import.tid 21 | tiddlers/**/$__UpgradeLibrary 22 | tiddlers/**/$__UpgradeLibrary_List 23 | tiddlers/**/$__temp_* 24 | tiddlers/**/$__view.tid 25 | tiddlers/**/$__config_Navigation_openLinkFromInsideRiver.tid 26 | tiddlers/**/$__config_Navigation_openLinkFromOutsideRiver.tid 27 | # fsrs 28 | tiddlers/$__Deck_new_study.tid 29 | tiddlers/$__Deck_default_study.tid 30 | -------------------------------------------------------------------------------- /scripts/html-minifier-terser.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "caseSensitive": true, 3 | "collapseBooleanAttributes": false, 4 | "collapseInlineTagWhitespace": false, 5 | "collapseWhitespace": true, 6 | "conservativeCollapse": true, 7 | "continueOnParseError": true, 8 | "customAttrCollapse": ".*", 9 | "decodeEntities": true, 10 | "html5": true, 11 | "ignoreCustomFragments": ["<#[\\s\\S]*?#>", "<%[\\s\\S]*?%>", "<\\?[\\s\\S]*?\\?>"], 12 | "includeAutoGeneratedTags": false, 13 | "keepClosingSlash": false, 14 | "maxLineLength": 0, 15 | "minifyCSS": true, 16 | "minifyJS": true, 17 | "minifyURLs": true, 18 | "preserveLineBreaks": false, 19 | "preventAttributesEscaping": false, 20 | "processConditionalComments": true, 21 | "processScripts": ["text/html"], 22 | "removeAttributeQuotes": true, 23 | "removeComments": true, 24 | "removeEmptyAttributes": true, 25 | "removeEmptyElements": false, 26 | "removeOptionalTags": true, 27 | "removeRedundantAttributes": true, 28 | "removeScriptTypeAttributes": true, 29 | "removeStyleLinkTypeAttributes": true, 30 | "removeTagWhitespace": true, 31 | "sortAttributes": true, 32 | "sortClassName": true, 33 | "trimCustomFragments": true, 34 | "useShortDoctype": true 35 | } -------------------------------------------------------------------------------- /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Tiddlywiki To Github Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | # paths: 9 | # - "plugins/**" 10 | # - "tiddlers/**" 11 | # - "package.json" 12 | 13 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 14 | permissions: 15 | contents: write 16 | pages: write 17 | id-token: write 18 | 19 | jobs: 20 | deploy: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout repository 24 | uses: actions/checkout@v6 25 | - uses: actions/setup-node@v6 26 | with: 27 | node-version: lts/* 28 | - name: Setup pnpm 29 | uses: pnpm/action-setup@v4 30 | with: 31 | version: 'latest' 32 | run_install: false 33 | - name: Cache dependencies 34 | uses: actions/cache@v4 35 | with: 36 | path: | 37 | **/node_modules 38 | key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} 39 | 40 | - name: Install Dependency 41 | run: pnpm install 42 | - name: Building online and offline versions 43 | run: pnpm run build 44 | - name: Upload GitHub Pages artifact 45 | uses: actions/upload-pages-artifact@v4 46 | with: 47 | # Upload entire repository 48 | path: ./public-dist 49 | - name: Deploy to GitHub Pages 50 | id: deployment 51 | uses: actions/deploy-pages@v4 52 | -------------------------------------------------------------------------------- /README_zh-CN.md: -------------------------------------------------------------------------------- 1 | [English](/README.md) | [中文](/README_zh-CN.md) 2 | 3 | # Tiddlywiki-NodeJS-Github-Template 4 | 5 | [TidGi-Desktop](https://github.com/tiddly-gittly/TidGi-Desktop)的默认wiki模板,这是一个可以一键生成wiki模板的应用。 6 | 7 | 知识库模板,具有高级过滤搜索和分面数据聚合功能。 8 | 9 | [wiki.onetwo.website](https://wiki.onetwo.website/)是这个模板的一个例子。而[tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/](https://tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/)是这个repo的部署例子。(有一些优化,使这个演示只读,并且不能下载,所以它的大小几乎和GIF图片一样小。) 10 | 11 | 需要修改`$:/GitHub/Repo`条目内容为个人github仓库地址。默认分支是master,可以手动修改`$:/core/templates/canonical-uri-external-image`条目,改成其他比如main分支。 12 | 13 | 可下载的HTML在[tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/offline.html](https://tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/offline.html),其中包含编辑相关的插件,而且会稍微大一些(相当于一个tiktok视频的大小)。 14 | 15 | 另外在 [tiddlyhost.com/hub/user/linonetwo](https://tiddlyhost.com/hub/user/linonetwo) 有一个 TiddlyHost 模板,点 Clone 按钮可在线使用,当我想起来的时候会手动更新。(其实等价于,先下载上面的离线版本,然后上传到新创建的 tiddlyhost wiki 上)。 16 | 17 | 这个 repo 曾经包含wiki的备份数据和脚本,用于在MacOS上启动本地wiki服务器。现在它已经被废弃了,而且没有钱去维护,现在[TiddlyGit-Desktop](https://github.com/tiddly-gittly/TiddlyGit-Desktop)是首选。旧版本可以在[feat/auto-start分支](https://github.com/tiddly-gittly/Tiddlywiki-NodeJS-Github-Template/tree/feat/auto-start)中找到。我们欢迎对它的贡献。 18 | 19 | ## 设置 20 | 21 | [用TiddlyWiki替代Notion和EverNote作为个人知识管理系统 (Chinese)](https://onetwo.ren/%E7%94%A8tiddlywiki%E6%9B%BF%E4%BB%A3notion%E5%92%8Cevernote%E7%AE%A1%E7%90%86%E7%9F%A5%E8%AF%86/) 22 | 23 | 英文翻译即将问世。(?) 24 | 25 | ## 部署到Github页面 26 | 27 | 自动。 28 | 29 | ## NPM Scripts 30 | 31 | `npm build`: 将tiddlywiki的数据打包成一个HTML文件。 32 | 33 | ## Shell Scripts 34 | 35 | [scripts/build-wiki.js](scripts/build-wiki.js)实际上会把tiddlywiki的数据打包到一个HTML文件中。 36 | 37 | ## 灵感 38 | 39 | 脚本的灵感来自[DiamondYuan/wiki](https://github.com/DiamondYuan/wiki) 40 | -------------------------------------------------------------------------------- /public/service-worker.js: -------------------------------------------------------------------------------- 1 | importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.4/workbox-sw.js'); 2 | 3 | if (workbox) { 4 | console.log(`Yay! Workbox is loaded 🎉Service Worker is working!`); 5 | } else { 6 | console.log(`Boo! Workbox didn't load 😬Service Worker won't work properly...`); 7 | } 8 | 9 | const { registerRoute } = workbox.routing; 10 | const { CacheFirst, StaleWhileRevalidate, NetworkFirst } = workbox.strategies; 11 | const { ExpirationPlugin } = workbox.expiration; 12 | const { precacheAndRoute, matchPrecache } = workbox.precaching; 13 | 14 | precacheAndRoute(self.__WB_MANIFEST); 15 | 16 | registerRoute( 17 | /\.css$/, 18 | // Use cache but update in the background. 19 | new StaleWhileRevalidate({ 20 | // Use a custom cache name. 21 | cacheName: 'css-cache', 22 | }) 23 | ); 24 | 25 | registerRoute( 26 | /\.(?:png|jpg|jpeg|svg|gif|woff2?|ttf)$/, 27 | // Use the cache if it's available. 28 | new CacheFirst({ 29 | cacheName: 'image-cache', 30 | plugins: [ 31 | new ExpirationPlugin({ 32 | // Cache only a few images. 33 | maxEntries: 100, 34 | // Cache for a maximum of a week. 35 | maxAgeSeconds: 7 * 24 * 60 * 60, 36 | }), 37 | ], 38 | }) 39 | ); 40 | 41 | registerRoute(/\.js$/, new StaleWhileRevalidate()); 42 | 43 | 44 | /* 45 | 可选的html缓存策略,StaleWhileRevalidate、NetworkFirst 46 | 47 | StaleWhileRevalidate:当请求的路由有对应的Cache缓存结果就直接返回, 48 | 在返回Cache缓存结果的同时会在后台发起网络请求拿到请求结果并更新Cache缓存, 49 | 如果本来就没有Cache缓存的话,就直接发起网络请求并返回结果, 50 | 这对用户来说是一种非常安全的策略. 51 | 52 | NetworkFirst:当请求的路由是被匹配的,就采用网络优先的策略,也就是 53 | 优先尝试拿到网络请求的返回结果,如果拿到网络请求的结果,就将结果返回 54 | 给客户端并且写入Cache缓存,如果网络请求失败,那最后被缓存的Cache缓 55 | 存结果就会被返回到客户端,这种策略一般适用于返回结果不太固定或对实时性 56 | 有要求的请求,为网络请求失败进行兜底。 57 | */ 58 | registerRoute(/(^\/$|index.html)/, new StaleWhileRevalidate()); 59 | -------------------------------------------------------------------------------- /tiddlywiki.info: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Basic client-server edition", 3 | "plugins": [], 4 | "themes": [], 5 | "languages": [], 6 | "build": { 7 | "index": [ 8 | "--rendertiddler", 9 | "$:/core/save/all", 10 | "index.html", 11 | "text/plain" 12 | ], 13 | "externalimages": [ 14 | "--setfield", 15 | "[is[binary]] [type[application/msword]]", 16 | "_canonical_uri", 17 | "$:/core/templates/canonical-uri-external-image", 18 | "text/plain", 19 | "--setfield", 20 | "[is[binary]] [type[application/msword]]", 21 | "text", 22 | "", 23 | "text/plain", 24 | "--rendertiddler", 25 | "$:/core/save/all-external-js", 26 | "index.html", 27 | "text/plain" 28 | ], 29 | "readonlyexternalimages": [ 30 | "--setfield", 31 | "[is[binary]] [type[application/msword]]", 32 | "_canonical_uri", 33 | "$:/core/templates/canonical-uri-external-image", 34 | "text/plain", 35 | "--setfield", 36 | "[is[binary]] [type[application/msword]] [type[application/pdf]] [[$:/plugins/tiddlywiki/filesystem]] [[$:/plugins/tiddlywiki/tiddlyweb]] [[$:/plugins/twcloud/tiddlyweb-sse]] [[$:/plugins/linonetwo/source-control-management]] [[$:/plugins/linonetwo/super-tag]] [[$:/plugins/linonetwo/flow-chart]] [[$:/plugins/linonetwo/slate-write]] [[$:/plugins/linonetwo/smart-field]] [[$:/plugins/linonetwo/markdown-transformer]] [[$:/plugins/gt6796c/mermaid-tw5]] [[$:/plugins/linonetwo/tw-mobile-sync]] [[$:/plugins/linonetwo/zx-script]] [[$:/plugins/tiddlywiki/highlight]] [prefix[$:/plugins/tiddlywiki/codemirror]] [[$:/plugins/Gk0Wk/TW5-CodeMirror-Enhanced]] [[$:/plugins/flibbles/relink]] [[$:/plugins/kookma/commander]] [[$:/plugins/kookma/section]] [[$:/plugins/linonetwo/calendar]] [[$:/plugins/linonetwo/pinyin-fuzzy-search]]", 37 | "text", 38 | "", 39 | "text/plain", 40 | "--rendertiddler", 41 | "$:/core/save/all-external-js", 42 | "index.html", 43 | "text/plain" 44 | ], 45 | "externaljs": [ 46 | "--rendertiddler", 47 | "$:/core/templates/tiddlywiki5.js", 48 | "tiddlywiki5.js", 49 | "text/plain" 50 | ] 51 | }, 52 | "config": { 53 | "retain-original-tiddler-path": true 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /.github/workflows/upgrade.yml: -------------------------------------------------------------------------------- 1 | name: Upgrade NPM packages 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | schedule: 7 | - cron: "0 0 1 * *" 8 | 9 | jobs: 10 | upgrade-packages: 11 | name: Upgrade packages 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v6 18 | - uses: actions/setup-node@v6 19 | with: 20 | node-version: lts/* 21 | 22 | - name: Setup pnpm 23 | uses: pnpm/action-setup@v4 24 | with: 25 | version: 'latest' 26 | run_install: false 27 | - name: Cache dependencies 28 | uses: actions/cache@v4 29 | with: 30 | path: | 31 | **/node_modules 32 | key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} 33 | - name: Install Dependency 34 | run: pnpm install 35 | - name: Upgrade Dependency 36 | run: pnpm run update 37 | - name: Install Dependency of upgraded 38 | run: pnpm install --no-frozen-lockfile 39 | 40 | # Commit all changed files back to the repository 41 | - uses: stefanzweifel/git-auto-commit-action@v7 42 | with: 43 | commit_message: Automated Update all Library in libraries.json 44 | 45 | # commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]" 46 | # commit_user_email: my-github-actions-bot@example.org # defaults to "41898282+github-actions[bot]@users.noreply.github.com" 47 | commit_author: Github Action # defaults to author of the commit that triggered the run 48 | 49 | 50 | # Optional. Options used by `git-add`. 51 | # See https://git-scm.com/docs/git-add#_options 52 | # add_options: '-u' 53 | 54 | # # Optional. Disable dirty check and always try to create a commit and push 55 | skip_dirty_check: true 56 | # # Optional. Skip internal call to `git fetch` 57 | # skip_fetch: true 58 | # # Optional. Skip internal call to `git checkout` 59 | # skip_checkout: true 60 | # Optional. Prevents the shell from expanding filenames. 61 | # Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html 62 | # disable_globbing: true 63 | # push_options: --force -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [English](/README.md) | [中文](/README_zh-CN.md) 2 | 3 | # Tiddlywiki-NodeJS-Github-Template 4 | 5 | Default wiki template for [TidGi-Desktop](https://github.com/tiddly-gittly/TidGi-Desktop), an App that can generate template wiki on one-click. 6 | 7 | Knowledge base Template, with advanced filter search and faceted data aggregation. 8 | 9 | [wiki.onetwo.website](https://wiki.onetwo.website/) is an example of this template. And [tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/](https://tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/) is deployed example of this repo. (There are some optimization to make this demo readonly, and being not downloadable, so its size is almost as small as a GIF picture.) 10 | 11 | You need to change the contents of the `$:/GitHub/Repo` entry to your personal github repository address.The default branch is master, you can manually change the `$:/core/templates/canonical-uri-external-image` entry to another branch such as main. 12 | 13 | Downloadable HTML is at [tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/offline.html](https://tiddly-gittly.github.io/Tiddlywiki-NodeJS-Github-Template/offline.html), which contains edit related plugins, and will be slightly bigger (a size of a tiktok video.) 14 | 15 | Also there is a TiddlyHost template at [tiddlyhost.com/hub/user/linonetwo](https://tiddlyhost.com/hub/user/linonetwo), which will update manually when I remember it. (It is same as, download the offline version above, and upload to a newly created tiddlyhost wiki.) 16 | 17 | This repo used to contains the wiki backup data and script to start a local wiki server on MacOS on start up. It is now deprecated, and no money to maintain, now [TiddlyGit-Desktop](https://github.com/tiddly-gittly/TiddlyGit-Desktop) is preferred. Old version can be found at the [feat/auto-start branch](https://github.com/tiddly-gittly/Tiddlywiki-NodeJS-Github-Template/tree/feat/auto-start). Contribution to it is welcome. 18 | 19 | ## Setup 20 | 21 | [用TiddlyWiki替代Notion和EverNote作为个人知识管理系统 (Chinese)](https://onetwo.ren/%E7%94%A8tiddlywiki%E6%9B%BF%E4%BB%A3notion%E5%92%8Cevernote%E7%AE%A1%E7%90%86%E7%9F%A5%E8%AF%86/) 22 | 23 | English translation comeout soon. (?) 24 | 25 | ## Deployed to Github Pages 26 | 27 | Automatically. 28 | 29 | ## NPM Scripts 30 | 31 | `npm build`: pack tiddlywiki data to a HTML file 32 | 33 | ## Shell Scripts 34 | 35 | [scripts/build-wiki.js](scripts/build-wiki.js) will actually pack tiddlywiki data to a HTML file 36 | 37 | ## Credit 38 | 39 | Scripts are inspired by [DiamondYuan/wiki](https://github.com/DiamondYuan/wiki) 40 | -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_dullroar_sitemap.json: -------------------------------------------------------------------------------- 1 | {"tiddlers":{"RenderSitemap":{"title":"RenderSitemap","created":"20150104141300000","creator":"Jim","extension":".xml","modified":"20150104141300000","modifier":"Jim","tags":"static $:/tags/Exporter","type":"text/vnd.tiddlywiki","text":"\\define renderContent()\n<$text text=<>/>\n\\end\n<>"},"sitemap":{"title":"sitemap","created":"20150104144500000","creator":"Jim","modified":"20150104144500000","modifier":"Jim","tags":"static","type":"text/vnd.tiddlywiki","text":"\\define tv-wikilink-template() #$uri_encoded$\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n`\n`<$set name=\"exportFilter\" value=\"[!is[system]!title[Table of Contents]!sort[modifed]]\">\n{{RenderSitemap}}``"},"sitemapentries.js":{"title":"sitemapentries.js","created":"20150104141600000","creator":"Jim","modified":"20150124151600000","modifier":"Jim","module-type":"macro","tags":"static","type":"application/javascript","text":"/*\\\nMacro to output tiddlers matching a filter to sitemap.xml entries.\nhttp://www.sitemaps.org/protocol.html\n\\*/\n(function () {\n /*jslint node: true, browser: true */\n /*global $tw: false */\n 'use strict';\n\n exports.name = 'sitemapentries';\n\n exports.params = [{ name: 'filter' }];\n\n let XML = {};\n\n XML.escapify = function (input) {\n return input\n .replace(//gm, '>')\n .replace(/&/gm, '&')\n .replace(/\"/gm, '"')\n .replace(/'/gm, ''');\n };\n\n XML.twDateToWebDate = function (twDate) {\n return $tw.utils.formatDateString(twDate, 'YYYY-0MM-0DD');\n };\n\n XML.stringify = function (data) {\n let x = '';\n data.forEach(function (element, index, array) {\n x += '\\t\\n';\n const server = $tw.wiki.getTiddlerText('sitemapserver', '');\n x += `\\t\\t${server}#:${element.title.replace(/ /g, '%2520')}\\n`;\n if (element.modified) {\n x += '\\t\\t' + XML.twDateToWebDate($tw.utils.parseDate(element.modified)) + '\\n';\n }\n x += '\\t\\t';\n if (element.title.toLowerCase() === 'index' || element.title.toLowerCase() === 'home') {\n x += 'weekly';\n } else {\n x += 'monthly';\n }\n x += '\\n';\n x += '\\t\\t';\n if (element.title.toLowerCase() === 'index' || element.title.toLowerCase() === 'home') {\n x += '1.0';\n } else if (element.color !== undefined) {\n x += '0.8';\n } else {\n x += '0.5';\n }\n x += '\\n';\n x += '\\t\\n';\n });\n return x;\n };\n\n exports.run = function (filter) {\n const tiddlers = this.wiki.filterTiddlers(filter);\n const data = [];\n for (let t = 0; t < tiddlers.length; t++) {\n const tiddler = this.wiki.getTiddler(tiddlers[t]);\n if (tiddler) {\n const fields = {};\n for (const field in tiddler.fields) {\n fields[field] = XML.escapify(tiddler.getFieldString(field));\n }\n data.push(fields);\n }\n }\n return XML.stringify(data);\n };\n})();\n"},"sitemapserver":{"title":"sitemapserver","created":"20150104145100000","creator":"Jim","modified":"20150104145100000","modifier":"Jim","tags":"static","type":"text/vnd.tiddlywiki","text":"https://onetwo.ren/wiki/"}}} -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_in-tagtree-of.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "LinOnetwo", 4 | "core-version": ">=5.1.22", 5 | "dependents": "", 6 | "description": "Finds out where a tiddler originates from, is it in a tag tree with xxx as root?", 7 | "list": "readme", 8 | "plugin-type": "plugin", 9 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/in-tagtree-of/readme\":{\"title\":\"$:/plugins/linonetwo/in-tagtree-of/readme\",\"creator\":\"LinOnetwo\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"A very fast version of `kin::to[xxx]`.\\n\\n> Finds out where a tiddler originates from, is it in a tag tree with xxx as root?\\n\\n!! Usage\\n\\nSee [[demo site|https://tiddly-gittly.github.io/in-tagtree-of/]] for interactive examples.\\n\\n!!! Normal usage\\n\\n`[[Ling]in-tagtree-of[Clancy]]` : check if `Ling` is ''in a tag tree'' with `Clancy` as root.\\n\\n`[all[tiddlers]!in-tagtree-of[Clancy]]` : with `!` prefix, get all tiddlers that are ''not'' in a tag tree with `Clancy` as root.\\n\\n!!! Advanced usage\\n\\n`[all[tiddlers]in-tagtree-of:inclusive[Clancy]]` : with `inclusive` suffix, get all tiddlers that are ''in a tag tree'' with `Clancy` as root, ''including `Clancy` himself''\\n\\n!!! With macro\\n\\n```tw5\\n\\n\\\\define get-non-completed-leaf-tasks() [in-tagtree-of!filterfilter]\\n\\n\\\\define caption() ToDos <$count filter=<> />\\n<$macrocall $name=aggregation caption=<> filter=<> defaultFields=\\\"title tags\\\" class=\\\"w-100\\\" state=\\\"ITKG-TaskDynamicTable-state\\\" />\\n```\\n\\n!! Difference from taggingtree\\n\\n[[taggingtree|https://talk.tiddlywiki.org/t/recursive-filter-operators-to-show-all-tiddlers-beneath-a-tag-and-all-tags-above-a-tiddler/3814]] is a [[Selection Constructors|https://tiddlywiki.com/#Selection%20Constructors]], thus can not be used in cascade or FileSystemPaths. See [[How to test filesystempath easily|https://talk.tiddlywiki.org/t/how-to-test-filesystempath-easily/6353]] for details.\"},\"$:/plugins/linonetwo/in-tagtree-of/index.js\":{\"creator\":\"LinOnetwo\",\"title\":\"$:/plugins/linonetwo/in-tagtree-of/index.js\",\"type\":\"application/javascript\",\"module-type\":\"filteroperator\",\"Modern.TiddlyDev#Origin\":\"index.ts\",\"text\":\"\\\"use strict\\\";function getTiddlersRecursively(e,i){const t=new Set($tw.wiki.getTiddlersWithTag(e));0{t.has(e)&&t[\\\"delete\\\"](e)}):t.forEach(e=>{i.has(e)&&t[\\\"delete\\\"](e)})),t.forEach(e=>i.add(e)),t.forEach(e=>{getTiddlersRecursively(e,i)}))}exports[\\\"in-tagtree-of\\\"]=function inTagTreeOfFilterOperator(e,i){var t;const r=i.operand;var s=\\\"inclusive\\\"===i.suffix,a=\\\"!\\\"===i.prefix;const l=new Set;let n;if(e((e,i)=>{l.add(i),void 0===n&&(n=e)}),1===l.size&&!a){var[d]=l;if(!0===(null==(t=null==(t=null==n?void 0:n.fields)?void 0:t.tags)?void 0:t.includes(r)))return[d];if(s&&d===r)return[d]}const o=$tw.wiki.getGlobalCache(\\\"in-tagtree-of-\\\"+r,()=>{var e=new Set;return getTiddlersRecursively(r,e),e});return s&&o.add(r),a?[...l].filter(e=>!o.has(e)):[...l].filter(e=>o.has(e))};\"}}}", 10 | "title": "$:/plugins/linonetwo/in-tagtree-of", 11 | "type": "application/json", 12 | "version": "0.2.0", 13 | "Modern.TiddlyDev#SHA256-Hashed": "2da9b66ac9b7fd8d4bfe5aa16a2ad40d7069e403027ccf090648584b467b183c", 14 | "name": "in-tagtree-of" 15 | } 16 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_mat_field-value-selector.json: -------------------------------------------------------------------------------- 1 | {"tiddlers":{"$:/plugins/mat/field-value-selector/field-value-selector":{"title":"$:/plugins/mat/field-value-selector/field-value-selector","creator":"Mat von TWaddle","type":"text/vnd.tiddlywiki","tags":"$:/tags/EditTemplate","text":"\\define new-field-value-dropdown()\n<$set name=newfieldname value={{{ [get[text]] }}}>\n<$set name=newfieldvalue value={{{ [get[text]] }}}>\n<$button\n popup=<>\n class=\"tc-btn-invisible tc-btn-dropdown nfvd-center\">\n {{$:/core/images/down-arrow}}\n\n\n<$reveal state=<> \n type=\"nomatch\" text=\"\" default=\"\" class=\"nfvd-center\">\n
\n<$linkcatcher to=<>>\n
\n <$list filter=\"\"\"[!has[text]]\"\"\">\n Enter field name to then select field value\n \n <$list filter=\"\"\"[has[text]]\"\"\">\n \"<>\" values in other tiddlers:\n \n
\n\n <$list filter=\"\"\"[!text[list-before]!text[list-after]]\"\"\">\n <$list filter=\"\"\"[all[shadows+tiddlers]hascount[]prefix[0]]\"\"\">\n  [Previously unused field name]\n \n <$set name=\"valuesWithDoubles\"\n filter=\"\"\"[all[shadows+tiddlers]hasget]\"\"\">\n <$list filter=\"\"\"[enlist]\"\"\">\n <$link/>\n \n \n \n\n <$list filter=\"\"\"[text[list-before]] [text[list-after]]\"\"\">\n <>\n \n\n\n
\n\n\n\n\\end\n\n\\define list-before/after()\n
\n  ,,ViewTemplates,,\n<$list filter=\"\"\"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]prefix[$:/core/ui/ViewTemplate/]]\"\"\"><$link/>\n\n  ,,Custom ViewTemplates,,\n<$list filter=\"\"\"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!prefix[$:/core/ui/ViewTemplate/]!prefix[Draft of]]\"\"\"><$link/>\n\n  ,,EditTemplates,,\n<$list filter=\"\"\"[all[shadows+tiddlers]tag[$:/tags/EditTemplate]prefix[$:/core/ui/EditTemplate/]]\"\"\"><$link/>\n\n  ,,Custom EditTemplates,,\n<$list filter=\"\"\"[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!prefix[$:/core/ui/EditTemplate/]!prefix[Draft of]]\"\"\">\n<$link/>\n\n
\n\\end\n\n<>\n\n\n"},"$:/plugins/mat/field-value-selector/readme":{"title":"$:/plugins/mat/field-value-selector/readme","creator":"Mat von TWaddle","type":"text/vnd.tiddlywiki","text":"[[field-value-selector|$:/plugins/mat/field-value-selector]] is an EditView template that adds a small arrow button below the \"new fields\" area.\n\nWhen you fill in a custom field name and then click this button, you get a dropdown showing all existing field values for that field name.\n\nlist-before and list-after are special and instead showing lists of all viewtemplate titles and edittemplate titles for easy selection. This functionality was the main incentive for this 'plugin', because it is darn impossible to remember the template titles.\n\nInstalling this 'plugin' does not modify any shadow tiddlers (...which meant showing the button below the \"new fields\" area, instead of at a more prettily integrated position.) "}}} -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_github-external-image.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "LinOnetwo", 4 | "core-version": ">=5.1.22", 5 | "dependents": "", 6 | "description": "Use github as your image storage, add _canonical_uri to all image, pointing to raw.github", 7 | "list": "readme ControlPanel/Settings", 8 | "plugin-type": "plugin", 9 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/intention-tower-knowledge-graph/ControlPanel/Settings.css\":{\"title\":\"$:/plugins/linonetwo/intention-tower-knowledge-graph/ControlPanel/Settings.css\",\"text\":\".itkg-setting-tags-item input {\\n margin-left: 5px;\\n padding: 2px;\\n} \",\"tags\":\"$:/tags/Stylesheet\"},\"$:/plugins/linonetwo/github-external-image/ControlPanel/Settings\":{\"title\":\"$:/plugins/linonetwo/github-external-image/ControlPanel/Settings\",\"caption\":\"GithubPagesImage\",\"tags\":\"$:/tags/ControlPanel/SettingsTab\",\"text\":\"!!! [[Repo|$:/GitHub/Repo]]\\n\\nThis is the user name + / + repo name, e.g. `linonetwo/wiki`\\n\\n<$edit-text tiddler=\\\"$:/GitHub/Repo\\\" field=\\\"text\\\" tag=input class=\\\"w-100\\\" />\\n\\n!!! [[Branch|$:/GitHub/Branch]]\\n\\nThis usually is `master` or `main`\\n\\n<$edit-text tiddler=\\\"$:/GitHub/Branch\\\" field=\\\"text\\\" tag=input class=\\\"w-100\\\" />\\n\\n!!! [[tiddler-folder-name|$:/config/linonetwo/github-external-image/tiddler-folder-name]]\\n\\nThis usually is just `tiddlers`\\n\\n<$edit-text tiddler=\\\"$:/config/linonetwo/github-external-image/tiddler-folder-name\\\" field=\\\"text\\\" tag=input class=\\\"w-100\\\" />\"},\"$:/core/templates/canonical-uri-external-image\":{\"title\":\"$:/core/templates/canonical-uri-external-image\",\"created\":\"20200412025117549\",\"creator\":\"LinOnetwo\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"\\nhttps://raw.githubusercontent.com/{{$:/GitHub/Repo}}/{{$:/GitHub/Branch}}/{{$:/config/linonetwo/github-external-image/tiddler-folder-name}}/<$view field=\\\"title\\\" format=\\\"urlencoded\\\"/>\"},\"$:/GitHub/Branch\":{\"title\":\"$:/GitHub/Branch\",\"text\":\"master\"},\"$:/config/linonetwo/github-external-image/tiddler-folder-name\":{\"title\":\"$:/config/linonetwo/github-external-image/tiddler-folder-name\",\"text\":\"tiddlers\"},\"$:/plugins/linonetwo/github-external-image/readme\":{\"title\":\"$:/plugins/linonetwo/github-external-image/readme\",\"creator\":\"LinOnetwo\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"!! Usage\\n\\nPlease fill in [[$:/GitHub/Repo]] and [[$:/config/linonetwo/github-external-image/tiddler-folder-name]] in settings to get started:\\n\\n[[Settings|$:/plugins/linonetwo/github-external-image/ControlPanel/Settings]]\\n\\nThen, on build, all images will be replaced by place holders.\\n\\nPlease use following build target:\\n\\n```json\\n\\\"externalimages\\\": [\\n \\\"--setfield\\\",\\n \\\"[is[binary]] [type[application/msword]]\\\",\\n \\\"_canonical_uri\\\",\\n \\\"$:/core/templates/canonical-uri-external-image\\\",\\n \\\"text/plain\\\",\\n \\\"--setfield\\\",\\n \\\"[is[binary]] [type[application/msword]]\\\",\\n \\\"text\\\",\\n \\\"$:/core/templates/canonical-uri-external-image\\\",\\n \\\"text/plain\\\",\\n \\\"--rendertiddler\\\",\\n \\\"$:/core/save/all\\\",\\n \\\"index.html\\\",\\n \\\"text/plain\\\"\\n],\\n```\\n\"}}}", 10 | "title": "$:/plugins/linonetwo/github-external-image", 11 | "type": "application/json", 12 | "version": "0.1.0", 13 | "Modern.TiddlyDev#SHA256-Hashed": "2cf4ce1c737b75662b44f8410e606dea90312442d42e9cb4f139e8d92b57eff5", 14 | "name": "github-external-image" 15 | } 16 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_Gk0Wk_focused-tiddler.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "Gk0Wk", 4 | "dependents": "", 5 | "description": "Detecting the tiddler you are viewing", 6 | "list": "readme config", 7 | "name": "Focused Tiddler", 8 | "plugin-type": "plugin", 9 | "text": "{\"tiddlers\":{\"$:/plugins/Gk0Wk/focused-tiddler/config\":{\"title\":\"$:/plugins/Gk0Wk/focused-tiddler/config\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"<$list filter=\\\"[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]\\\" variable=\\\"lang\\\">\\n<$list filter=\\\"[search[zh]]\\\">\\n\\n; 顶部偏移\\n: <$edit-text tiddler=\\\"$:/plugins/Gk0Wk/focused-tiddler/top-offset\\\" tag=\\\"input\\\" default=\\\"71\\\" /> (px)\\n: 条目顶部与窗口页面顶部的距离小于偏移量时,该条目会被聚焦。(单位:px)\\n\\n\\n\\n<$list filter=\\\"[!search[zh]]\\\">\\n\\n; Top Offset\\n: <$edit-text tiddler=\\\"$:/plugins/Gk0Wk/focused-tiddler/top-offset\\\" tag=\\\"input\\\" default=\\\"71\\\" /> (px)\\n: The entry is focused when the distance between the top of the entry and the top of the window page is less than the offset. (Unit: px)\\n\\n\\n\\n\"},\"$:/plugins/Gk0Wk/focused-tiddler/readme\":{\"title\":\"$:/plugins/Gk0Wk/focused-tiddler/readme\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"<$list filter=\\\"[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]\\\" variable=\\\"lang\\\">\\n<$list filter=\\\"[search[zh]]\\\">\\n\\n! 聚焦条目\\n\\n检测你现在正在看的条目,并将其标题存在 `$:/temp/focussedTiddler`。\\n\\n判定方法:当打开新条目、滚动条目至一定位置(可配置)或者点击条目内容时,及判定为聚焦条目。\\n\\n> 本插件使用灵活而强大的 <$text text=\\\"TiddlyWiki\\\" /> 开发框架 [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]\\n\\n\\n\\n<$list filter=\\\"[!search[zh]]\\\">\\n\\n! focused-tiddler\\n\\nDetecting the tiddler you are viewing, and save its title to `$:/temp/focussedTiddler`.\\n\\nJudgment method: When opening a new tiddler, scrolling the tiddler to a certain position (configurable) or clicking on the content of the tiddler, and judged to be a focused tiddler.\\n\\n> This plugin uses the flexible and powerful <$text text=\\\"TiddlyWiki\\\" /> development framework [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]\\n\\n\\n\\n\"},\"$:/plugins/Gk0Wk/focused-tiddler/top-offset\":{\"title\":\"$:/plugins/Gk0Wk/focused-tiddler/top-offset\",\"text\":\"71\\n\"},\"$:/plugins/Gk0Wk/focused-tiddler/top-offset/hook.js\":{\"title\":\"$:/plugins/Gk0Wk/focused-tiddler/top-offset/hook.js\",\"module-type\":\"startup\",\"type\":\"application/javascript\",\"Modern.TiddlyDev#Origin\":\"hook.ts\",\"text\":\"\\\"use strict\\\";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(t,o,r,s)=>{if(o&&\\\"object\\\"==typeof o||\\\"function\\\"==typeof o)for(let e of __getOwnPropNames(o))__hasOwnProp.call(t,e)||e===r||__defProp(t,e,{get:()=>o[e],enumerable:!(s=__getOwnPropDesc(o,e))||s.enumerable});return t},__toCommonJS=e=>__copyProps(__defProp({},\\\"__esModule\\\",{value:!0}),e),hook_exports={},topOffset=(__export(hook_exports,{after:()=>after,name:()=>name,platforms:()=>platforms,startup:()=>startup,synchronous:()=>synchronous}),module.exports=__toCommonJS(hook_exports),71),updateTopOffset=()=>{topOffset=Number($tw.wiki.getTiddlerText(\\\"$:/plugins/Gk0Wk/focused-tiddler/top-offset\\\",\\\"71\\\").trim()),Number.isSafeInteger(topOffset)||(topOffset=71)},check=()=>{var t=document.querySelectorAll(\\\".tc-story-river .tc-tiddler-frame\\\");if(0===t.length)update(null);else{for(let e=t.length-1;0<=e;e--)if(!(100{var t;e!==previousFocusedDom&&(t=null!==e&&(null!=(t=e.getAttribute(\\\"data-tiddler-title\\\"))?t:null==(t=e.querySelector(\\\".tc-tiddler-title .tc-titlebar .tc-title\\\"))?void 0:t.textContent)||void 0,$tw.wiki.addTiddler({title:\\\"$:/temp/focussedTiddler\\\",text:t||\\\"\\\"}),previousFocusedDom&&$tw.utils.removeClass(previousFocusedDom,\\\"gk0wk-focused-tiddler\\\"),e&&$tw.utils.addClass(e,\\\"gk0wk-focused-tiddler\\\"),previousFocusedDom=e)},name=\\\"gk0wk-focused-tiddler\\\",platforms=[\\\"browser\\\"],after=[\\\"render\\\"],synchronous=!0,startup=()=>{updateTopOffset();let e;window.addEventListener(\\\"scroll\\\",()=>{void 0===e&&(e=setTimeout(()=>{e=void 0,check()},250))}),window.addEventListener(\\\"click\\\",({target:t})=>{var e,o;if(null!=(o=null==(e=document.querySelector(\\\".tc-story-river\\\"))?void 0:e.contains)&&o.call(e,t)){var r=document.querySelectorAll(\\\".tc-story-river .tc-tiddler-frame\\\");for(let e=r.length-1;0<=e;e--)if(r[e].contains(t))return void update(r[e])}}),$tw.wiki.addEventListener(\\\"change\\\",e=>{e[\\\"$:/plugins/Gk0Wk/focused-tiddler/top-offset\\\"]&&updateTopOffset(),(e[\\\"$:/HistoryList\\\"]||e[\\\"$:/StoryList\\\"])&&setTimeout(()=>check(),$tw.utils.getAnimationDuration()+100)})};\"}}}", 10 | "title": "$:/plugins/Gk0Wk/focused-tiddler", 11 | "type": "application/json", 12 | "version": "0.0.3", 13 | "Modern.TiddlyDev#SHA256-Hashed": "a824f67b3fa431b7fa496185264a3cd2cdfcbce53df02f19bdad115283c88e3e" 14 | } 15 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_tag-tree-picker-macro.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "LinOnetwo", 4 | "core-version": ">=5.1.22", 5 | "dependents": "", 6 | "description": "Tree style tag picker", 7 | "list": "readme tree", 8 | "plugin-type": "plugin", 9 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/tag-tree-picker-macro/readme\":{\"title\":\"$:/plugins/linonetwo/tag-tree-picker-macro/readme\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"!! Macro usage\\n\\nThis traditional tag list will show tags in a line:\\n\\n```tw5\\n<$vars currentTiddler=\\\"$:/plugins/linonetwo/tw-calendar/settings/frequently-used-tags\\\" tagField=\\\"text\\\">\\n\\t{{||$:/core/ui/EditTemplate/tags}}\\n\\n```\\n\\nBut this plugin provides a `tag-tree-picker` macro to show tags in a tree:\\n\\n```tw5\\n<$transclude\\n\\t$variable=\\\"tag-tree-picker\\\"\\n\\ttags={{TiddlerWithListOfTags}}\\n/>\\n```\\n\\n`tags` parameter receive a list of tiddler name, if those tiddlers have tree relationship, show then as tree.\\n\\nTo make click-on-it work, you need to define `tag-tree-button-action` macro in the context, this is work as a `onClick` callback action:\\n\\n```tw5\\n\\n\\\\define tag-tree-button-action(tagName)\\n<$action-navigate $to=\\\"$tagName$\\\" />\\n\\\\end\\n\\n\\n\\\\define tag-tree-button-action(tagName)\\n<$action-listops $tags=\\\"[[$tagName$]]\\\" $tiddler=\\\"\\\"\\\"$(targetTiddler)$\\\"\\\"\\\" />\\n\\\\end\\n\\n\\n\\\\define tag-tree-button-action(tagName)\\n<$action-listops $tags=\\\"[[$tagName$]]\\\" $tiddler=\\\"Index\\\" />\\n\\\\end\\n```\\n\\nNote that tags in this tree are buttons, so action is not \\\"add tag to currentTiddler\\\" by default, you need to define the onClick action you want.\\n\\n!! Example\\n\\nA tag picker\\n\\n```tw5\\n\\\\define tag-tree-button-action(tagName)\\n<$action-listops $tags=\\\"[[$tagName$]]\\\" $tiddler=\\\"\\\"\\\"$(targetTiddler)$\\\"\\\"\\\" />\\n\\\\end\\n\\n\\\\define empty-list-help-text()\\n

\\nYou can goto Plugin Setting in control panel or plugin page, add frequently used tags here.\\n

\\n\\\\end\\n\\n
\\n <$let targetTiddler=<> >\\n <$list filter=\\\"[list[$:/plugins/linonetwo/tw-calendar/settings/frequently-used-tags!!text]first[]then[yes]]\\\" storyview=\\\"pop\\\" emptyMessage=<>>\\n
\\n <$transclude\\n $variable=\\\"input-only-tag-tree\\\"\\n tags={{$:/plugins/linonetwo/tw-calendar/settings/frequently-used-tags}}\\n />\\n
\\n \\n \\n
\\n```\\n\\n[img[Screenshot1.png]]\\n\\n[img[Screenshot2.png]]\\n\"},\"$:/plugins/linonetwo/tw-calendar/style.css\":{\"title\":\"$:/plugins/linonetwo/tw-calendar/style.css\",\"creator\":\"LinOnetwo\",\"tags\":\"$:/tags/Stylesheet\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\".linonetwo-tag-tree-picker-macro button {\\n border: 0;\\n cursor: pointer;\\n}\"},\"$:/plugins/linonetwo/tag-tree-picker-macro/tree\":{\"title\":\"$:/plugins/linonetwo/tag-tree-picker-macro/tree\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"<>\"},\"$:/plugins/linonetwo/tag-tree-picker-macro/tagTreeMacro.js\":{\"title\":\"$:/plugins/linonetwo/tag-tree-picker-macro/tagTreeMacro.js\",\"type\":\"application/javascript\",\"module-type\":\"macro\",\"tags\":\"$:/tags/Macro\",\"Modern.TiddlyDev#Origin\":\"tagTreeMacro.ts\",\"text\":\"\\\"use strict\\\";exports.name=\\\"tag-tree-picker\\\",exports.params=[{name:\\\"tags\\\"}];var textMacros=`\\n\\\\\\\\define tag-styles()\\nbackground-color:$(backgroundColor)$;\\nfill:$(foregroundColor)$;\\ncolor:$(foregroundColor)$;\\n\\\\\\\\end\\n\\n\\\\\\\\define tag-body-inner(colour,fallbackTarget,colourA,colourB,icon)\\n\\\\\\\\whitespace trim\\n<$vars foregroundColor=<> backgroundColor=\\\"\\\"\\\"$colour$\\\"\\\"\\\">\\n <$button class=\\\"tc-tag-label\\\" style=<>>\\n <$transclude $variable=\\\"tag-tree-button-action\\\" tagName=<> />\\n <$transclude tiddler=\\\"\\\"\\\"$icon$\\\"\\\"\\\"/>\\n <$transclude field=\\\"caption\\\">\\n <$view field=\\\"title\\\"/>\\n \\n \\n\\n\\\\\\\\end\\n`;function buildTocWithOfferedTiddlers(r,l){var e=$tw.wiki.filterTiddlers(`[tag[${r}]]`),t=null!=(t=$tw.wiki.getTiddlerText(\\\"$:/palette\\\"))?t:\\\"$:/palettes/Vanilla\\\",t=`\\n <$let\\n currentTiddler=\\\"${r}\\\"\\n icon={{{ [[${r}]] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}\\n fallbackTarget={{${t}##tag-background}}\\n colourA={{${t}##foreground}}\\n colourB={{${t}##background}}\\n colour={{{ [[${r}]] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}\\n >\\n <$macrocall $name=\\\"tag-body-inner\\\" colour=<> fallbackTarget=<> colourA=<> colourB=< icon=<>/>\\n `;return 0===e.length?t:t+`\\n
    \\n\\t${e.filter(r=>l.includes(r)).map(r=>`
  • ${buildTocWithOfferedTiddlers(r,l)}
  • `).join(\\\"\\\")}\\n\\t
`}exports.run=function(r=\\\"\\\"){const e=r.split(\\\" \\\").filter(r=>0{var l=$tw.wiki.getTiddler(r);return void 0===l||!(null!=(l=l.fields.tags)?l:[]).some(r=>e.includes(r))});return 0===l.length?\\\"\\\":`${textMacros}
    \\n ${l.map(r=>buildTocWithOfferedTiddlers(r,e)).map(r=>`
  • ${r}
  • `).join(\\\"\\\")}\\n
`};\"}}}", 10 | "title": "$:/plugins/linonetwo/tag-tree-picker-macro", 11 | "type": "application/json", 12 | "version": "0.0.1", 13 | "Modern.TiddlyDev#SHA256-Hashed": "69127cd49bc848a2cec9170c558f1ac5b0fe54d20010eff26f676b3d88ac6acd", 14 | "name": "tag-tree-picker-macro" 15 | } 16 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_Gk0Wk_sidebar-resizer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "Gk0Wk", 4 | "dependents": "", 5 | "description": "Use the cursor to resize the width of the sidebar.", 6 | "list": "readme LICENSE", 7 | "name": "Sidebar Resizer", 8 | "plugin-type": "plugin", 9 | "source": "https://github.com/Gk0Wk/TiddlySeq/tree/master/plugins/Gk0Wk/sidebar-resizer", 10 | "text": "{\"tiddlers\":{\"$:/plugins/Gk0Wk/sidebar-resizer/LICENSE\":{\"title\":\"$:/plugins/Gk0Wk/sidebar-resizer/LICENSE\",\"text\":\"MIT License\\n\\nCopyright (c) 2021 Ke Wang (Gk0Wk in GitHub)\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\nof this software and associated documentation files (the \\\"Software\\\"), to deal\\nin the Software without restriction, including without limitation the rights\\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\ncopies of the Software, and to permit persons to whom the Software is\\nfurnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all\\ncopies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\nSOFTWARE.\\n\",\"type\":\"text/plain\"},\"$:/plugins/Gk0Wk/sidebar-resizer/readme\":{\"title\":\"$:/plugins/Gk0Wk/sidebar-resizer/readme\",\"text\":\"\\\\define lingo-base() $:/language/ThemeTweaks/\\n\\n<$list filter=\\\"[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]\\\" variable=\\\"lang\\\">\\n<$list filter=\\\"[search[zh]]\\\">\\n\\n会在侧边栏的左侧边缘添加一个可拖动的边框,当鼠标移动到左侧边缘时会看到这个边框。拖动这个边框可以改变侧边栏的宽度,拖动到靠近窗口右侧边缘时就会自动收起侧边栏。\\n\\n原理是更改[[$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth]]的值。\\n\\n注意:首先请将 <$link to=\\\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\\\"><> 调整为`fluid-fixed`,本插件才可生效。\\n\\n<$button set=\\\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\\\" setTo=\\\"fluid-fixed\\\">点击设置<>\\n\\n> 本插件使用灵活而强大的 <$text text=\\\"TiddlyWiki\\\" /> 开发框架 [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]\\n\\n\\n\\n<$list filter=\\\"[!search[zh]]\\\">\\n\\nA draggable border is added to the left edge of the sidebar, which will be visible when the mouse is moved to the left edge. Dragging this border will change the width of the sidebar, and it will automatically close the sidebar when dragged near the right edge of the window.\\n\\nThe principle is to change the value of [[$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth]].\\n\\nNote: First, please adjust <$link to=\\\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\\\"><> to `fluid-fixed` for this plugin to take effect.\\n\\n<$button set=\\\"$:/themes/tiddlywiki/vanilla/options/sidebarlayout\\\" setTo=\\\"fluid-fixed\\\">Click to adjust<>\\n\\n> This plugin uses the flexible and powerful <$text text=\\\"TiddlyWiki\\\" /> development framework [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]\\n\\n\\n\\n\"},\"$:/plugins/Gk0Wk/sidebar-resizer/resizer\":{\"title\":\"$:/plugins/Gk0Wk/sidebar-resizer/resizer\",\"tags\":\"$:/tags/SideBarSegment\",\"text\":\"
\\n\"},\"$:/plugins/Gk0Wk/sidebar-resizer/style.css\":{\"title\":\"$:/plugins/Gk0Wk/sidebar-resizer/style.css\",\"text\":\"<$reveal state=\\\"$:/state/sidebar\\\" type=\\\"match\\\" text=\\\"no\\\">\\n.tc-sidebar-scrollable {\\n\\tdisplay: none;\\n}\\n\\n\\ndiv#gk0wk-sidebar-resize-area {\\n\\theight: 100vh;\\n\\twidth: 10px;\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tleft: -5px;\\n\\tcursor: ew-resize;\\n\\ttransition: all {{$:/config/AnimationDuration}}ms;\\n}\\n\\ndiv#gk0wk-sidebar-resize-area:hover {\\n\\tbackground: <>;\\n}\\n\",\"tags\":\"$:/tags/Stylesheet\",\"type\":\"text/vnd.tiddlywiki\"},\"$:/plugins/Gk0Wk/sidebar-resizer/hook.js\":{\"title\":\"$:/plugins/Gk0Wk/sidebar-resizer/hook.js\",\"module-type\":\"startup\",\"type\":\"application/javascript\",\"Modern.TiddlyDev#Origin\":\"hook.ts\",\"text\":\"\\\"use strict\\\";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(t,o,r,n)=>{if(o&&\\\"object\\\"==typeof o||\\\"function\\\"==typeof o)for(let e of __getOwnPropNames(o))__hasOwnProp.call(t,e)||e===r||__defProp(t,e,{get:()=>o[e],enumerable:!(n=__getOwnPropDesc(o,e))||n.enumerable});return t},__toCommonJS=e=>__copyProps(__defProp({},\\\"__esModule\\\",{value:!0}),e),hook_exports={},name=(__export(hook_exports,{after:()=>after,name:()=>name,platforms:()=>platforms,startup:()=>startup,synchronous:()=>synchronous}),module.exports=__toCommonJS(hook_exports),\\\"gk0wk-sidebar-resizer\\\"),platforms=[\\\"browser\\\"],after=[\\\"render\\\"],synchronous=!0,startup=()=>{let r=!1,t=null;const n=document[\\\"body\\\"],i=e=>{r=!0,e instanceof PointerEvent&&n.setPointerCapture(e.pointerId),n.style.userSelect=\\\"none\\\",n.style.MozUserSelect=\\\"none\\\"},s=e=>{r&&(r=!1,e instanceof PointerEvent&&n.releasePointerCapture(e.pointerId),n.style.userSelect=\\\"auto\\\",n.style.MozUserSelect=\\\"auto\\\")};$tw.hooks.addHook(\\\"th-page-refreshed\\\",()=>{var e;function o(e){$tw.wiki.setText(\\\"$:/state/sidebar\\\",void 0,void 0,\\\"no\\\"),s(e)}null!=t&&t.ownerDocument.contains(t)||(t=document.querySelector(\\\"#gk0wk-sidebar-resize-area\\\"))&&(r=!1,e=(t=window.event)=>{if(r&&t)return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),t.returnValue=!1,requestAnimationFrame(()=>{var e=100-t.clientX/window.innerWidth*100;if(80 ${cmd}`); 20 | execSync(cmd, { cwd: repoFolder, stdio: 'inherit' }); 21 | } 22 | 23 | /** 24 | * 执行命令,忽略错误 25 | */ 26 | function execIgnoreError(cmd) { 27 | try { 28 | exec(cmd); 29 | } catch (error) { 30 | console.log(`⚠ Skipped: ${error.message.split('\n')[0]}`); 31 | } 32 | } 33 | 34 | /** 35 | * 构建在线HTML版本 36 | */ 37 | async function buildOnlineHTML() { 38 | console.log('\n📦 Building Online HTML...'); 39 | 40 | // 清空并创建输出目录 41 | await fs.remove(folderToServe); 42 | await fs.ensureDir(folderToServe); 43 | 44 | // 复制静态文件 45 | await fs.copy(path.join(repoFolder, 'public'), folderToServe); 46 | try { 47 | await fs.copy(path.join(repoFolder, 'vercel.json'), path.join(folderToServe, 'vercel.json')); 48 | } catch (e) { 49 | console.log('⚠ vercel.json not found'); 50 | } 51 | 52 | // 备份 tiddlers 53 | const tmpBackupDir = path.join(repoFolder, 'tmp_tiddlers_backup'); 54 | try { 55 | await fs.remove(tmpBackupDir); 56 | } catch (e) { 57 | // ignore 58 | } 59 | const tiddlersPath = path.join(repoFolder, 'tiddlers'); 60 | if (fs.existsSync(tiddlersPath)) { 61 | await fs.copy(tiddlersPath, tmpBackupDir); 62 | } else { 63 | console.warn('⚠ WARNING: tiddlers directory not found, skipping backup'); 64 | } 65 | 66 | try { 67 | // 构建在线版本(媒体文件外化) 68 | exec(`tiddlywiki ${repoFolder} --output ${folderToServe} ` + 69 | `--deletetiddlers '[[$:/UpgradeLibrary]] [[$:/UpgradeLibrary/List]]' ` + 70 | `--setfield '[is[image]] [is[binary]] [type[application/msword]] [type[image/svg+xml]]' _canonical_uri $:/core/templates/canonical-uri-external-image text/plain ` + 71 | `--setfield '[is[image]] [is[binary]] [type[application/msword]] [type[image/svg+xml]]' text "" text/plain ` + 72 | `--rendertiddler $:/core/save/offline-external-js index-raw.html text/plain "" publishFilter "-[is[draft]]" ` + 73 | `--rendertiddler $:/core/templates/tiddlywiki5.js tiddlywikicore.js text/plain`); 74 | 75 | // 最小化JS 76 | try { 77 | const version = execSync('npx tiddlywiki . --version', { cwd: repoFolder, encoding: 'utf-8' }).trim(); 78 | const versionStr = version.match(/^\d+\.\d+\.\d+/)?.[0] || '5.0.0'; 79 | const jsPath = path.join(folderToServe, 'tiddlywikicore.js'); 80 | const minifiedPath = path.join(folderToServe, `tiddlywikicore-${versionStr}.js`); 81 | exec(`npx uglifyjs ${jsPath} -c -m --v8 --webkit --ie --output ${minifiedPath}`); 82 | await fs.remove(jsPath); 83 | } catch (e) { 84 | console.log('⚠ JS minification skipped'); 85 | } 86 | 87 | // 最小化HTML 88 | try { 89 | const configPath = path.join(repoFolder, 'scripts/html-minifier-terser.config.json'); 90 | const rawHtmlPath = path.join(folderToServe, 'index-raw.html'); 91 | const minifiedHtmlPath = path.join(folderToServe, 'index-minify.html'); 92 | const finalHtmlPath = path.join(folderToServe, 'index.html'); 93 | 94 | exec(`npx html-minifier-terser -c ${configPath} -o ${minifiedHtmlPath} ${rawHtmlPath}`); 95 | const htmlContent = fs.readFileSync(minifiedHtmlPath, 'utf-8'); 96 | const htmlContentWithCorrectJsPath = htmlContent.replaceAll('%24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js', 'tiddlywiki5.js'); 97 | fs.writeFileSync(finalHtmlPath, htmlContentWithCorrectJsPath); 98 | await fs.remove(rawHtmlPath); 99 | await fs.remove(minifiedHtmlPath); 100 | } catch (e) { 101 | console.log('⚠ HTML minification skipped'); 102 | } 103 | 104 | // 生成sitemap 105 | execIgnoreError(`tiddlywiki . --rendertiddler sitemap sitemap.xml text/plain`); 106 | try { 107 | await fs.copy(path.join(repoFolder, 'output/sitemap.xml'), path.join(folderToServe, 'sitemap.xml')); 108 | } catch (e) { 109 | console.log('⚠ sitemap.xml not generated'); 110 | } 111 | 112 | // workbox 113 | execIgnoreError(`workbox injectManifest workbox-config.js`); 114 | 115 | console.log('✅ Online HTML built successfully'); 116 | } finally { 117 | // 恢复 tiddlers 118 | try { 119 | if (fs.existsSync(tmpBackupDir)) { 120 | try { 121 | await fs.remove(path.join(repoFolder, 'tiddlers')); 122 | } catch (e) { 123 | // ignore 124 | } 125 | await fs.copy(tmpBackupDir, path.join(repoFolder, 'tiddlers')); 126 | await fs.remove(tmpBackupDir); 127 | } 128 | } catch (e) { 129 | console.error('❌ Error restoring tiddlers:', e.message); 130 | } 131 | } 132 | } 133 | 134 | /** 135 | * 构建离线HTML版本 136 | */ 137 | async function buildOfflineHTML() { 138 | console.log('\n📦 Building Offline HTML...'); 139 | 140 | const offlineOutputDir = path.join(folderToServe, 'offline'); 141 | await fs.ensureDir(offlineOutputDir); 142 | 143 | try { 144 | // 构建离线版本(所有资源包含) 145 | exec(`tiddlywiki ${repoFolder} --output ${offlineOutputDir} ` + 146 | `--deletetiddlers '[[$:/UpgradeLibrary]] [[$:/UpgradeLibrary/List]]' ` + 147 | `--rendertiddler $:/core/save/all index-raw.html text/plain "" publishFilter "-[is[draft]]"`); 148 | 149 | // 最小化HTML 150 | try { 151 | const configPath = path.join(repoFolder, 'scripts/html-minifier-terser.config.json'); 152 | const rawHtmlPath = path.join(offlineOutputDir, 'index-raw.html'); 153 | const minifiedHtmlPath = path.join(offlineOutputDir, 'index-minify.html'); 154 | const finalHtmlPath = path.join(offlineOutputDir, 'index.html'); 155 | 156 | exec(`npx html-minifier-terser -c ${configPath} -o ${minifiedHtmlPath} ${rawHtmlPath}`); 157 | await fs.remove(rawHtmlPath); 158 | await fs.move(minifiedHtmlPath, finalHtmlPath, { overwrite: true }); 159 | } catch (e) { 160 | console.log('⚠ HTML minification skipped, renaming raw HTML'); 161 | try { 162 | await fs.move(path.join(offlineOutputDir, 'index-raw.html'), 163 | path.join(offlineOutputDir, 'index.html'), { overwrite: true }); 164 | } catch (err) { 165 | console.error('❌ Failed to prepare HTML'); 166 | } 167 | } 168 | 169 | // 清理其他文件 170 | try { 171 | const files = await fs.readdir(offlineOutputDir); 172 | for (const file of files) { 173 | if (file !== 'index.html') { 174 | await fs.remove(path.join(offlineOutputDir, file)); 175 | } 176 | } 177 | } catch (e) { 178 | // ignore 179 | } 180 | 181 | console.log('✅ Offline HTML built successfully'); 182 | } catch (error) { 183 | console.error('❌ Error building offline HTML:', error.message); 184 | throw error; 185 | } 186 | } 187 | 188 | // 执行构建 189 | try { 190 | await buildOnlineHTML(); 191 | await buildOfflineHTML(); 192 | console.log('\n🎉 All builds completed successfully!'); 193 | } catch (error) { 194 | console.error('\n❌ Build failed:', error.message); 195 | process.exit(1); 196 | } 197 | -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_open-in-external-app.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/open-in-external-app/ViewToolbarButton/OpenInExternalApp\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/ViewToolbarButton/OpenInExternalApp\",\"tags\":\"$:/tags/ViewToolbar\",\"type\":\"text/vnd.tiddlywiki\",\"list-before\":\"$:/core/ui/Buttons/close\",\"caption\":\"{{$:/plugins/linonetwo/open-in-external-app/icons/open-in-app}} {{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-external-app}}\",\"short-caption\":\"{{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-external-app}}\",\"description\":\"Open tiddler in external app\",\"text\":\"\\\\whitespace trim\\n<$button tooltip={{!!description}} aria-label={{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-external-app}} class=<>>\\n <% if [has[_canonical_uri]] %>\\n <$action-sendmessage $message=\\\"tm-open-in-external-app\\\" filePath={{{[get[_canonical_uri]]}}} />\\n <% else %>\\n <$action-sendmessage $message=\\\"tm-open-in-external-app\\\" title=<> />\\n <% endif %>\\n <$list filter=\\\"[match[yes]]\\\">\\n {{$:/plugins/linonetwo/open-in-external-app/icons/open-in-app}}\\n \\n <$list filter=\\\"[match[yes]]\\\">\\n \\n <$text text={{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-external-app}}/>\\n \\n \\n\\n\"},\"$:/plugins/linonetwo/open-in-external-app/ViewToolbarButton/OpenInFolder\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/ViewToolbarButton/OpenInFolder\",\"tags\":\"$:/tags/ViewToolbar\",\"type\":\"text/vnd.tiddlywiki\",\"list-before\":\"$:/core/ui/Buttons/close\",\"caption\":\"{{$:/plugins/linonetwo/open-in-external-app/icons/open-in-folder}} {{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-folder}}\",\"short-caption\":\"{{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-folder}}\",\"description\":\"Open tiddler in folder\",\"text\":\"\\\\whitespace trim\\n<$button tooltip={{!!description}} aria-label={{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-folder}} class=<>>\\n <% if [has[_canonical_uri]] %>\\n <$action-sendmessage $message=\\\"tm-open-in-folder\\\" filePath={{{[get[_canonical_uri]]}}} />\\n <% else %>\\n <$action-sendmessage $message=\\\"tm-open-in-folder\\\" title=<> />\\n <% endif %>\\n <$list filter=\\\"[match[yes]]\\\">\\n {{$:/plugins/linonetwo/open-in-external-app/icons/open-in-folder}}\\n \\n <$list filter=\\\"[match[yes]]\\\">\\n \\n <$text text={{$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-folder}}/>\\n \\n \\n\\n\"},\"$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-external-app\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-external-app\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"Open External\"},\"$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-folder\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/button-caption-open-in-folder\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"Open in Folder\"},\"$:/plugins/linonetwo/open-in-external-app/changelog\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/changelog\",\"text\":\"! Changelog\\n\\n!! Version 0.3.0\\n\\n* **Breaking Change**: Requires TidGi-Desktop version 0.13.0 or higher\\n** Updated API usage: replaced `window?.meta?.()?.workspaceID` with `window?.meta?.()?.workspace`\\n\"},\"$:/plugins/linonetwo/open-in-external-app/icons/open-in-app\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/icons/open-in-app\",\"text\":\"\"},\"$:/plugins/linonetwo/open-in-external-app/icons/open-in-folder\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/icons/open-in-folder\",\"text\":\"\"},\"$:/plugins/linonetwo/open-in-external-app/readme\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/readme\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"!! Compatibility\\n\\n- Requires TidGi Desktop >= 0.13.0.\\n\\n!! Basic Usage\\n\\nAfter you import a PDF or image file into your wiki, you can open that tiddler, and click on the button to open that file in external PDF viewer or image reader.\\n\\nNote that if you use this to open a `.tid` or `.md` file, and edit it, things won't change in the wiki, because the tiddlywiki currently doesn't reload changed files from the disk.\\n\\n!! Message usage\\n\\nYou can use `param` or `$param` to passing the parameter. Or use `title` in `tm-open-in-external-app` and `filePath` in `tm-open-path`.\\n\\n!!! tm-open-in-external-app\\n\\n```tw5\\n<$button message=\\\"tm-open-in-external-app\\\" param=\\\"SomePDFTiddlerTitle\\\">Open that PDF\\n```\\n\\n```tw5\\n<$button>\\n <$action-sendmessage $message=\\\"tm-open-in-external-app\\\" title=\\\"SomePDFTiddlerTitle\\\" />\\n Open that PDF with tiddler title\\n\\n```\\n\\n!!! tm-open-path\\n\\nYou can use absolute path:\\n\\n```tw5\\n<$button message=\\\"tm-open-path\\\" param=\\\"SomePDF/File/Absolute/Path\\\">Open that PDF\\n```\\n\\nOr use relative path from the current wiki folder (that contains the `tiddlers` folder and `tiddler.info` file).\\n\\n```tw5\\n<$button>\\n <$action-sendmessage $message=\\\"tm-open-path\\\" filePath=\\\"tiddlers/File/relative/Path/from/Wiki/Folder\\\" />\\n Open that PDF with filePath\\n\\n```\\n\\nTry this to open the info file:\\n\\n<$button>\\n <$action-sendmessage $message=\\\"tm-open-path\\\" filePath=\\\"tiddlywiki.info\\\" />\\n Open tiddlywiki.info\\n\\n\"},\"$:/plugins/linonetwo/open-in-external-app/tree\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/tree\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"<>\"},\"$:/plugins/linonetwo/open-in-external-app/listener.js\":{\"title\":\"$:/plugins/linonetwo/open-in-external-app/listener.js\",\"type\":\"application/javascript\",\"module-type\":\"startup\",\"Modern.TiddlyDev#Origin\":\"listener.ts\",\"text\":\"\\\"use strict\\\";async function getFilePath(t){let e=\\\"\\\",a;if(\\\"string\\\"==typeof t.param?e=t.param:\\\"object\\\"==typeof t.paramObject&&((i=t.paramObject)?.title&&(e=i.title),i?.filePath)&&(a=i.filePath),a=e?await window?.service?.wiki?.getTiddlerFilePath?.(e):a){if(!/^(?:[A-Za-z]:[/\\\\\\\\]|\\\\/)/.test(a)){var i=(window?.meta?.()?.workspace)?.wikiFolderLocation;if(!i)return;a=decodeURI(i+\\\"/\\\"+a)}return a}}exports.startup=()=>{$tw.browser&&($tw.rootWidget.addEventListener(\\\"tm-open-in-external-app\\\",async t=>{var e=await getFilePath(t);void 0!==e&&await window?.service?.[\\\"native\\\"]?.openPath?.(e)}),$tw.rootWidget.addEventListener(\\\"tm-open-in-folder\\\",async t=>{var e=await getFilePath(t);void 0!==e&&await window?.service?.[\\\"native\\\"]?.openPath?.(e,!0)}),$tw.rootWidget.addEventListener(\\\"tm-open-path\\\",async t=>{let e=\\\"\\\";var a;\\\"string\\\"==typeof t.param?e=t.param:\\\"object\\\"==typeof t.paramObject&&(a=t.paramObject)?.filePath&&(e=a.filePath),await window?.service?.[\\\"native\\\"]?.openPath?.(e)}))};\"}}}", 4 | "title": "$:/plugins/linonetwo/open-in-external-app", 5 | "type": "application/json", 6 | "author": "LinOnetwo", 7 | "core-version": ">=5.1.22", 8 | "dependents": "", 9 | "description": "(Requires TidGi) A toolbar button to open PDF tiddler in os default reader, or open in folder.", 10 | "list": "readme changelog tree", 11 | "name": "Open In External App", 12 | "plugin-type": "plugin", 13 | "stability": "STABILITY_1_EXPERIMENTAL", 14 | "version": "0.3.0", 15 | "Modern.TiddlyDev#SHA256-Hashed": "b53423699cdf87477540569e7c60e27ca061e372ec6ccbf8fc411bb6d798628d" 16 | } 17 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_wikilabs_palette-watch.json: -------------------------------------------------------------------------------- 1 | {"tiddlers":{"$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-examples":{"title":"$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-examples","text":"\\procedure lightDarkwatchTitle() _/dynamic/light-dark/detection\n\\procedure startupwatchTitle() _/startup/light-dark/detection\n\n\\procedure dynamicLightDarkActionTemplate()\n<$reveal type=\"match\" stateTitle=\"$:/config/palette/enable-light-dark-detection\" text=\"yes\">\n\t<$let default={{{ [match[yes]then[$:/config/palette/default-dark]else[$:/config/palette/default-light]] }}}>\n\t\t<$action-setfield $tiddler=\"$:/palette\" text={{{ [get[text]] }}}/>\n\t\n\n\\end\n\n\\procedure createLightDarkwatch()\n<% if [!has[text]] %>\n<$action-createtiddler\n\t$basetitle=<>\n\ttext=<>\n\tcaption= \"Dynamically detect browser or OS setting\"\n\tcode-body= \"yes\"\n\ttags= \"$:/tags/DarkLightChangeActions\"\n/>\n<$action-navigate $to=<>/>\n<% else %>\n<$action-navigate $to=<>/>\n<% endif %>\n\\end\n\n!! Dynamically Detect Browser or OS Light / Dark Theme Changes\n\nAlso see: [[DarkLightChangeActions|$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions]] and [[SystemTag: $:/tags/DarkLightChangeActions|$:/plugins/wikilabs/palette-watch/docs/SystemTag: $:/tags/DarkLightChangeActions]]\n\n''Important:''\n\nIt is important to use the variable `dark-mode`, since the system info tiddler $:/info/darkmode will be ''updated after'' the actions have been executed.\n\nChanging the $:/palette tiddler dynamically ''will trigger'' the [[dirty flag|https://tiddlywiki.com/#SavingMechanism]]. If you want to avoid this behaviour, you will need to add `-[[$:/palette]]` to the the $:/config/SaverFilter as described at [[SavingMechanism|https://tiddlywiki.com/#SavingMechanism]]\n\nThe following example dynamically defines the $:/palette tiddler based on the browser or OS dark / light mode setting. Palettes are tagged: <> -- The tag-pill dropdown can be used to see all possible palette tiddlers.\n\nCurrently the following tiddlers are tagged <>:\n\n<>\n\n<$button actions=<> >Create <> example tiddler\n\n```\ntitle: _/dynamic/light-dark/detection\ncaption: {{$:/language/ControlPanel/Palette/Config/Detection/Caption}}\ncode-body: yes\ntags: $:/tags/DarkLightChangeActions\n```\n\n
<$transclude $variable=\"dynamicLightDarkActionTemplate\" $mode=block $output=\"text/plain\" $type=\"text/plain\" />
\n"},"$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-status":{"title":"$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-status","text":"Currently the following tiddlers are tagged ~$:/tags/DarkLightChangeActions:\n\n<>\n\nCurrently the following tiddlers are tagged ~$:/tags/StartupAction/Browser:\n\n<>"},"$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions":{"title":"$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions","tags":"Features","text":"!! Palette Modes Detection\n\n''Important:''\n\nBe aware that the browser setting can be independent from the OS setting.
\nIf the browser settings are set to \"System theme - auto\" for ~FireFox or \"System default\" for Chrome-like browsers, the OS setting will be shown.\n\n* Actions tagged <> are executed when the wiki is started. More info can be found at StartupActions and examples here.\n* Actions tagged <> are executed whenever the browser or OS dark / light setting is changed.\n\n!!! Variable\n\nThe following variable is defined for actions tagged: `$:/tags/DarkLightChangeActions`\n\n| Variables | Description |h\n|`dark-mode` |`yes` or `no` depending on the browser or OS setting |\n\n!!! Examples\n\nExamples, how to handle dark / light events can be found at: [[DarkLightChangeActions (Examples)|$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-examples]]\n\n{{$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-status}}\n"},"$:/plugins/wikilabs/palette-watch/docs/SystemTag: $:/tags/DarkLightChangeActions":{"title":"$:/plugins/wikilabs/palette-watch/docs/SystemTag: $:/tags/DarkLightChangeActions","caption":"$:/tags/DarkLightChangeActions","description":"marks actions executed on dark / light mode changes","tags":"SystemTags","text":"The [[system tag|SystemTags]] `$:/tags/DarkLightChangeActions` marks actions executed on dark / light mode changes. \n\n* [[DarkLightChangeActions]]\n* $:/info/darkmode\n"},"$:/plugins/wikilabs/palette-watch/history":{"title":"$:/plugins/wikilabs/palette-watch/history","text":"V 0.9.0 - 2025-08-25\n\n* Release as library pluguin \n* initial release\n"},"$:/plugins/wikilabs/palette-watch/icon":{"title":"$:/plugins/wikilabs/palette-watch/icon","text":""},"$:/plugins/wikilabs/palette-watch/license":{"title":"$:/plugins/wikilabs/palette-watch/license","license-text":"https://opensource.org/license/BSD-3-clause/","text":"[[Palette Watch Plugin|https://wikilabs.github.io/#palette-watch]] (c) Mario Pietsch - 2023-2024\n\n[[The 3-Clause BSD License|https://opensource.org/license/BSD-3-clause/]]\n"},"$:/plugins/wikilabs/palette-watch/readme":{"title":"$:/plugins/wikilabs/palette-watch/readme","caption":"Palette Watch","tags":"$:/tags/ControlPanel/WikiLabs","text":"This plugin \"Palette Watch\" adds the ''ControlPanel -> Settings -> WikiLabs -> Palette Watch'' tab\n\n----\n\n{{$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions}}\n\n----\n\n{{$:/plugins/wikilabs/palette-watch/docs/DarkLightChangeActions-examples}}\n\n----\n\n!! Important\n\nThis plugin modifies the following core modules and / or templates\n\n
    <$list filter=\"[[$:/plugins/wikilabs/palette-watch]plugintiddlers[]prefix[$:/core/]]\" emptyMessage=\"none\">
  • <$link to=<>><>
\n"},"$:/ControlPanel/Settings/WikiLabs":{"title":"$:/ControlPanel/Settings/WikiLabs","caption":"WikiLabs","tags":"$:/tags/ControlPanel/SettingsTab","text":"Get an overview about all [[WikiLab Pugins|https://wikilabs.github.io]]\n\n
\n<$macrocall $name=\"tabs\" \n tabsList=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/WikiLabs]!has[draft.of]]\"\n default=\"$:/plugins/wikilabs/palette-watch/readme\"\n explicitState=\"$:/state/tab/settings/wikilabs\"\n/>\n
"},"$:/plugins/wikilabs/palette-watch/dark-light-change.js":{"title":"$:/plugins/wikilabs/palette-watch/dark-light-change.js","text":"/*\\\ntitle: $:/plugins/wikilabs/palette-watch/dark-light-change.js\ntype: application/javascript\nmodule-type: info\n\nCheck for OS of Browser dark / light \"(prefers-color-scheme: dark)\" info\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.getInfoTiddlerFields = function(updateInfoTiddlersCallback) {\n\tvar infoTiddlerFields = [];\n\tif($tw.browser) {\n \t\t// Dark mode through event listener on MediaQueryList\n\t\tvar mqList = window.matchMedia(\"(prefers-color-scheme: dark)\");\n\t\tmqList.addEventListener(\"change\", function(event){\n\t\t\t// activate all actions tagged $:/tags/DarkLightChangeActions\n\t\t\t$tw.rootWidget.invokeActionsByTag(\"$:/tags/DarkLightChangeActions\",event,{\"dark-mode\":mqList.matches ? \"yes\" : \"no\"});\n\t\t});\n\t}\n\treturn infoTiddlerFields;\n};\n\n})();\n\n","type":"application/javascript","module-type":"info"}}} -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_copy-on-select.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "LinOnetwo", 4 | "core-version": ">=5.1.22", 5 | "dependents": "", 6 | "description": "Copy what you are selecting inside the wiki into the clipboard when holding mouse for 1 second", 7 | "list": "readme settings", 8 | "plugin-type": "plugin", 9 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/copy-on-select/config\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/config\",\"tags\":\"$:/tags/ControlPanel/SettingsTab\",\"caption\":\"<>\",\"text\":\"\\\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\\n\\n<>\\n\\n---\\n\\n;<>\\n:<$checkbox tiddler=\\\"$:/plugins/linonetwo/copy-on-select/configs/ShowNotificationOnCopy\\\" field=\\\"text\\\" checked=\\\"yes\\\" unchecked=\\\"\\\"> <$link to=\\\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\\\"><>\\n;<>\\n:<$edit-text tiddler=\\\"$:/plugins/linonetwo/copy-on-select/configs/CopyTimeout\\\" tabindex=-1 focus=false cancelPopups=\\\"yes\\\" fileDrop=no tag=\\\"input\\\" /> <$link to=\\\"$:/config/linonetwo/copy-on-select/CopyTimeout\\\"><>\\n\"},\"$:/config/linonetwo/copy-on-select/CopyTimeout\":{\"title\":\"$:/config/linonetwo/copy-on-select/CopyTimeout\",\"text\":\"0.6\"},\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\":{\"title\":\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\",\"text\":\"yes\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Readme\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Readme\",\"text\":\"\\\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\\n\\n<>\\n\\n!! Motivation\\n\\nI've gotten used to using the handy [[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox plugin, but now in TiddlyWiki I often still think I've copied it when I select it, and then I found out that I hadn't copied it until I pasted it somewhere else, which was very uncomfortable.\\n\\nSo I rewrote my own copy-on-selection script for TiddlyWiki.\\n\\n!! Usage\\n\\nSelect any text outside the editor, buttons, etc., and hold the mouse down for a second to copy the selected content.\\n\\nThe conditional statement in this plugin makes it not work in special areas like the editor, so as not to interfere with operations like \\\"select all and paste overwrite\\\".\\n\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Name\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Name\",\"text\":\"Copy on Select\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Description\",\"text\":\"Copy what you are selecting inside the wiki into the clipboard when holding mouse for 1 second\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/Description\",\"text\":\"These settings let you customise the behaviour of Copy on Select plugin.\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Caption\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Caption\",\"text\":\"Show Notification\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/ShowNotification/Description\",\"text\":\"Show Notification On Copy\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout\",\"text\":\"Copy Timeout\"},\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/en-GB/Configs/CopyTimeout/Description\",\"text\":\"When mouse hold and stop moving for how many second, starts copy.\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Readme\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Readme\",\"text\":\"\\\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\\n\\n<>\\n\\n!! 动机\\n\\n我已经习惯了用方便的[[Copy On Select|https://addons.mozilla.org/en-US/firefox/addon/copy-on-select]] Firefox 插件,现在到了 TiddlyWiki 里我经常还是以为选中了就复制了,然后黏贴到别的地方才发现其实并没有复制,很不习惯。\\n\\n所以我自己重新写了一个适配 TiddlyWiki 的选中即复制脚本。\\n\\n!! 用法\\n\\n选中编辑器、按钮等区域以外的任何文本,并保持按住鼠标一秒,就复制选中的内容。\\n\\n这个插件里的条件语句让它在编辑器等特殊区域内不会起作用,以免干扰「全选黏贴覆盖原有内容」等操作。\\n\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Name\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Name\",\"text\":\"选中就复制\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Description\",\"text\":\"按住鼠标 1 秒钟,将 Wiki 中选择的内容复制到剪贴板中。\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/Description\",\"text\":\"通过这些设置,您可以自定义「选中就复制」插件的行为。\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Caption\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Caption\",\"text\":\"显示通知\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/ShowNotification/Description\",\"text\":\"复制成功时弹消息\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout\",\"text\":\"复制超时\"},\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout/Description\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/language/zh-Hans/Configs/CopyTimeout/Description\",\"text\":\"当鼠标按住并停止移动多少秒后,开始复制。\"},\"$:/plugins/linonetwo/copy-on-select/readme\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/readme\",\"created\":\"20200414135748497\",\"modified\":\"20200602062349232\",\"creator\":\"LinOnetwo\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"\\\\define lingo-base() $:/plugins/linonetwo/copy-on-select/language/\\n\\n<>\"},\"$:/plugins/linonetwo/copy-on-select/tree\":{\"title\":\"$:/plugins/linonetwo/copy-on-select/tree\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"<>\"},\"$:/plugins/linonetwo/copy-on-select/copy-on-select.js\":{\"creator\":\"LinOnetwo\",\"title\":\"$:/plugins/linonetwo/copy-on-select/copy-on-select.js\",\"type\":\"application/javascript\",\"module-type\":\"startup\",\"Modern.TiddlyDev#Origin\":\"copy-on-select.ts\",\"text\":\"\\\"use strict\\\";exports.name=\\\"copy-on-select\\\",exports.platforms=[\\\"browser\\\"],exports.after=[\\\"story\\\"],exports.synchronous=!0,exports.startup=function(){function t(e){var t,o,n;return!(!e||!e.nodeName||!((t=[\\\"INPUT\\\",\\\"TEXTAREA\\\",\\\"BUTTON\\\"].includes(e.nodeName))||e.className&&e.className.toLowerCase))&&(o=e.className.toLowerCase().includes(\\\"codemirror\\\"),n=e.dataset.slateEditor||e.dataset.slateNode||e.dataset.slateLeaf||e.dataset.slateString,t||o||n)}let o=!1,n=!0,s=.6,i=!0;let e=0;const r=e=>{let t=document.getSelection().toString();(t=t.endsWith(\\\"\\\\n\\\")?t.substring(0,t.length-1):t)&&(e.preventDefault(),e.clipboardData.setData(\\\"text/plain\\\",t),console.log(\\\"showNotification\\\",i),i)&&($tw.wiki.addTiddler({title:\\\"$:/state/notification/copy-on-select\\\",text:\\\"Copy\\\\n\\\\n\\\".concat(t)}),$tw.notifier.display(\\\"$:/state/notification/copy-on-select\\\"))},a=()=>{var e=document.querySelectorAll(\\\":hover\\\");n||o||!(null!=e&&e.length)||Array.from(e).some(t)||(document.addEventListener(\\\"copy\\\",r),document.execCommand(\\\"copy\\\"),document.removeEventListener(\\\"copy\\\",r))};function c(){clearTimeout(e),e=setTimeout(a,1e3*s)}document.addEventListener(\\\"mousedown\\\",()=>{var e=document.querySelectorAll(\\\":hover\\\");null==e||!e.length||Array.from(e).some(t)?o=!0:(o=!1,n=!1,s=Number($tw.wiki.getTiddlerText(\\\"$:/config/linonetwo/copy-on-select/CopyTimeout\\\",\\\"1\\\"))||.6,isFinite(s)||(s=.6),i=\\\"yes\\\"===$tw.wiki.getTiddlerText(\\\"$:/config/linonetwo/copy-on-select/ShowNotificationOnCopy\\\"),document.addEventListener(\\\"mousemove\\\",c))}),document.addEventListener(\\\"mouseup\\\",()=>{n=!0,o=!1,clearTimeout(e),document.removeEventListener(\\\"mousemove\\\",c)})};\"}}}", 10 | "title": "$:/plugins/linonetwo/copy-on-select", 11 | "type": "application/json", 12 | "version": "2.0.0", 13 | "Modern.TiddlyDev#SHA256-Hashed": "c3bd404a1fa9077f3df9ebe582dacd8a271151effd85edc89760bc8cef72a28a", 14 | "name": "copy-on-select" 15 | } 16 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_telmiger_PluginSize.json: -------------------------------------------------------------------------------- 1 | {"tiddlers": { 2 | "$:/plugins/telmiger/PluginSize/about": { 3 | "created": "20200524224655528", 4 | "text": "This plugin calculates the size of installed plugins, themes and languages. It adds a tab //Plugin Info// to the [[$:/ControlPanel]] – the one with the {{$:/core/images/info-button}} icon.", 5 | "modified": "20231220191500561", 6 | "title": "$:/plugins/telmiger/PluginSize/about", 7 | "tags": "" 8 | }, 9 | 10 | "$:/plugins/telmiger/PluginSize/history": { 11 | "created": "20231227141710403", 12 | "text": "!! History\n\n* ''1.0.1'' -- 2023-12-31 -- feature update\n** No plugin dependencies anymore: \n*** //rpn// is no longer needed.\n*** //Harvey Balls// is an option now.\n** MIT license\n\n* ''0.0.9'' -- 2019-03-10 -- initial release\n", 13 | "creator": "Thomas Elmiger", 14 | "title": "$:/plugins/telmiger/PluginSize/history", 15 | "tags": "", 16 | "modifier": "Thomas Elmiger", 17 | "modified": "20231231003218100" 18 | }, 19 | 20 | "$:/plugins/telmiger/PluginSize/icon": { 21 | "created": "20190127213417005", 22 | "text": "{{$:/language/HarveyBalls/complex/title}}{{$:/language/HarveyBalls/complex/desc}}", 23 | "creator": "Thomas Elmiger", 24 | "title": "$:/plugins/telmiger/PluginSize/icon", 25 | "tags": "", 26 | "modified": "20231227135655440", 27 | "modifier": "Thomas Elmiger" 28 | }, 29 | 30 | "$:/plugins/telmiger/PluginSize/license": { 31 | "created": "20231227142815449", 32 | "text": "`Plugin Size is published under the MIT License.`\n\n!!! Plugin Size\nThe content of $:/plugins/telmiger/PluginSize is
\nCopyright (c), Thomas Elmiger, https://thomas-elmiger.ch\n\n!!! The MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 33 | "title": "$:/plugins/telmiger/PluginSize/license", 34 | "tags": "", 35 | "modifier": "Thomas Elmiger", 36 | "modified": "20231227143028338", 37 | "creator": "Thomas Elmiger" 38 | }, 39 | 40 | "$:/plugins/telmiger/PluginSize/plugin-info": { 41 | "created": "20190308213013859", 42 | "text": "\\define lingo-base() $:/language/ControlPanel/Plugins/\n\n\\define plugin-table(type)\n<$set name=\"plugin-type\" value=\"\"\"$type$\"\"\">\n<$set name=\"qualified-state\" value=<>>\n<$list filter=\"[!has[draft.of]plugin-type[$type$]sort[description]]\" emptyMessage=<> >\n
\n{{||$:/core/ui/Components/plugin-info}}\n
\n{{||$:/plugins/telmiger/PluginSize/template}}\n\n\n\n\\end\n\n<>\n\n<>\n", 43 | "creator": "Thomas Elmiger", 44 | "title": "$:/plugins/telmiger/PluginSize/plugin-info", 45 | "tags": "$:/tags/ControlPanel", 46 | "modifier": "Thomas Elmiger", 47 | "modified": "20231220191715377", 48 | "caption": "{{$:/core/images/info-button}} Plugin Info", 49 | "list-after": "$:/core/ui/ControlPanel/Plugins" 50 | }, 51 | 52 | "$:/plugins/telmiger/PluginSize/readme": { 53 | "created": "20190127210600496", 54 | "text": "!! Plugin Size\n\n{{$:/plugins/telmiger/PluginSize/about}}\n\nThe same information can be found on [[$:/plugins/telmiger/PluginSize/plugin-info]].\n\n!!! Categories (character count)\n\n* <> up to 25 k\n* <> up to 50 k\n* <> up to 100 k\n* <> up to 500 k \n* <> more than 500 k\n\n!!! Optional graphics\n\nSize indicating icons are shown if my other plugin [[Harvey Balls|https://tid.li/tw5/plugins.html#%24%3A%2Fplugins%2Ftelmiger%2FHarveyBalls]] is installed.\n\n{{$:/plugins/telmiger/PluginSize/history}}", 55 | "creator": "Thomas Elmiger", 56 | "title": "$:/plugins/telmiger/PluginSize/readme", 57 | "tags": "", 58 | "modifier": "Thomas Elmiger", 59 | "modified": "20231227143703867" 60 | }, 61 | 62 | "$:/plugins/telmiger/PluginSize/styles.css": { 63 | "created": "20190122231405826", 64 | "text": ".tiddler-size-indicator {\n width: 100%;\n background-color: rgba(125,125,125,0.3);\n padding: 0.25rem;\n margin-bottom: 1rem;\n}\n.te-info-panel .tc-plugin-info {\n margin-bottom: 0;\n}\n.te-info-panel .tc-plugin-info-dropdown {\n margin-top: -1px;\n}", 65 | "creator": "Thomas Elmiger", 66 | "title": "$:/plugins/telmiger/PluginSize/styles.css", 67 | "tags": "$:/tags/Stylesheet", 68 | "modifier": "Thomas Elmiger", 69 | "modified": "20231220191841965" 70 | }, 71 | 72 | "$:/plugins/telmiger/PluginSize/support": { 73 | "created": "20200524225402217", 74 | "text": "{{$:/plugins/telmiger/support}}", 75 | "title": "$:/plugins/telmiger/PluginSize/support", 76 | "tags": "", 77 | "modified": "20231220192112089" 78 | }, 79 | 80 | "$:/plugins/telmiger/PluginSize/template": { 81 | "created": "20190122222437252", 82 | "text": "
\n<$let \nsize={{{ [get[text]length[]] }}} \niconS={{{ [compare:number:gt[25000]then[obvious]else[simple]] }}}\niconM={{{ [compare:number:gt[50000]then[complicated]else] }}}\niconL={{{ [compare:number:gt[100000]then[complex]else] }}}\nicon={{{ [compare:number:gt[500000]then[chaotic]else] }}}\nsizek={{{ [divide[1000]fixed[1]] }}}\n>\n<$let\ncommentS={{{ [match[obvious]then[small]else[tiny]] }}}\ncommentM={{{ [match[complicated]then[medium]else] }}}\ncommentL={{{ [match[complex]then[big]else] }}}\ncomment={{{ [match[chaotic]then[gigantic]else] }}}\n>\n<$transclude $variable=\"HarveyBall\" variant=<> title=<>/> – plugin size: <> k characters (<>)\n\n\n
", 83 | "title": "$:/plugins/telmiger/PluginSize/template", 84 | "modifier": "Thomas Elmiger", 85 | "modified": "20231231002534001", 86 | "list-after": "$:/core/ui/ViewTemplate/plugin", 87 | "creator": "Thomas Elmiger" 88 | }, 89 | 90 | "$:/plugins/telmiger/PluginSize/ViewTemplate": { 91 | "created": "20190122065955189", 92 | "text": "<$list filter=\"[all[current]has[plugin-type]] -[all[current]field:plugin-type[import]]\">\n{{||$:/plugins/telmiger/PluginSize/template}}\n", 93 | "title": "$:/plugins/telmiger/PluginSize/ViewTemplate", 94 | "tags": "$:/tags/ViewTemplate", 95 | "modifier": "Thomas Elmiger", 96 | "modified": "20231220192028833", 97 | "list-after": "$:/core/ui/ViewTemplate/plugin", 98 | "creator": "Thomas Elmiger" 99 | }, 100 | 101 | "$:/plugins/telmiger/support": { 102 | "created": "20181103150753927", 103 | "text": "!! Support the Author\n\n''Hi!'' I’m Thomas, the author of [[tid.li/tw5/plugins.html|https://tid.li/tw5/plugins.html]]. Feedback is always welcome, as well as funding for maintenance, support and new projects :)\n\n---\n\n!!! One Time Support\n\nIf using my plugins just makes you happy, consider a one time payment via ~PayPal to reward the effort:\n\nhttps://www.paypal.me/telmiger\n\n---\n\n!!! Permanent Support\n\nIf my tools make you more productive or save you time in your job or your everyday life, you can support me as a Patron: \n\nhttps://www.patreon.com/telmiger\n\n---\n\n!!! Thank You\n\nSubstantial parts of my availabe time go to the deveopment of useful plugins for [[TiddlyWiki|https://tiddlywiki.com/]]. – Many others do the same and I would like to thank them all, especially [[Jeremy Ruston|https://tiddlywiki.com/#JeremyRuston]] and all the active members of the community!\n\n//Hereby I promise to share future revenues (if any) with other developers who’s works I use or who inspired me.//\n\nIf you like my work, I would be very happy to hear from you.\n\n''Thank you very much for your support!''
\n//Thomas//\n\nhttps://thomas-elmiger.ch", 104 | "title": "$:/plugins/telmiger/support", 105 | "tags": "", 106 | "modifier": "Thomas Elmiger", 107 | "modified": "20231229230608237", 108 | "creator": "Thomas Elmiger" 109 | }} 110 | } -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_wikilabs_edit-tabs.json: -------------------------------------------------------------------------------- 1 | {"tiddlers":{"$:/core/macros/tabs":{"title":"$:/core/macros/tabs","tags":"$:/tags/Macro","text":"\\define link-action()\n<$action-sendmessage $message=\"$(message)$\" $param=<> navigateTo=<>/>\n\\end\n\\define tabs(tabsList,default,state:\"$:/state/tab\",class,template,buttonTemplate,retain,actions,explicitState)\n<$set name=\"qualifiedState\" value=<>>\n<$set name=\"tabsState\" filter=\"[<__explicitState__>minlength[1]] ~[]\">\n
\n
\n<$list filter=\"$tabsList$\" variable=\"currentTab\" storyview=\"pop\"><$set name=\"save-currentTiddler\" value=<>><$tiddler tiddler=<>><$button set=<> setTo=<> default=\"$default$\" selectedClass=\"tc-tab-selected\" tooltip={{!!tooltip}}>\n<$tiddler tiddler=<>>\n<$set name=\"tv-wikilinks\" value=\"no\">\n<$transclude tiddler=\"\"\"$buttonTemplate$\"\"\" mode=\"inline\">\n<$transclude tiddler=<> field=\"caption\">\n<$macrocall $name=\"currentTab\" $type=\"text/plain\" $output=\"text/plain\"/>\n\n\n$actions$<$set name=message value={{$:/plugins/wikilabs/edit-tabs/config!!link-action}}>\n<$list filter=\"[]+[!is[shadow]]\" emptyMessage=\"\"\"<$button tag=span class=\"wltc-edit-tab\" to=<> >{{$:/core/images/link}}\"\"\" ><$button tag=span class=\"wltc-edit-tab\" actions=<> ><$reveal type=match text=\"tm-navigate\" state=\"$:/plugins/wikilabs/edit-tabs/config!!link-action\">{{$:/core/images/link}}<$reveal type=match text=\"tm-edit-tiddler\" state=\"$:/plugins/wikilabs/edit-tabs/config!!link-action\">{{$:/core/images/edit-button}}\n
\n
\n
\n<$list filter=\"$tabsList$\" variable=\"currentTab\">\n\n<$reveal type=\"match\" state=<> text=<> default=\"$default$\" retain=\"\"\"$retain$\"\"\">\n\n<$transclude tiddler=\"\"\"$template$\"\"\" mode=\"block\">\n\n<$transclude tiddler=<> mode=\"block\"/>\n\n\n\n\n\n\n
\n
\n\n\n\\end\n"},"$:/core/ui/ControlPanel/Settings/edit-tabs":{"title":"$:/core/ui/ControlPanel/Settings/edit-tabs","caption":"Edit Tabs","tags":"$:/tags/ControlPanel/WikiLabs","text":"The full documentation can be found at [[edit-tabs plugin|https://wikilabs.github.io/editions/edit-tabs/]] main page.\n\n<$checkbox tiddler=\"$:/plugins/wikilabs/edit-tabs/config\" field=\"show-all-links\" checked=\"inline\" unchecked=\"none\" default=\"none\"> Show internal tab link for ''all tabs''\n\n<$checkbox tiddler=\"$:/plugins/wikilabs/edit-tabs/config\" field=\"show-single-link\" checked=\"inline\" unchecked=\"none\" default=\"inline\"> Show internal tab link for ''selected tab''\n\n<$checkbox tiddler=\"$:/plugins/wikilabs/edit-tabs/config\" field=\"link-action\" checked=\"tm-edit-tiddler\" unchecked=\"tm-navigate\" default=\"tm-edit-tiddler\"> Clicking a tab-link opens non-system tiddlers in ''edit mode''\n\n<$checkbox tiddler=\"$:/plugins/wikilabs/edit-tabs/config\" field=\"initial-opacity\" checked=\"0\" unchecked=\"0.7\" default=\"0.7\"> Tab links are initially hidden and need mouse hover to become visible. The transition time in seconds is: <$edit-text tiddler=\"$:/plugins/wikilabs/edit-tabs/config\" field=\"transition\" default=\"0.3\"/>\n\n<$button message=\"tm-delete-tiddler\" param=\"$:/plugins/wikilabs/edit-tabs/config\">\nReset to Default!"},"$:/plugins/wikilabs/edit-tabs/config":{"title":"$:/plugins/wikilabs/edit-tabs/config","show-all-links":"none","show-single-link":"inline","link-action":"tm-edit-tiddler","initial-opacity":"0.7","transition":"0.3","text":"This tiddler is used to configure the \"Edit-tabs\" plugin behaviour. \n\nThere are 4 fields, which are used by [[$:/plugins/wikilabs/edit-tabs/styles]] enable and disable the internal links. \n\n* show-all-links: {{!!show-all-links}}\n* show-single-link: {{!!show-single-link}}\n* initial-opacity: {{!!initial-opacity}}\n* transition time in seconds: {{!!transition}}\n\nThe next field is used to define the behaviour of the link, if it's clicked.\n\n* link-action: {{!!link-action}}\n"},"$:/plugins/wikilabs/edit-tabs/styles":{"title":"$:/plugins/wikilabs/edit-tabs/styles","tags":"$:/tags/Stylesheet","text":"
\n\n.wltc-edit-tab {\n  display: {{$:/plugins/wikilabs/edit-tabs/config!!show-all-links}};\n  position: relative;\n  top: -1em;\n  left: -1.3em;\n  font-size: 0.7em;\n  opacity: {{$:/plugins/wikilabs/edit-tabs/config!!initial-opacity}};\n  margin-right: -1em;\n}\n\n.wltc-edit-tab svg{\n  width: 1.4em;\n  height: 1.4em;\n}\n\n.wltc-edit-tab:hover {\n  opacity: 1;\n  transition:opacity {{$:/plugins/wikilabs/edit-tabs/config!!transition}}s;\n  transition-timing-function: cubic-bezier(1,-0.06,.39,.89);\n}\n\n.tc-tab-selected + .wltc-edit-tab {\n  display: {{$:/plugins/wikilabs/edit-tabs/config!!show-single-link}};\n}\n\n.tc-vertical > .wltc-edit-tab {\n  top: -1.9em;\n  left: 0;\n  height: 0;\n  float: right;\n}\n\n.tc-search-results .wltc-edit-tab a {\n  display: contents;\n  padding: 0;\n}\n\n
"},"$:/plugins/wikilabs/edit-tabs/fix-sendmessage.js":{"title":"$:/plugins/wikilabs/edit-tabs/fix-sendmessage.js","text":"/*\\\ntitle: $:/plugins/wikilabs/edit-tabs/fix-sendmessage.js\ntype: application/javascript\nmodule-type: startup\n\nA startup module to fix the <$action-sendmessage widget parameter passing problem\n\neg:\n\nNavigatorWidget.prototype.handleNavigateEvent = function(event) {\n\tevent = $tw.hooks.invokeHook(\"th-navigating\",event);\n\tif(event.navigateTo) { <--- expects event.navigateTo, but sendmessage widget gives event.params.navigateTo\n\t\tthis.addToStory(event.navigateTo,event.navigateFromTitle);\n\t\tif(!event.navigateSuppressNavigation) {\n\t\t\tthis.addToHistory(event.navigateTo,event.navigateFromClientRect);\n\t\t}\n\t}\n\treturn false;\n};\n\n\nThis hook temporarily fixes the problem.\n\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"fixsendmessage\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t$tw.hooks.addHook(\"th-navigating\",function(event) {\n\t\tvar suppressNavigation = (event.event) ? event.event.metaKey || event.event.ctrlKey || (event.event.button === 1) : false;\n\n\t\tif (!event.navigateTo && event.paramObject && event.paramObject.navigateTo) {\n\t\t\tevent.navigateTo = event.paramObject.navigateTo;\n\t\t\tevent.navigateSuppressNavigation = event.navigateSuppressNavigation || suppressNavigation;\n\t\t}\n\t\treturn event;\n\t});\n};\n\n})();\n","type":"application/javascript","module-type":"startup"},"$:/plugins/wikilabs/edit-tabs/history":{"title":"$:/plugins/wikilabs/edit-tabs/history","text":"V 3.0.2 - 2024-05-23\n\n* Add stability badges\n** The development status of a plugin: deprecated, experimental, stable, or legacy\n\nV 3.0.1 - 2024-04-18\n\n* Settings are now in $:/ControlPanel -> ''Settings'' -> ''WikiLabs'' tab\n\nV 3.0.0 - 2023-12-28\n\n* Deprecated -> Use: https://wikilabs.github.io/editions/link-to-tabs/ instead\n\nV 3.0.0 - 2020-03-27\n\n* Update edition to TW v5.2.2\n* ''Important'': Changed license to Attribution-NonCommercial-ShareAlike -- [[CC-BY-NC-SA|$:/plugins/wikilabs/edit-tabs/license]]\n\n\nV 2.0.1 - 2020-12-25\n\n* update license\n\nV 2.0.0 - 2020.12.05\n\n* Update $:/core/macros/tabs to V5.1.23\n\nV 1.1.1 - 2020.01.19\n\n* Update license link/text\n\nV 1.1.0 - 2019-08\n\n* Change minimum core version to `>=5.1.15`\n\nV1.0.0 - 2019-07-14\n\n* Add new option: Initially hide link\n** Transition time from hidden to visible is adjustable\n* Added: \"Reset to Default\" button\n* Show Edit Button if edit mode is active\n\nThis version has feature parity with link-to-tabs plugin from same date!\n\nV0.2.0 - 2019-01-17\n\n* remove the experimental flag\n\nV0.2.0-experimental - 2018-02-13\n\n* initial release\n* forked from link-to-tabs V0.1.1\n* add new \"auto-edit\" configuration for tab-links\n* auto-edit is only active for non-shadow tiddlers `[!is[shadow]]`\n* contains a temporary fix for a <$action-sendmessage widget parameter passing problem\n** This fix should be deactivated in the future.\n\nalso see: https://wikilabs.github.io/editions/edit-tabs/#History\nalso see: https://wikilabs.github.io/editions/link-to-tabs/#History\n"},"$:/plugins/wikilabs/edit-tabs/icon":{"title":"$:/plugins/wikilabs/edit-tabs/icon","text":"\n\n"},"$:/plugins/wikilabs/edit-tabs/license":{"title":"$:/plugins/wikilabs/edit-tabs/license","license-text":"https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode","text":"[[Edit-Tabs-Macro|https://wikilabs.github.io/#edit-tabs]] (c) Mario Pietsch - 2018-2024\n\n[[Creative Commons Attribution-NonCommercial-ShareAlike|https://creativecommons.org/licenses/by-nc-sa/4.0/]]\n"},"$:/plugins/wikilabs/edit-tabs/readme":{"title":"$:/plugins/wikilabs/edit-tabs/readme","text":"This plugin adds a little link icon to every tab.\n\n''Important:'' This plugin changes the core tabs macro.\n\n! Link-to-Tabs Settings\n\n{{$:/core/ui/ControlPanel/Settings/edit-tabs}}"},"$:/ControlPanel/Settings/WikiLabs":{"title":"$:/ControlPanel/Settings/WikiLabs","caption":"WikiLabs","tags":"$:/tags/ControlPanel/SettingsTab","text":"Get an overview about all [[WikiLab Pugins|https://wikilabs.github.io]] \n\n
\n<$macrocall $name=\"tabs\" \n tabsList=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/WikiLabs]!has[draft.of]]\"\n default=\"$:/core/ui/ControlPanel/Settings/edit-tabs\"\n explicitState=\"$:/state/tab/settings/wikilabs\"\n/>\n
"}}} -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_simple-layout-launcher.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "linonetwo", 4 | "dependents": "", 5 | "description": "Vanilla style launcher, with Metro style square button and large icon.", 6 | "list": "readme tree", 7 | "name": "Simple Layout Launcher", 8 | "plugin-type": "plugin", 9 | "stability": "STABILITY_2_STABLE", 10 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/Readme\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/simple-layout-launcher/language/\\n\\n! <>\\n\\n<>\\n\\n!! Procedure\\n\\nThis plugin provides a simple layout switcher which can be used with this procedure call:\\n\\n```tid\\n<>\\n```\\n\\n<>\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/Name\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/Name\",\"text\":\"Simple Layout Launcher\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/ShortName\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/ShortName\",\"text\":\"SLL\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/Description\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/en-GB/Description\",\"text\":\"Vanilla style layout launcher, with Metro style square button and large icon.\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/Readme\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/simple-layout-launcher/language/\\n\\n! <>\\n\\n<>\\n\\n!! 过程\\n\\n本插件提供了一个简单的布局切换器,它可以通过这个过程调用来使用:\\n\\n```tid\\n<>\\n```\\n\\n<>\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/Name\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/Name\",\"text\":\"简易布局启动器\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/ShortName\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/ShortName\",\"text\":\"简布局\"},\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/Description\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/language/zh-Hans/Description\",\"text\":\"原生风格的布局启动器,带有地铁风格的方形按钮和大图标。\"},\"$:/snippets/LayoutSwitcher\":{\"title\":\"$:/snippets/LayoutSwitcher\",\"tags\":\"$:/tags/ControlPanel/Appearance\",\"caption\":\"{{$:/language/ControlPanel/LayoutSwitcher/Caption}}\",\"text\":\"<>\"},\"$:/plugins/linonetwo/simple-layout-launcher/readme\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/readme\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/simple-layout-launcher/language/\\n\\n<>\\n\"},\"$:/plugins/linonetwo/simple-layout-launcher/sidebar\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/sidebar\",\"tags\":\"$:/tags/SideBar\",\"caption\":\"<>\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/simple-layout-launcher/language/\\n\\n!! <>\\n\\n
\\n <>\\n
\"},\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher-layout-image\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher-layout-image\",\"tags\":\"$:/tags/Image\",\"text\":\"\\\\parameters (size:\\\"22pt\\\")\\n> height=<> class=\\\"tc-image-linonetwo-simple-layout tc-image-button\\\" viewBox=\\\"0 0 24 24\\\">\\n \\n \\n\"},\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher-layout\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher-layout\",\"name\":\"<>\",\"icon\":\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher-layout-image\",\"description\":\"<>\",\"tags\":\"$:/tags/Layout\",\"text\":\"\\\\whitespace trim\\n\\\\import [subfilter{$:/core/config/GlobalImportFilter}]\\n\\\\define containerClasses()\\ntc-page-container tc-language-$(languageTitle)$ simple-layout-launcher-container\\n\\\\end\\n\\\\procedure redirected-navigate-actions()\\n <$action-setfield $tiddler=\\\"$:/layout\\\" text=\\\"\\\" $timestamp=\\\"no\\\" />\\n <$action-navigate $to=<> $scroll=\\\"yes\\\" />\\n\\\\end\\n\\n<$navigator story=\\\"$:/StoryList\\\" history=\\\"$:/HistoryList\\\" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}>\\n\\t<$messagecatcher $tm-navigate=<>>\\n\\t\\t{{$:/core/ui/CommandPaletteTemplate}}\\n\\t\\t
>>\\n\\t\\t\\t
\\n\\t\\t\\t\\t<>\\n\\t\\t\\t
\\n\\t\\t
\\n\\t\\n\\n\"},\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher.css\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher.css\",\"text\":\".simple-layout-launcher-layout-container{width:100%;height:100%}.linonetwo-simple-layout-launcher{display:flex;flex-direction:row;width:100%;flex-wrap:wrap}.linonetwo-simple-layout-launcher-item{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;height:150px;aspect-ratio:1;padding:5px;margin:5px}@media (max-width:450px){.tc-modal-body:has(.linonetwo-simple-layout-launcher){padding:0}.linonetwo-simple-layout-launcher-item{height:100px}}@media (max-width:275px){.linonetwo-simple-layout-launcher-item{height:80px}}.linonetwo-simple-layout-launcher-title{display:flex;flex-direction:row;justify-content:center;align-items:center;width:100%;font-size:1.2em;height:2.4em}.linonetwo-simple-layout-launcher-icon{width:70%;aspect-ratio:1}.linonetwo-simple-layout-launcher-icon svg{width:100%;height:100%}.linonetwo-simple-layout-launcher-description{visibility:hidden;opacity:0;position:absolute;top:0;left:0;width:150px;transition:visibility,opacity .3s linear}.linonetwo-simple-layout-launcher-item:hover .linonetwo-simple-layout-launcher-description{visibility:visible;opacity:1}.linonetwo-simple-layout-launcher-item a{text-decoration:none}\",\"tags\":\"$:/tags/Stylesheet\",\"type\":\"text/css\"},\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher.css.variable\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher.css.variable\",\"tags\":\"$:/tags/Stylesheet\",\"text\":\"\\\\import [[$:/themes/tiddlywiki/vanilla/base]]\\n\\n.linonetwo-simple-layout-launcher-item:hover .linonetwo-simple-layout-launcher-description {\\n\\tbackground: <>;\\n}\\n\\n/** Desktop, center it and add padding */\\n@media (min-width: <>) {\\n\\t.linonetwo-simple-layout-launcher-layout-container {\\n\\t\\tpadding: 100px;\\n\\t}\\n\\t.linonetwo-simple-layout-launcher-layout-container .linonetwo-simple-layout-launcher {\\n\\t\\tjustify-content: center;\\n\\t}\\n}\\n\\n.simple-layout-launcher-sidebar a {\\n\\tfill: <>;\\n}\\n.simple-layout-launcher-sidebar a:hover {\\n\\tfill: <>;\\n}\\n\\n/** Mobile layout switcher, model is small can't change, so make item width 100% */\\n@media (max-width: <>) {\\n\\t.tc-modal:has(.tc-modal-body):has(div):has(p):has(.linonetwo-simple-layout-launcher) {\\n\\t\\twidth: 90%;\\n\\t}\\n}\\n\"},\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/simple-layout-launcher\",\"tags\":\"$:/tags/Global\",\"text\":\"\\\\procedure on-click()\\n\\n<$action-sendmessage $message=\\\"tm-close-tiddler\\\" />\\n\\\\end\\n\\n\\\\procedure simple-layout-launcher()\\n\\t\\\\whitespace trim\\n\\t<$linkcatcher to=\\\"$:/layout\\\" actions=<> >\\n\\t\\t
\\n\\t\\t\\t<$list filter=\\\"[[$:/core/ui/PageTemplate]] [all[tiddlers+shadows]tag[$:/tags/Layout]]\\\">\\n\\t\\t\\t\\t<$set name=\\\"chosen-cls\\\" filter=\\\"[all[current]compare:eq{$:/layout}]\\\" value=\\\"linonetwo-simple-layout-launcher-item tc-chosen\\\" emptyValue=\\\"linonetwo-simple-layout-launcher-item\\\">\\n\\t\\t\\t\\t\\t<$link to={{!!title}}>\\n\\t\\t\\t\\t\\t\\t
>>\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t<$transclude tiddler={{{ [get[icon]] }}}/>\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t<$transclude field=\\\"name\\\"/>\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t<$transclude field=\\\"description\\\"/>\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t
\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t
\\n\\t\\n\\\\end\"},\"$:/plugins/linonetwo/simple-layout-launcher/tree\":{\"title\":\"$:/plugins/linonetwo/simple-layout-launcher/tree\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"<>\"}}}", 11 | "title": "$:/plugins/linonetwo/simple-layout-launcher", 12 | "type": "application/json", 13 | "version": "0.6.1", 14 | "Modern.TiddlyDev#SHA256-Hashed": "c2e2be12b053d6feed89e3bdc5ebcec159c62b72cf394b66efc33d0f30454f19" 15 | } 16 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_opened-tiddlers-bar.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "LinOnetwo", 4 | "core-version": ">=5.1.22", 5 | "dependents": "", 6 | "description": "VSCode style opened files top bar", 7 | "list": "Readme config tree", 8 | "name": "Opened Tiddlers Bar", 9 | "plugin-type": "plugin", 10 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/opened-tiddlers-bar/AboveStory\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/AboveStory\",\"tags\":\"$:/tags/AboveStory\",\"text\":\"
\\n <>\\n
\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/config\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/config\",\"tags\":\"$:/tags/ControlPanel/SettingsTab\",\"caption\":\"<>\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/opened-tiddlers-bar/language/\\n\\n<>\\n\\n---\\n\\n!! <>\\n\\n;<>\\n:<$edit-text tiddler=\\\"$:/plugins/linonetwo/opened-tiddlers-bar/configs/bar-height\\\" tag=\\\"input\\\" type=\\\"number\\\" step=\\\"1\\\" size=\\\"3\\\" class=\\\"tc-tiddler-bar-height\\\"/>px <>\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/configs/bar-height\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/configs/bar-height\",\"text\":\"30\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Readme\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/opened-tiddlers-bar/language/\\n\\n! <>\\n\\n<>\\n\\n!! Features\\n\\nUse the middle mouse button or the X button to close the tab.\\n\\nUse Shift + mouse wheel to swipe sideways to view.\\n\\n!! Credits\\n\\nThis plugin is based on [[$:/plugins/bj/storytabs|http://bjtools.tiddlyspot.com/]] , which is in MIT license, thank you, Buggyj!\\n\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Name\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Name\",\"text\":\"Opened Tiddlers Bar\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Description\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Description\",\"text\":\"Provides VSCode style \\\"Opened Tiddlers\\\" top bar\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/PluginConfigs\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/PluginConfigs\",\"text\":\"Plugin Configs\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/ConfigDescription\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/ConfigDescription\",\"text\":\"These settings let you customise the behaviour of Opened Tiddlers Bar plugin.\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Configs/BarHeight/Caption\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Configs/BarHeight/Caption\",\"text\":\"Height of the bar\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Configs/BarHeight/Description\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/en-GB/Configs/BarHeight/Description\",\"text\":\"Make the bar taller or shorter. Recommend to set it around 30px.\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Readme\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/opened-tiddlers-bar/language/\\n\\n! <>\\n\\n<>\\n\\n!! 功能\\n\\n使用中键或 X 按钮关闭标签。\\n\\n使用 Shift + 鼠标滚轮左右滑动查看。\\n\\n!! 鸣谢\\n\\n此插件基于 [[$:/plugins/bj/storytabs|http://bjtools.tiddlyspot.com/]] ,该插件采用 MIT 许可证,感谢 Buggyj!\\n\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Name\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Name\",\"text\":\"「开启的条目」栏\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Description\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Description\",\"text\":\"灵感来自 Notion 和 VSCode 的主题\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/PluginConfigs\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/PluginConfigs\",\"text\":\"插件设置\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/ConfigDescription\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/ConfigDescription\",\"text\":\"通过这些设置,您可以自定义「开启的条目栏」插件的行为。\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Configs/BarHeight/Caption\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Configs/BarHeight/Caption\",\"text\":\"栏的高度\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Configs/BarHeight/Description\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/language/zh-Hans/Configs/BarHeight/Description\",\"text\":\"使栏变高或变矮。建议将其设置在 30px 左右。\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/Readme\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/opened-tiddlers-bar/language/\\n\\n<>\\n\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/style.css\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/style.css\",\"tags\":\"$:/tags/Stylesheet\",\"text\":\"\\\\rules except horizrule dash\\n\\n/**\\n * 由于 Tiddlywiki 会把 base.tid 里的 -- 识别为分隔符,变为 - ,所以如果需要用变量,就用 \\\\rules except horizrule dash\\n */\\n\\n/** 顶部标题栏半透明,别的组件都得根据它下移 */\\nbody.tc-body {\\n --menubar-height: {{$:/plugins/linonetwo/opened-tiddlers-bar/configs/bar-height}}px;\\n}\\n\\n/** make things in $:/tags/AboveStory position fixed, so it will always on the top */\\nsection.story-backdrop .opened-tiddlers-bar-container {\\n position: fixed;\\n top: 0;\\n z-index: 1000;\\n height: var(--menubar-height);\\n width: 100vw;\\n left: 0;\\n\\n overflow-x: auto;\\n white-space: nowrap;\\n overflow: -moz-scrollbars-none;\\n scrollbar-width: none;\\n}\\n.opened-tiddlers-bar {\\n height: var(--menubar-height);\\n}\\nsection.story-backdrop .opened-tiddlers-bar-container::-webkit-scrollbar {\\n display: none;\\n}\\n\\nsection.story-backdrop div.opened-tiddlers-bar div.opened-tiddlers-bar-tabs {\\n display: flex;\\n flex-direction: row;\\n justify-content: flex-start;\\n}\\n/** make it possible to drag the app using this bar in TidGi, when TidGi's titleBar is closed */\\n<% if [[$:/state/titleBarOpened]get[text]match[no]] %>\\ndiv.opened-tiddlers-bar-tabs {\\n width: 90vw;\\n overflow-x: auto;\\n white-space: nowrap;\\n overflow: -moz-scrollbars-none;\\n scrollbar-width: none;\\n}\\ndiv.opened-tiddlers-bar-tabs::-webkit-scrollbar {\\n display: none;\\n}\\ndiv.opened-tiddlers-bar-drag-area {\\n width: 5vw;\\n -webkit-app-region: drag;\\n}\\n\\n/** when hide titlebar and hide sidebar (and on macOS, windows not tested), move bar right to avoid collision with close button on the left top of app */\\n/** move right a bit to avoid collision with close button on macOS when title bar hide */\\n<% if [[$:/state/sideBarOpened]get[text]match[no]] %>\\nsection.story-backdrop {\\n width: 100vw;\\n padding-left: 68px;\\n}\\n<% endif %>\\n<% endif %>\\n\\n/** tiddlers bar */\\nsection.story-backdrop > p > .opened-tiddlers-bar-container, section.story-backdrop > p > .opened-tiddlers-bar-container > div.tc-tab-buttons {\\n width: 100%;\\n margin: 0;\\n display: flex;\\n background: transparent;\\n}\\nsection.story-backdrop > p > .opened-tiddlers-bar-container {\\n background-color: white;\\n backdrop-filter: blur(3px);\\n background: <>;\\n}\\n\\n\\ndiv.opened-tiddlers-bar-tabs button.tc-tab {\\n height: calc(100% - 2px);\\n border-radius: 0;\\n margin: 0;\\n padding: 5px 10px;\\n padding-right: 2px;\\n}\\n/** x button */\\ndiv.opened-tiddlers-bar-tabs button.opened-tiddlers-bar-close-button {\\n border: none;\\n border-radius: 0;\\n margin: 0;\\n padding: 0 5px;\\n opacity: 0;\\n background-color: transparent;\\n}\\n/** show x when tab is hovered */\\ndiv.opened-tiddlers-bar-tabs:hover button.opened-tiddlers-bar-close-button {\\n opacity: 1;\\n}\\ndiv.opened-tiddlers-bar-tabs span.tc-eventcatcher {\\n display: inline-block;\\n height: 100%;\\n}\\nsection.story-backdrop div.opened-tiddlers-bar-tabs button.tc-tab:nth-child(2) {\\n margin-left: -1em;\\n}\\ndiv.opened-tiddlers-bar.tc-tab-buttons {\\n padding: 0;\\n margin: 0;\\n}\\n\\n/** 收起侧边栏的按钮 */\\n.tc-topbar-right {\\n top: 18px;\\n}\\n\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/tree\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/tree\",\"text\":\"<>\"},\"$:/plugins/linonetwo/opened-tiddlers-bar/ui\":{\"title\":\"$:/plugins/linonetwo/opened-tiddlers-bar/ui\",\"tags\":\"$:/tags/Global\",\"text\":\"\\\\procedure on-opened-tiddlers-bar-item-middle-click()\\n<$list filter=\\\"[match[middle]]\\\">\\n<$action-sendmessage $message=\\\"tm-close-tiddler\\\" $param=<>/>\\n\\n\\\\end\\n\\n\\\\procedure opened-tiddlers-bar()\\n\\\\whitespace trim\\n
\\n
\\n
\\n <$list filter=\\\"[list[$:/StoryList]]\\\" history=\\\"$:/HistoryList\\\" variable=\\\"currentTab\\\">\\n <$reveal type=\\\"match\\\" state=\\\"$:/HistoryList!!current-tiddler\\\" text=<>>\\n <$eventcatcher $auxclick=<>>\\n <$button to=<> class=\\\"tc-tab-selected tc-tab\\\">\\n <$view tiddler=<> field=\\\"name\\\">\\n <$view tiddler=<> field=\\\"title\\\" />\\n <$button message=\\\"tm-close-tiddler\\\" param=<> class=\\\"tc-image-button opened-tiddlers-bar-close-button\\\">\\n ×\\n \\n \\n \\n \\n <$reveal type=\\\"nomatch\\\" state=\\\"$:/HistoryList!!current-tiddler\\\" text=<>>\\n <$eventcatcher $auxclick=<>>\\n <$button to=<> class=\\\"tc-tab\\\" >\\n <$view tiddler=<> field=\\\"name\\\">\\n <$view tiddler=<> field=\\\"title\\\" />\\n \\n <$button message=\\\"tm-close-tiddler\\\" param=<> class=\\\"tc-image-button opened-tiddlers-bar-close-button\\\">\\n ×\\n \\n \\n \\n \\n \\n
\\n
\\n
\\n\\\\end\\n\"}}}", 11 | "title": "$:/plugins/linonetwo/opened-tiddlers-bar", 12 | "type": "application/json", 13 | "version": "1.0.0", 14 | "Modern.TiddlyDev#SHA256-Hashed": "b458c5d7dcb3ade6e6e17b81ee48b3c5e42657a48a3cf4d1090a7138dc864773" 15 | } 16 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_flibbles_relink-titles.json: -------------------------------------------------------------------------------- 1 | {"tiddlers":{"$:/plugins/flibbles/relink-titles/configuration":{"title":"$:/plugins/flibbles/relink-titles/configuration","caption":"{{$:/plugins/flibbles/relink-titles/language/Caption}}","tags":"$:/tags/flibbles/relink/Configuration","list-after":"","text":"\\define lingo-base() $:/plugins/flibbles/relink-titles/language/\n\\define prefix() $:/config/flibbles/relink-titles/relink/\n\\whitespace trim\n\n
\n\n<>\n\n\n\n<$list filter=\"[[relinktitlesrule]modules[]]\">\n\n\n
\n<$checkbox\n\ttiddler={{{ [all[current]addprefix] }}}\n\tfield=\"text\"\n\tchecked=\"enabled\"\n\tunchecked=\"disabled\"\n\tdefault=\"enabled\">\n \n''{{!!caption}}''\n\n\n<$transclude field='description' />\n\n
\n"},"$:/plugins/flibbles/relink-titles/language/Caption":{"title":"$:/plugins/flibbles/relink-titles/language/Caption","text":"Titles"},"$:/plugins/flibbles/relink-titles/language/Directory/Caption":{"title":"$:/plugins/flibbles/relink-titles/language/Directory/Caption","text":"Rename subdirectories"},"$:/plugins/flibbles/relink-titles/language/Directory/Description":{"title":"$:/plugins/flibbles/relink-titles/language/Directory/Description","text":"For wikis set up hierarchically using `/`, like a filesystem. This option will update all tiddlers nested inside the target tiddler. i.e. `fromTiddler/path/file` becomes `toTiddler/path/file`."},"$:/plugins/flibbles/relink-titles/language/Lookup/Caption":{"title":"$:/plugins/flibbles/relink-titles/language/Lookup/Caption","text":"Lookup tiddlers"},"$:/plugins/flibbles/relink-titles/language/Help":{"title":"$:/plugins/flibbles/relink-titles/language/Help","text":"See the //Relink-titles// documentation page for details."},"$:/plugins/flibbles/relink-titles/readme":{"title":"$:/plugins/flibbles/relink-titles/readme","text":"Highly customizable relinking of tiddler titles //related// to the renamed tiddler.\n\n* Rename a hierarchy of subtiddlers when renaming a root tiddler.\n* Make custom filter rules to rename other tiddlers the way you want when Relinking.\n* Integrates with other plugins for plugin-specific rules.\n\nSee the tw5-relink website for more details and examples.\n\n{{$:/core/images/warning}} ''Warning:'' You must use //Relink// v1.10.2 or greater with this, or this plugin may delete some tiddler bodies while trying to relink titles.\n"},"$:/plugins/flibbles/relink-titles/relinkoperations/title.js":{"title":"$:/plugins/flibbles/relink-titles/relinkoperations/title.js","text":"/*\\\nmodule-type: relinkoperator\ntitle: $:/plugins/flibbles/relink-titles/relinkoperations/title.js\ntype: application/javascript\n\nRenames tiddlers which have titles derived from fromTitle. Then it makes\nsure that those tiddlers are properly relinked too.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar configPrefix = \"$:/config/flibbles/relink-titles/relink/\";\nvar utils = require('$:/plugins/flibbles/relink/js/utils.js');\n// This is using hotDirectories, which is a deprecated feature. It should be\n// using the $:/config/flibbles/relink/{cateogory} directory which would be\n// automatically maintained and regenerated.\n// Maybe in time I'll get around to migrating this, but no need to complicate\n// things now with changes that would require migration, and that would\n// have no outward effect.\nutils.getContext('whitelist').hotDirectories.push(configPrefix);\n\nvar titleRules = Object.create(null);\n$tw.modules.forEachModuleOfType('relinktitlesrule', function(title, module) {\n\ttitleRules[title] = module;\n});\n\nexports.name = 'title';\n\nexports.report = function(tiddler, callback, options) {\n\tvar cache = getCache(options),\n\t\trules = cache.rules;\n\tfor (var i = 0; i < rules.length; i++) {\n\t\trules[i].report(tiddler.fields.title, function(title, blurb, style) {\n\t\t\tcallback(title, blurb ? ('title: ' + blurb) : 'title', style);\n\t\t}, options);\n\t}\n};\n\nexports.relink = function(tiddler, fromTitle, toTitle, changes, options) {\n\tvar cache = getCache(options),\n\t\ttitle = tiddler.fields.title;\n\tif (!cache.touched[title]) {\n\t\tvar rules = cache.rules;\n\t\tfor (var i = 0; i < rules.length; i++) {\n\t\t\tvar rule = rules[i];\n\t\t\tvar entry = rule.relink(title, fromTitle, toTitle, options);\n\t\t\tif (entry) {\n\t\t\t\tvar result = entry.output;\n\t\t\t\tif (result && (result !== title)) {\n\t\t\t\t\tif (options.wiki.getTiddler(result) || cache.touched[result]) {\n\t\t\t\t\t\t// There's already a tiddler there. We won't clobber it.\n\t\t\t\t\t\tentry.impossible = true;\n\t\t\t\t\t\tentry.output = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tcache.touched[result] = true;\n\t\t\t\t}\n\t\t\t\t// Record that we've touched this one, so we only touch it once.\n\t\t\t\t// Both its prior and latter. Neither should be touched again.\n\t\t\t\tcache.touched[title] = true;\n\t\t\t\tchanges.title = entry;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n};\n\nfunction getCache(options) {\n\treturn utils.getCacheForRun(options, 'titles', function() {\n\t\treturn {\n\t\t\trules: getRules(options.wiki),\n\t\t\ttouched: Object.create(null)\n\t\t};\n\t});\n};\n\nfunction getRules(wiki) {\n\tvar activeRules = [];\n\tfor (var rule in titleRules) {\n\t\tvar configTiddler = wiki.getTiddler(configPrefix + rule);\n\t\tif (!configTiddler || configTiddler.fields.text !== \"disabled\") {\n\t\t\tactiveRules.push(titleRules[rule]);\n\t\t}\n\t}\n\treturn activeRules;\n};\n","module-type":"relinkoperator","type":"application/javascript"},"$:/plugins/flibbles/relink-titles/rules/directory":{"title":"$:/plugins/flibbles/relink-titles/rules/directory","text":"/*\\\ncaption: {{$:/plugins/flibbles/relink-titles/language/Directory/Caption}}\ndescription: {{$:/plugins/flibbles/relink-titles/language/Directory/Description}}\nmodule-type: relinktitlesrule\ntitle: $:/plugins/flibbles/relink-titles/rules/directory\ntype: application/javascript\n\nHandles subdirectory renaming.\n\n\\*/\n\n/*jslint node: false, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = 'directory';\n\n/**The report returns all parent directories of a given title which exist.\n */\nexports.report = function(title, callback, options) {\n\tvar index = -1;\n\twhile ((index = title.indexOf('/', index+1)) >= 0) {\n\t\tvar dir = title.substr(0, index);\n\t\tcallback(dir, '.' + title.substr(index), {soft: true});\n\t}\n};\n\n/**The relink returns the new title (if any) derived from title for a given\n * rename of fromTitle to toTitle.\n */\nexports.relink = function(title, fromTitle, toTitle, options) {\n\tvar length = fromTitle.length;\n\tif (title.charAt(length) === '/' && title.substr(0, length) === fromTitle) {\n\t\treturn {output: toTitle + title.substr(length)};\n\t}\n\treturn undefined;\n};\n","caption":"{{$:/plugins/flibbles/relink-titles/language/Directory/Caption}}","description":"{{$:/plugins/flibbles/relink-titles/language/Directory/Description}}","module-type":"relinktitlesrule","type":"application/javascript"},"$:/plugins/flibbles/relink-titles/language/Lookup/Description":{"title":"$:/plugins/flibbles/relink-titles/language/Lookup/Description","text":"This option updates all configuration tiddlers which relate to target tiddlers either through fixed prefixes or suffixes, i.e. `$:/config/Buttons/Visibility/fromFile` becomes `$:/config/Buttons/Visibility/toFile` when \"fromFile\" is renamed.\n\nEach line corresponds to a pattern, where `$(currentTiddler)$` would be the name of the tiddler being renamed, and `$(*)$` matches with anything.\n\n<$edit-text\n\ttiddler=\"$:/config/flibbles/relink-titles/lookup/patterns\"\n\ttag=\"textarea\"\n/>\n"},"$:/config/flibbles/relink-titles/lookup/patterns":{"title":"$:/config/flibbles/relink-titles/lookup/patterns","text":"$:/config/$(*)$/Visibility/$(currentTiddler)$\n"},"$:/plugins/flibbles/relink-titles/rules/lookup":{"title":"$:/plugins/flibbles/relink-titles/rules/lookup","text":"/*\\\ncaption: {{$:/plugins/flibbles/relink-titles/language/Lookup/Caption}}\ndescription: {{$:/plugins/flibbles/relink-titles/language/Lookup/Description}}\nmodule-type: relinktitlesrule\ntitle: $:/plugins/flibbles/relink-titles/rules/lookup\ntype: application/javascript\n\nHandles setting tiddlers which are derived from other tiddlers, like how\n\n```\n$:/config/PageControlButtons/Visibility/$(currentTiddler)$\n```\n\nset the visibility for $(currentTiddler)$\n\n\\*/\n\n\"use strict\";\n\nexports.name = 'lookup';\n\nvar patternTiddler = \"$:/config/flibbles/relink-titles/lookup/patterns\";\nvar anyMatcher = /\\$\\((?:\\*|currentTiddler)\\)\\$/g;\n\nexports.report = function(targetTitle, callback, options) {\n\tvar patterns = getPatterns(options.wiki);\n\tfor (var i = 0; i < patterns.length; i++) {\n\t\tvar pattern = patterns[i];\n\t\tvar index = 0;\n\t\tvar results = match(pattern, targetTitle);\n\t\tif (results) {\n\t\t\tvar blurb = pattern.string.replace(anyMatcher, function(match) {\n\t\t\t\tindex++;\n\t\t\t\tif (match === \"$(*)$\") {\n\t\t\t\t\treturn results[index];\n\t\t\t\t} else { // must be \"$(currentTiddler)$\"\n\t\t\t\t\treturn \"...\";\n\t\t\t\t}\n\t\t\t});\n\t\t\tcallback(results.title, blurb);\n\t\t}\n\t}\n};\n\nexports.relink = function(targetTitle, fromTitle, toTitle, options) {\n\tvar patterns = getPatterns(options.wiki);\n\tfor (var i = 0; i < patterns.length; i++) {\n\t\tvar pattern = patterns[i];\n\t\tvar results = match(pattern, targetTitle, fromTitle);\n\t\tif (results) {\n\t\t\tvar groupIndex = 0;\n\t\t\t// Make all the correct substitutions to create the new title\n\t\t\tvar output = pattern.string.replace(anyMatcher, function(match) {\n\t\t\t\tgroupIndex++;\n\t\t\t\tif (match === \"$(*)$\") {\n\t\t\t\t\treturn results[groupIndex];\n\t\t\t\t} else { // must be \"$(currentTiddler)$\"\n\t\t\t\t\treturn toTitle;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {output: output};\n\t\t}\n\t}\n\treturn undefined;\n};\n\nfunction match(pattern, string, matchTitle) {\n\tvar results = pattern.matcher.exec(string);\n\tif (results) {\n\t\t// It superficially matches, but we need to make sure all the right\n\t\t// groups match too.\n\t\tfor (var j = 0; j < pattern.groups.length; j++) {\n\t\t\tvar index = pattern.groups[j];\n\t\t\tif (matchTitle === undefined) {\n\t\t\t\t// It doesn't matter what matchTitle is, as long as all\n\t\t\t\t// groups match the same thing.\n\t\t\t\tmatchTitle = results[index];\n\t\t\t} else if (results[index] !== matchTitle) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tresults.title = matchTitle;\n\t}\n\treturn results;\n};\n\nfunction getPatterns(wiki) {\n\treturn wiki.getCacheForTiddler(patternTiddler, \"relink-titles\", function() {\n\t\tvar text = wiki.getTiddlerText(patternTiddler);\n\t\tvar matchers = []\n\t\tif (text) {\n\t\t\tvar array = text.split('\\n');\n\t\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\t\tvar pattern = formPatternFromString(array[i]);\n\t\t\t\tif (pattern) {\n\t\t\t\t\tmatchers.push(pattern);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn matchers;\n\t});\n};\n\nfunction formPatternFromString(string) {\n\tvar groupIndex = 1;\n\tvar matchingGroups = [];\n\tstring = $tw.utils.trim(string);\n\tvar parts = string.split(\"$(currentTiddler)$\");\n\tif (parts.length <= 1) {\n\t\t// $(currentTiddler)$ must not have been there\n\t\treturn null;\n\t}\n\tfor (var j = 0; j < parts.length; j++) {\n\t\t// Split it up by the wildcards\n\t\tvar sections = parts[j].split(\"$(*)$\");\n\t\tfor (var k = 0; k < sections.length; k++) {\n\t\t\tsections[k] = $tw.utils.escapeRegExp(sections[k]);\n\t\t}\n\t\tparts[j] = sections.join(\"(.*)\");\n\t\t// If there are 3 sections, then there is 2 $(*)$, so the index\n\t\t// must skip them. etc...\n\t\tgroupIndex += sections.length-1;\n\t\tif (j < parts.length-1) {\n\t\t\t// If there are 3 parts, that means 2 $(currentTiddler)$, and\n\t\t\t// so we skip the last part\n\t\t\tmatchingGroups.push(groupIndex);\n\t\t\tgroupIndex++;\n\t\t}\n\t}\n\treturn {\n\t\tstring: string,\n\t\tgroups: matchingGroups,\n\t\tmatcher: new RegExp(\"^\" + parts.join(\"(.*)\") + \"$\")\n\t};\n};\n","caption":"{{$:/plugins/flibbles/relink-titles/language/Lookup/Caption}}","description":"{{$:/plugins/flibbles/relink-titles/language/Lookup/Description}}","module-type":"relinktitlesrule","type":"application/javascript"}}} -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_tiddlywiki_browser-sniff.json: -------------------------------------------------------------------------------- 1 | {"tiddlers":{"$:/plugins/tiddlywiki/browser-sniff/sniff.js":{"title":"$:/plugins/tiddlywiki/browser-sniff/sniff.js","text":"/*\\\ntitle: $:/plugins/tiddlywiki/browser-sniff/sniff.js\ntype: application/javascript\nmodule-type: info\n\nInitialise $:/info/browser tiddlers\n\n\\*/\n\n\"use strict\";\n\nexports.getInfoTiddlerFields = function() {\n\tvar mapBoolean = function(value) {return value ? \"yes\" : \"no\";},\n\t\tinfoTiddlerFields = [];\n\t// Basics\n\tif($tw.browser) {\n\t\t// Mappings from tiddler titles (prefixed with \"$:/info/browser/\") to bowser.browser property name\n\t\tvar bowser = require(\"$:/plugins/tiddlywiki/browser-sniff/bowser/bowser.js\"),\n\t\t\tmappings = [\n\t\t\t\t[\"name\",\"name\",\"unknown\"],\n\t\t\t\t[\"version\",\"version\"],\n\t\t\t\t[\"is/webkit\",\"webkit\"],\n\t\t\t\t[\"is/gecko\",\"gecko\"],\n\t\t\t\t[\"is/chrome\",\"chrome\"],\n\t\t\t\t[\"is/firefox\",\"firefox\"],\n\t\t\t\t[\"is/ios\",\"ios\"],\n\t\t\t\t[\"is/iphone\",\"iphone\"],\n\t\t\t\t[\"is/ipad\",\"ipad\"],\n\t\t\t\t[\"is/ipod\",\"ios\"],\n\t\t\t\t[\"is/opera\",\"opera\"],\n\t\t\t\t[\"is/phantomjs\",\"phantomjs\"],\n\t\t\t\t[\"is/safari\",\"safari\"],\n\t\t\t\t[\"is/seamonkey\",\"seamonkey\"],\n\t\t\t\t[\"is/blackberry\",\"blackberry\"],\n\t\t\t\t[\"is/webos\",\"webos\"],\n\t\t\t\t[\"is/silk\",\"silk\"],\n\t\t\t\t[\"is/bada\",\"bada\"],\n\t\t\t\t[\"is/tizen\",\"tizen\"],\n\t\t\t\t[\"is/sailfish\",\"sailfish\"],\n\t\t\t\t[\"is/android\",\"android\"],\n\t\t\t\t[\"is/windowsphone\",\"windowsphone\"],\n\t\t\t\t[\"is/firefoxos\",\"firefoxos\"],\n\t\t\t\t[\"is/mobile\",\"mobile\"]\n\t\t\t];\n\t\t$tw.browser = $tw.utils.extend($tw.browser, {\n\t\t\tis: bowser.browser,\n\t\t});\n\t\t$tw.utils.each(mappings,function(mapping) {\n\t\t\tvar value = bowser.browser[mapping[1]];\n\t\t\tif(value === undefined) {\n\t\t\t\tvalue = mapping[2];\n\t\t\t}\n\t\t\tif(value === undefined) {\n\t\t\t\tvalue = false;\n\t\t\t}\n\t\t\tif(typeof value === \"boolean\") {\n\t\t\t\tvalue = mapBoolean(value);\n\t\t\t}\n\t\t\tinfoTiddlerFields.push({title: \"$:/info/browser/\" + mapping[0], text: value});\n\t\t});\n\t\t// Set $:/info/browser/name to the platform with some changes from Bowser\n\t\tvar platform = bowser.browser.name;\n\t\tif(\"iPad iPhone iPod\".split(\" \").indexOf(platform) !== -1) {\n\t\t\tplatform = \"iOS\";\n\t\t}\n\t\tinfoTiddlerFields.push({title: \"$:/info/browser/name\", text: platform});\n\t\t// Non-bowser settings for TiddlyFox and TiddlyDesktop\n\t\tvar hasTiddlyFox = !!document.getElementById(\"tiddlyfox-message-box\"), // Fails because message box is added after page load\n\t\t\tisTiddlyDesktop = false; // Can't detect it until we update TiddlyDesktop to have a distinct useragent string\n\t\t//infoTiddlerFields.push({title: \"$:/info/browser/has/tiddlyfox\", text: mapBoolean(hasTiddlyFox)});\n\t\t//infoTiddlerFields.push({title: \"$:/info/browser/is/tiddlydesktop\", text: mapBoolean(isTiddlyDesktop)});\n\t\tif(isTiddlyDesktop) {\n\t\t\tinfoTiddlerFields.push({title: \"$:/info/browser/name\", text: \"TiddlyDesktop\"});\n\t\t}\n\t}\n\treturn infoTiddlerFields;\n};\n","type":"application/javascript","module-type":"info"},"$:/plugins/tiddlywiki/browser-sniff/bowser/bowser.js":{"text":"/*!\n * Bowser - a browser detector\n * https://github.com/ded/bowser\n * MIT License | (c) Dustin Diaz 2014\n */\n\n!function (name, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition()\n else if (typeof define == 'function') define(definition)\n else this[name] = definition()\n}('bowser', function () {\n /**\n * See useragents.js for examples of navigator.userAgent\n */\n\n var t = true\n\n function detect(ua) {\n\n function getFirstMatch(regex) {\n var match = ua.match(regex);\n return (match && match.length > 1 && match[1]) || '';\n }\n\n var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()\n , likeAndroid = /like android/i.test(ua)\n , android = !likeAndroid && /android/i.test(ua)\n , versionIdentifier = getFirstMatch(/version\\/(\\d+(\\.\\d+)?)/i)\n , tablet = /tablet/i.test(ua)\n , mobile = !tablet && /[^-]mobi/i.test(ua)\n , result\n\n if (/opera|opr/i.test(ua)) {\n result = {\n name: 'Opera'\n , opera: t\n , version: versionIdentifier || getFirstMatch(/(?:opera|opr)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/windows phone/i.test(ua)) {\n result = {\n name: 'Windows Phone'\n , windowsphone: t\n , msie: t\n , version: getFirstMatch(/iemobile\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/msie|trident/i.test(ua)) {\n result = {\n name: 'Internet Explorer'\n , msie: t\n , version: getFirstMatch(/(?:msie |rv:)(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/chrome|crios|crmo/i.test(ua)) {\n result = {\n name: 'Chrome'\n , chrome: t\n , version: getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (iosdevice) {\n result = {\n name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'\n }\n // WTF: version is not part of user agent in web apps\n if (versionIdentifier) {\n result.version = versionIdentifier\n }\n }\n else if (/sailfish/i.test(ua)) {\n result = {\n name: 'Sailfish'\n , sailfish: t\n , version: getFirstMatch(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/seamonkey\\//i.test(ua)) {\n result = {\n name: 'SeaMonkey'\n , seamonkey: t\n , version: getFirstMatch(/seamonkey\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/firefox|iceweasel/i.test(ua)) {\n result = {\n name: 'Firefox'\n , firefox: t\n , version: getFirstMatch(/(?:firefox|iceweasel)[ \\/](\\d+(\\.\\d+)?)/i)\n }\n if (/\\((mobile|tablet);[^\\)]*rv:[\\d\\.]+\\)/i.test(ua)) {\n result.firefoxos = t\n }\n }\n else if (/silk/i.test(ua)) {\n result = {\n name: 'Amazon Silk'\n , silk: t\n , version : getFirstMatch(/silk\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (android) {\n result = {\n name: 'Android'\n , version: versionIdentifier\n }\n }\n else if (/phantom/i.test(ua)) {\n result = {\n name: 'PhantomJS'\n , phantom: t\n , version: getFirstMatch(/phantomjs\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/blackberry|\\bbb\\d+/i.test(ua) || /rim\\stablet/i.test(ua)) {\n result = {\n name: 'BlackBerry'\n , blackberry: t\n , version: versionIdentifier || getFirstMatch(/blackberry[\\d]+\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/(web|hpw)os/i.test(ua)) {\n result = {\n name: 'WebOS'\n , webos: t\n , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\\/(\\d+(\\.\\d+)?)/i)\n };\n /touchpad\\//i.test(ua) && (result.touchpad = t)\n }\n else if (/bada/i.test(ua)) {\n result = {\n name: 'Bada'\n , bada: t\n , version: getFirstMatch(/dolfin\\/(\\d+(\\.\\d+)?)/i)\n };\n }\n else if (/tizen/i.test(ua)) {\n result = {\n name: 'Tizen'\n , tizen: t\n , version: getFirstMatch(/(?:tizen\\s?)?browser\\/(\\d+(\\.\\d+)?)/i) || versionIdentifier\n };\n }\n else if (/safari/i.test(ua)) {\n result = {\n name: 'Safari'\n , safari: t\n , version: versionIdentifier\n }\n }\n else result = {}\n\n // set webkit or gecko flag for browsers based on these engines\n if (/(apple)?webkit/i.test(ua)) {\n result.name = result.name || \"Webkit\"\n result.webkit = t\n if (!result.version && versionIdentifier) {\n result.version = versionIdentifier\n }\n } else if (!result.opera && /gecko\\//i.test(ua)) {\n result.name = result.name || \"Gecko\"\n result.gecko = t\n result.version = result.version || getFirstMatch(/gecko\\/(\\d+(\\.\\d+)?)/i)\n }\n\n // set OS flags for platforms that have multiple browsers\n if (android || result.silk) {\n result.android = t\n } else if (iosdevice) {\n result[iosdevice] = t\n result.ios = t\n }\n\n // OS version extraction\n var osVersion = '';\n if (iosdevice) {\n osVersion = getFirstMatch(/os (\\d+([_\\s]\\d+)*) like mac os x/i);\n osVersion = osVersion.replace(/[_\\s]/g, '.');\n } else if (android) {\n osVersion = getFirstMatch(/android[ \\/-](\\d+(\\.\\d+)*)/i);\n } else if (result.windowsphone) {\n osVersion = getFirstMatch(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i);\n } else if (result.webos) {\n osVersion = getFirstMatch(/(?:web|hpw)os\\/(\\d+(\\.\\d+)*)/i);\n } else if (result.blackberry) {\n osVersion = getFirstMatch(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i);\n } else if (result.bada) {\n osVersion = getFirstMatch(/bada\\/(\\d+(\\.\\d+)*)/i);\n } else if (result.tizen) {\n osVersion = getFirstMatch(/tizen[\\/\\s](\\d+(\\.\\d+)*)/i);\n }\n if (osVersion) {\n result.osversion = osVersion;\n }\n\n // device type extraction\n var osMajorVersion = osVersion.split('.')[0];\n if (tablet || iosdevice == 'ipad' || (android && (osMajorVersion == 3 || (osMajorVersion == 4 && !mobile))) || result.silk) {\n result.tablet = t\n } else if (mobile || iosdevice == 'iphone' || iosdevice == 'ipod' || android || result.blackberry || result.webos || result.bada) {\n result.mobile = t\n }\n\n // Graded Browser Support\n // http://developer.yahoo.com/yui/articles/gbs\n if ((result.msie && result.version >= 10) ||\n (result.chrome && result.version >= 20) ||\n (result.firefox && result.version >= 20.0) ||\n (result.safari && result.version >= 6) ||\n (result.opera && result.version >= 10.0) ||\n (result.ios && result.osversion && result.osversion.split(\".\")[0] >= 6)\n ) {\n result.a = t;\n }\n else if ((result.msie && result.version < 10) ||\n (result.chrome && result.version < 20) ||\n (result.firefox && result.version < 20.0) ||\n (result.safari && result.version < 6) ||\n (result.opera && result.version < 10.0) ||\n (result.ios && result.osversion && result.osversion.split(\".\")[0] < 6)\n ) {\n result.c = t\n } else result.x = t\n\n return result\n }\n\n var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent : '')\n\n\n /*\n * Set our detect method to the main bowser object so we can\n * reuse it to test other user agents.\n * This is needed to implement future tests.\n */\n bowser._detect = detect;\n\n return bowser\n});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/browser-sniff/bowser/bowser.js","module-type":"library"},"$:/plugins/tiddlywiki/browser-sniff/readme":{"title":"$:/plugins/tiddlywiki/browser-sniff/readme","text":"This plugin adds a number of `$:/info/` tiddlers containing information about the current browser.\n\nIt allows you to create content that is presented in a way that is responsive to different browsers.\n\nFor example, https://tiddlywiki.com uses this plugin to present the user with the best options for getting started depending on their browser.\n\n[[Source code|https://github.com/TiddlyWiki/TiddlyWiki5/blob/master/plugins/tiddlywiki/browser-sniff]]\n"},"$:/plugins/tiddlywiki/browser-sniff/usage":{"title":"$:/plugins/tiddlywiki/browser-sniff/usage","text":"! Information Tiddlers\n\nThe following informational tiddlers are created at startup:\n\n|!Title |!Description |\n|[[$:/info/browser/is/mobile]] |Running on mobile device? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/android]] |Running on Android? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/bada]] |Running on Bada? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/blackberry]] |Running on ~BlackBerry? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/chrome]] |Running on Chrome? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/firefox]] |Running on Firefox? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/firefoxos]] |Running on Firefox OS? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/gecko]] |Running on Gecko? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/ios]] |Running on iOS (ie an iPhone, iPad or iPod)? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/ipad]] |Running on iPad? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/iphone]] |Running on iPhone? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/ipod]] |Running on iPod? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/opera]] |Running on Opera? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/phantomjs]] |Running on ~PhantomJS? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/safari]] |Running on Safari? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/sailfish]] |Running on Sailfish? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/seamonkey]] |Running on Sea Monkey? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/silk]] |Running on Amazon's Silk? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/tizen]] |Running on Tizen? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/webkit]] |Running on ~WebKit? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/webos]] |Running on ~WebOS? (\"yes\" or \"no\") |\n|[[$:/info/browser/is/windowsphone]] |Running on Windows Phone? (\"yes\" or \"no\") |\n|[[$:/info/browser/name]] |Platform name (see below) |\n|[[$:/info/browser/version]] |Browser version |\n\nThe browser information is obtained with [[Bowser, a browser detector library from Dustin Diaz|https://github.com/ded/bowser/]]. Possible browser names include:\n\n* ''\"Amazon Silk\"''\n* ''\"Android\"''\n* ''\"Bada\"''\n* ''\"~BlackBerry\"''\n* ''\"Chrome\"''\n* ''\"Firefox\"''\n* ''\"Internet Explorer\"''\n* ''\"iOS\"''\n* ''\"Opera\"''\n* ''\"~PhantomJS\"''\n* ''\"Safari\"''\n* ''\"Sailfish\"''\n* ''\"~SeaMonkey\"''\n* ''\"~TiddlyDesktop\"''\n* ''\"Tizen\"''\n* ''\"~WebOS\"''\n* ''\"Windows Phone\"''\n\nNote that Bowser returns \"iPhone\", \"iPad\" and \"iPod\" as distinct values for the name of the current browser. TiddlyWiki converts all three distinct values into \"iOS\" before copying to [[$:/info/browser/name]].\n"}}} -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_linonetwo_title-caption.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "LinOnetwo", 4 | "core-version": ">=5.1.22", 5 | "dependents": "", 6 | "description": "Display caption in title area.", 7 | "list": "readme config tree", 8 | "plugin-type": "plugin", 9 | "stability": "STABILITY_2_STABLE", 10 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/title-caption/edit/TitleStyle.css\":{\"title\":\"$:/plugins/linonetwo/title-caption/edit/TitleStyle.css\",\"type\":\"text/vnd.tiddlywiki\",\"tags\":\"$:/tags/Stylesheet\",\"text\":\"/**\\n * There will be two inputs, and we select the nearest div to the title input and input.title-caption-plugin-caption-edit, then select the first input that is followed by the title preview element `tc-tiddler-title`\\n */\\ndiv.tc-tiddler-edit-frame div:has(>.title-caption-plugin-caption-edit) .tc-tiddler-title + input {\\n font-size: unset;\\n}\"},\"$:/plugins/linonetwo/title-caption/edit/captionCascade\":{\"title\":\"$:/plugins/linonetwo/title-caption/edit/captionCascade\",\"tags\":\"$:/tags/EditTemplate\",\"list-after\":\"$:/core/ui/EditTemplate/title\",\"code-body\":\"yes\",\"text\":\"<$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/EditCaptionTemplateTitleFilter]!is[draft]get[text]] }}} />\\n\"},\"$:/plugins/linonetwo/title-caption/edit/defaultFilter\":{\"title\":\"$:/plugins/linonetwo/title-caption/edit/defaultFilter\",\"tags\":\"$:/tags/EditCaptionTemplateTitleFilter\",\"text\":\"[[]]\"},\"$:/plugins/linonetwo/title-caption/edit/hasCaptionFilter\":{\"title\":\"$:/plugins/linonetwo/title-caption/edit/hasCaptionFilter\",\"tags\":\"$:/tags/EditCaptionTemplateTitleFilter\",\"list-before\":\"$:/plugins/linonetwo/title-caption/edit/isTitlelessFilter\",\"text\":\"[has[caption]then[$:/plugins/linonetwo/title-caption/edit/useCaptionEdit]]\"},\"$:/plugins/linonetwo/title-caption/edit/isTitlelessFilter\":{\"title\":\"$:/plugins/linonetwo/title-caption/edit/isTitlelessFilter\",\"tags\":\"$:/tags/EditCaptionTemplateTitleFilter\",\"list-before\":\"$:/plugins/linonetwo/title-caption/edit/defaultFilter\",\"text\":\"[has[_is_titleless]then[$:/plugins/linonetwo/title-caption/edit/useCaptionEdit]]\"},\"$:/plugins/linonetwo/title-caption/edit/useCaptionEdit\":{\"title\":\"$:/plugins/linonetwo/title-caption/edit/useCaptionEdit\",\"code-body\":\"yes\",\"text\":\"<$edit-text tiddler=<> field=\\\"caption\\\" focus=\\\"yes\\\" class=\\\"tc-titlebar tc-edit-texteditor title-caption-plugin-caption-edit\\\"/>\\n\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Readme\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/title-caption/language/\\n\\n! <>\\n\\n<>\\n\\nGithub: https://github.com/tiddly-gittly/title-caption\\n\\nCaption means \\\"axillary text\\\", it may means the text underneath an image that explains the content of the image, for example, \\\"The second from the left in the picture is Dr Lin\\\". In TiddlyWiki, the \\\"caption\\\" field has been used in various cases where the original title is \\\"Unique identifier used by the system, similar to gibberish\\\", and should show user the human-readable \\\"caption\\\" field. However, by default, TiddlyWiki only displays the \\\"caption\\\" field for some system tiddlers, and user-created tiddlers may still display garbled-like titles.\\n\\nNowadays more and more plugins automatically generate random titles and then use the \\\"caption\\\" field to save human-readable text, so this field is becoming more and more important. This plugin is used to ensure that user tiddlers also display the contents of this field, and can easily edit it.\\n\\n!! Feature\\n\\n!!! View Mode\\n\\nDisplays the contents of the `caption` field as a title for tiddlers containing a `caption` field, or a `_is_titleless` field.\\n\\nThe {{$:/plugins/linonetwo/title-caption/view/toolbar/icon-caption-to-title}} button is displayed on the toolbar, and when clicked, it will move the contents of the `caption` field to the title field, rename and relink the entry, handle all links and transclusion to it. (Need to install \\\"relink\\\" and \\\"relink-title\\\" plugins)\\n\\n!!! Edit Mode\\n\\nWhen editing, the edit box for the title of said tiddler becomes an edit box for the contents of the `caption` field, and the edit box for the `title` field becomes a smaller, secondary input box.\\n\\nMany quick-recording plugins may just bring up a random title field, but not give you the default `caption` field. Such plugins will typically add the `_is_titleless: yes` field to the tiddler. This plugin recognises this usage and displays a friendly edit box to make it easier for you to edit the `caption` field while editing.\\n\\n!! Tryout\\n\\n!!! Auto generation\\n\\nWith the following i-message layout, you can create tiddlers where the `title` field is a random ID and the `caption` field is the real title.\\n\\n<>\\n\\n!!! Manual creation\\n\\nCreate a new tiddler, then add the `caption` field, or the `_is_titleless` field.\\n\\nOnce added, you'll notice that the old \\\"title\\\" edit box becomes an edit box for the `caption` field, and the edit box for the `title` field is now a smaller, secondary input box.\\n\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Name\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Name\",\"text\":\"Title Caption\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Description\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Description\",\"text\":\"Display caption in title area, and can easily edit it.\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/ApplyCaptionToTitle\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/ApplyCaptionToTitle\",\"text\":\"Apply caption as title\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/ApplyCaptionToTitleDescription\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/ApplyCaptionToTitleDescription\",\"text\":\"Move `caption` field to `title`, overwrite the original `title` field.\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/Description\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/Description\",\"text\":\"These settings let you customise the behaviour of \\\"Title Caption\\\" plugin.\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/PluginConfigs/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/PluginConfigs/Caption\",\"text\":\"Plugin Configs\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/XXX/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/XXX/Caption\",\"text\":\"XXX\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/XXX/Description\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/XXX/Description\",\"text\":\"XXX is XXX\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/YYY/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/YYY/Caption\",\"text\":\"YYY\"},\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/ZZZ/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/en-GB/Configs/ZZZ/Caption\",\"text\":\"ZZZ\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Readme\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/title-caption/language/\\n\\n! <>\\n\\n<>\\n\\nGithub: https://github.com/tiddly-gittly/title-caption\\n\\nCaption 的意思是说明文字,「说明文字」就是图片下方解释图片内容的文字,例如「图中左二是林博士」。在太微里,「说明文字」字段一直被用于各种原本的标题是「系统使用的类似乱码的唯一标识符」的情况,向用户展示使用人类可读的「说明文字」字段。但太微默认只给部分系统条目显示「说明文字」字段,用户创建的条目可能还是会显示类似乱码的标题。\\n\\n现在越来越多的插件会自动生成随机标题,然后用「说明文字」字段保存人类可读的文本,所以这个字段越来越重要了。这个插件就是用来确保用户条目也会显示这个字段的内容,并且可以轻松地编辑它。\\n\\n!! 功能\\n\\n!!! 查看模式\\n\\n包含 `caption` (说明文字)字段,或 `_is_titleless` (无标题)字段的条目,在阅读模式时,在标题区域显示 `caption` 字段的内容。\\n\\n在工具栏上会显示 {{$:/plugins/linonetwo/title-caption/view/toolbar/icon-caption-to-title}} 按钮,点击后会将 `caption` 字段的内容挪到标题字段,重命名条目,并且处理所有对它的链接和嵌入。(需要额外安装 \\\"relink \\\"和 \\\"relink-title \\\"插件)\\n\\n!!! 编辑模式\\n\\n在编辑条目时,上述条目的标题编辑框会变成编辑 `caption` 字段的内容,对 `title` 字段的编辑框则变成了一个较小的、次要的输入框。\\n\\n很多快速录入插件可能只会带上随机标题字段,但不会给你加上默认的 `caption` 字段。这种插件一般会给条目加上 `_is_titleless: yes` 的字段。这个插件可以识别这种用法,显示友好的编辑框,让你在编辑时更方便地编辑 `caption` 字段。\\n\\n!! 尝试\\n\\n!!! 自动生成\\n\\n用下面的 i信息 布局,可以创建出 `title` 字段是随机 ID,`caption` 字段是真正标题的条目。\\n\\n<>\\n\\n!!! 手动创建\\n\\n创建新条目,然后添加 `caption` 字段,或 `_is_titleless` 字段。\\n\\n添加后,你会发现标题编辑框会变成编辑 `caption` 字段的内容,对 `title` 字段的编辑框则变成了一个较小的、次要的输入框。\\n\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Name\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Name\",\"text\":\"标题字段\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Description\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Description\",\"text\":\"将「说明文字 caption」字段显示为标题,并且可以轻松地编辑它。\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/ApplyCaptionToTitle\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/ApplyCaptionToTitle\",\"text\":\"将说明文字应用为标题\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/ApplyCaptionToTitleDescription\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/ApplyCaptionToTitleDescription\",\"text\":\"将 `caption` 字段移动到 `title` 字段,覆盖原来的 `title` 字段。\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/Description\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/Description\",\"text\":\"通过这些设置,您可以自定义「标题字段」插件的行为。\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/PluginConfigs/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/PluginConfigs/Caption\",\"text\":\"插件设置\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/XXX/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/XXX/Caption\",\"text\":\"配置甲\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/XXX/Description\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/XXX/Description\",\"text\":\"配置甲是甲\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/YYY/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/YYY/Caption\",\"text\":\"配置乙\"},\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/ZZZ/Caption\":{\"title\":\"$:/plugins/linonetwo/title-caption/language/zh-Hans/Configs/ZZZ/Caption\",\"text\":\"配置丙\"},\"$:/plugins/linonetwo/title-caption/readme\":{\"title\":\"$:/plugins/linonetwo/title-caption/readme\",\"text\":\"\\\\procedure lingo-base() $:/plugins/linonetwo/title-caption/language/\\n\\n<>\\n\"},\"$:/core/ui/sideBar/timeline\":{\"title\":\"$:/core/ui/sideBar/timeline\",\"tags\":\"$:/tags/Macro\",\"text\":\"\\\\define timeline-title() <$transclude field=\\\"caption\\\"><$view field=\\\"title\\\"/>\\n\"},\"$:/plugins/linonetwo/title-caption/tree\":{\"title\":\"$:/plugins/linonetwo/title-caption/tree\",\"text\":\"<>\"},\"$:/plugins/linonetwo/title-caption/view/fallbackCaptionView\":{\"title\":\"$:/plugins/linonetwo/title-caption/view/fallbackCaptionView\",\"text\":\"\\\\whitespace trim\\n

\\n <$transclude field=\\\"caption\\\">\\n <$view field=\\\"title\\\"/>\\n \\n

\\n\"},\"$:/plugins/linonetwo/title-caption/view/hasCaptionFilter\":{\"title\":\"$:/plugins/linonetwo/title-caption/view/hasCaptionFilter\",\"tags\":\"$:/tags/ViewTemplateTitleFilter\",\"list-before\":\"$:/plugins/linonetwo/title-caption/view/isTitlelessFilter\",\"text\":\"[has[caption]then[$:/plugins/linonetwo/title-caption/view/fallbackCaptionView]]\"},\"$:/plugins/linonetwo/title-caption/view/isTitlelessFilter\":{\"title\":\"$:/plugins/linonetwo/title-caption/view/isTitlelessFilter\",\"tags\":\"$:/tags/ViewTemplateTitleFilter\",\"list-before\":\"$:/config/ViewTemplateTitleFilters/default\",\"text\":\"[has:field[_is_titleless]then[$:/plugins/linonetwo/title-caption/view/useCaptionView]]\"},\"$:/plugins/linonetwo/title-caption/view/onlyCaptionView\":{\"title\":\"$:/plugins/linonetwo/title-caption/view/onlyCaptionView\",\"text\":\"\\\\whitespace trim\\n

\\n <$view field=\\\"caption\\\" />\\n

\\n\"},\"$:/plugins/linonetwo/title-caption/view/toolbar/ApplyCaptionToTitle\":{\"title\":\"$:/plugins/linonetwo/title-caption/view/toolbar/ApplyCaptionToTitle\",\"tags\":\"$:/tags/ViewToolbar\",\"caption\":\"{{$:/plugins/linonetwo/title-caption/view/toolbar/icon-caption-to-title}} <>\",\"description\":\"<>\",\"text\":\"\\\\whitespace trim\\n\\\\define lingo-base() $:/plugins/linonetwo/title-caption/language/\\n\\n<$let oldTitle=<> newTitle={{!!caption}}>\\n <%if [] :cascade[all[shadows+tiddlers]tag[$:/tags/EditCaptionTemplateTitleFilter]!is[draft]get[text]] +[!is[blank]] %>\\n <%if [get[caption]!is[blank]] %>\\n <$wikify name=\\\"ApplyCaptionToTitle\\\" text=\\\"<>\\\" mode=\\\"inline\\\">\\n <$button tooltip=<> aria-label=<> class=<> >\\n <$action-deletefield $tiddler=<> caption _is_titleless />\\n <$action-sendmessage $message=\\\"tm-rename-tiddler\\\" from=<> to=<> />\\n\\n <$list filter=\\\"[match[yes]]\\\">\\n {{$:/plugins/linonetwo/title-caption/view/toolbar/icon-caption-to-title}}\\n \\n <$list filter=\\\"[match[yes]]\\\">\\n \\n <$text text=<>/>\\n \\n \\n \\n \\n <%endif%>\\n <%endif%>\\n\"},\"$:/plugins/linonetwo/title-caption/view/toolbar/icon-caption-to-title\":{\"title\":\"$:/plugins/linonetwo/title-caption/view/toolbar/icon-caption-to-title\",\"tags\":\"$:/tags/Image\",\"text\":\"\\\\parameters (size:\\\"22pt\\\")\\n> height=<> class=\\\"tc-image-bts-card-heading tc-image-button\\\" viewBox=\\\"0 0 16 16\\\">\"}}}", 11 | "title": "$:/plugins/linonetwo/title-caption", 12 | "type": "application/json", 13 | "version": "0.3.1", 14 | "Modern.TiddlyDev#SHA256-Hashed": "08e3a0de77243361ba9cef967c1c73635528e037cf11a0b1624a9ac7127d3036", 15 | "name": "Title -> Caption" 16 | } 17 | ] -------------------------------------------------------------------------------- /tiddlers/system/$__plugins_Gk0Wk_page-toc.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "author": "Gk0Wk", 4 | "dependents": "", 5 | "description": "Use tiddler's H1~H6 headers to generate navigable TOC for tiddler", 6 | "list": "readme LICENSE", 7 | "name": "Page TOC", 8 | "plugin-type": "plugin", 9 | "source": "https://github.com/Gk0Wk/TiddlySeq/tree/master/plugins/Gk0Wk/page-toc", 10 | "text": "{\"tiddlers\":{\"$:/plugins/Gk0Wk/page-toc/CurrentTiddlerTOC\":{\"title\":\"$:/plugins/Gk0Wk/page-toc/CurrentTiddlerTOC\",\"text\":\"<$list filter=\\\"[[$:/temp/focussedTiddler]is[tiddler]get[text]]\\\" variable=\\\"tiddler\\\">\\n\\nTOC of <$text text=<>/>:\\n<$page-toc tiddler=<> emptyMessage=\\\"Empty TOC\\\"/>\\n\\n\\n\"},\"$:/plugins/Gk0Wk/page-toc/LICENSE\":{\"title\":\"$:/plugins/Gk0Wk/page-toc/LICENSE\",\"text\":\"MIT License\\n\\nCopyright (c) 2021 Ke Wang (Gk0Wk in GitHub)\\n\\nPermission is hereby granted, free of charge, to any person obtaining a copy\\nof this software and associated documentation files (the \\\"Software\\\"), to deal\\nin the Software without restriction, including without limitation the rights\\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\ncopies of the Software, and to permit persons to whom the Software is\\nfurnished to do so, subject to the following conditions:\\n\\nThe above copyright notice and this permission notice shall be included in all\\ncopies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\nSOFTWARE.\\n\",\"type\":\"text/plain\"},\"$:/plugins/Gk0Wk/page-toc/PageTOCButton\":{\"title\":\"$:/plugins/Gk0Wk/page-toc/PageTOCButton\",\"list-after\":\"$:/core/ui/Buttons/info\",\"tags\":\"$:/tags/ViewToolbar\",\"caption\":\"{{$:/core/images/list-bullet}} {{$:/plugins/Gk0Wk/page-toc/PageTOCButton!!hint}}\",\"description\":\"Show TOC of this tiddler\",\"hint\":\"Page TOC\",\"text\":\"\\\\whitespace trim\\n<$set value={{{ [addprefix[$:/temp/Gk0Wk/page-toc/PageTOCButton/]] }}} name=\\\"stateTiddler\\\">\\n<$button popup=<> tooltip={{$:/plugins/Gk0Wk/page-toc/PageTOCButton!!description}} aria-label={{$:/plugins/Gk0Wk/page-toc/PageTOCButton!!hint}} class=<>>\\n<$list filter=\\\"[match[yes]]\\\">{{$:/core/images/list-bullet}}\\n<$list filter=\\\"[match[yes]]\\\">{{$:/plugins/Gk0Wk/page-toc/PageTOCButton!!hint}}\\n\\n<$reveal type=\\\"popup\\\" state=<> position=\\\"belowleft\\\" tag=\\\"div\\\" class=\\\"tc-popup-keep\\\">\\n<$page-toc tiddler=<> emptyMessage=\\\"Empty TOC\\\" class=\\\"gk0wk-tiddlertoc-viewbuttonpopup\\\" headerClassPrefix=\\\"gk0wk-tiddlertoc-viewbuttonpopup-\\\" />\\n\\n\\n\"},\"$:/plugins/Gk0Wk/page-toc/readme\":{\"title\":\"$:/plugins/Gk0Wk/page-toc/readme\",\"text\":\"<$list filter=\\\"[[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]]\\\" variable=\\\"lang\\\">\\n<$list filter=\\\"[search[zh]]\\\">\\n\\n利用条目的H1~H6标题为条目生成可导航的目录。没错,就是对单个条目生成的标题目录。而且目录是点击可导航的,就是说会滚动到标题所在的位置!\\n\\n虽然TiddlyWiki的组织逻辑不推荐编写过长的条目,但总会有碰到阅读长条目的时候。相信所有有类似经历的用户都曾想过:如果能为单个长条目生成阅读目录就好了,毕竟迷失在长文中是一件很痛苦的事情。我也是这其中的一员。\\n\\n本插件提供了一个能够对某个条目生成目录的空间`<$page-toc>`,参数如下:\\n\\n|!参数 |!解释 |\\n|tiddler |要生成目录的条目的标题,默认是当前条目(`currentTiddler`) |\\n|tag |为目录外层容器提供一个可选的HTML标签,用于代替默认的`div` |\\n|headerTag |为目录内层标题提供一个可选的HTML标签,用于代替默认的`p` |\\n|class |为目录外层容器指定类名,默认是`gk0wk-tiddlertoc-container` |\\n|headerClassPrefix |为目录内层标题指定类前缀(后面是`h1`~`h6`或`empty`),默认是`gk0wk-tiddlertoc-` |\\n|emptyMessage |目录为空、条目不存在或者条目不是文章时显示的文字 |\\n|scrollMode |滚动到标题的模式,`center`(默认)是将标题滚动到窗口中央,`start`和`end`是滚动到窗口的顶部和底部,`nearest`是根据相对位置选择滚动到顶部或者底部 |\\n|h1, h2, ..., h6 |是否将某一级标题包含在内,默认均为`yes` |\\n\\n例如:\\n\\n```\\n<$page-toc tiddler=<> emptyMessage=\\\"Empty TOC\\\"/>\\n```\\n\\n同时,我利用这个控件编写了两个小的组件,可以直接使用这两个组件,也可以学习这两个组件的用法做自己的DIY:\\n\\n* [[CurrentTiddlerTOC|$:/plugins/Gk0Wk/page-toc/CurrentTiddlerTOC]] 可以显示当前所阅读的条目的名称并生成目录,但是需要[[Hotzone插件|https://tw-cpl.netlify.app/#felixhayashi%2Fhotzone]]的支持。\\n* [[PageTOCButton|$:/plugins/Gk0Wk/page-toc/PageTOCButton]] 为每个条目的工具栏增加以一个 {{$:/core/images/list-bullet}} 按钮,点击即可显示目录。\\n\\n如有任何使用问题,欢迎向我提[[Issue|https://github.com/Gk0Wk/TiddlySeq/issues]]!\\n\\n> 本插件使用灵活而强大的 <$text text=\\\"TiddlyWiki\\\" /> 开发框架 [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]\\n\\n\\n\\n<$list filter=\\\"[!search[zh]]\\\">\\n\\nGenerate a navigable table of contents for tiddlers using the H1~H6 headings of the tiddlers. That's right, it's a headline table of contents generated for a single tiddler. And the table of contents is navigable by clicking on it, meaning it will scroll to where the title is!\\n\\nAlthough TiddlyWiki's organizational logic does not recommend writing excessively long tiddlers, there will always be times when you read long tiddlers. I'm sure all users who have had similar experiences have wondered if it would be nice to have a table of contents for individual long tiddlers, after all, it's a pain to get lost in long articles. I am also one of them.\\n\\nThis plugin provides a widget `<$page-toc>` that can generate a table of contents for a tiddler with the following parameters.\\n\\n|!Attribute |!Description |\\n|tiddler |Title of the tiddler to generate the TOC, default is the current tiddler (`currentTiddler`) |\\n|tag |Provide an optional HTML tag for the outer container of the TOC to replace the default `div` |\\n|headerTag |Provide an optional HTML tag for the inner TOC header to replace the default `p` |\\n|class |Specify the class name for the outer container of the TOC, the default is `gk0wk-tiddlertoc-container` |\\n|headerClassPrefix |Specify the class prefix (followed by `h1`~`h6` or `empty`) for the TOC inner level title, default is `gk0wk-tiddlertoc-` |\\n|emptyMessage |The text displayed when the table of contents is empty, the tiddler does not exist, or the tiddler is not an article |\\n|scrollMode |Scroll to header mode, `center` (default) is to scroll the header to the center of the window, `start` and `end` are to scroll to the top and bottom of the window, and `nearest` is to scroll to the top or bottom depending on the relative position |\\n|h1, h2, ..., h6 |Whether to include a certain level of title, default is `yes` |\\n\\nFor instance:\\n\\n```\\n<$page-toc tiddler=<> emptyMessage=\\\"Empty TOC\\\"/>\\n```\\n\\nAt the same time, I have written two small components using this widget, which can be used directly or you can learn the usage of these two components to do your own DIY:\\n\\n* [[CurrentTiddlerTOC|$:/plugins/Gk0Wk/page-toc/CurrentTiddlerTOC]] You can display the name of the currently read tiddler and generate a table of contents, but it requires the support of [[Hotzone Plugin|https://tw-cpl.netlify.app/#felixhayashi%2Fhotzone]].\\n* [[PageTOCButton|$:/plugins/Gk0Wk/page-toc/PageTOCButton]] Add a {{$:/core/images/list-bullet}} button to the toolbar for each tiddler and click it to display the table of contents.\\n\\nFeel free to make me an [[Issue|https://github.com/Gk0Wk/TiddlySeq/issues]] if you have any usage problems!\\n\\n> This plugin uses the flexible and powerful <$text text=\\\"TiddlyWiki\\\" /> development framework [[Tiddly.ModernDev|https://github.com/tiddly-gittly/Modern.TiddlyDev]]\\n\\n\\n\\n\"},\"$:/plugins/Gk0Wk/page-toc/style.css\":{\"title\":\"$:/plugins/Gk0Wk/page-toc/style.css\",\"text\":\".gk0wk-tiddlertoc-h1 {\\n padding-left: 0;\\n}\\n.gk0wk-tiddlertoc-h2 {\\n padding-left: 1em;\\n}\\n.gk0wk-tiddlertoc-h3 {\\n padding-left: 2em;\\n}\\n.gk0wk-tiddlertoc-h4 {\\n padding-left: 3em;\\n}\\n.gk0wk-tiddlertoc-h5 {\\n padding-left: 4em;\\n}\\n.gk0wk-tiddlertoc-h6 {\\n padding-left: 5em;\\n}\\n\\n.gk0wk-tiddlertoc-empty {\\n color: <>;\\n user-select: none;\\n}\\n\\n.gk0wk-tiddlertoc-h1,\\n.gk0wk-tiddlertoc-h2,\\n.gk0wk-tiddlertoc-h3,\\n.gk0wk-tiddlertoc-h4,\\n.gk0wk-tiddlertoc-h5,\\n.gk0wk-tiddlertoc-h6 {\\n user-select: none;\\n cursor: pointer;\\n transition: all {{$:/config/AnimationDuration}}ms;\\n}\\n\\n.gk0wk-tiddlertoc-h1:hover,\\n.gk0wk-tiddlertoc-h2:hover,\\n.gk0wk-tiddlertoc-h3:hover,\\n.gk0wk-tiddlertoc-h4:hover,\\n.gk0wk-tiddlertoc-h5:hover,\\n.gk0wk-tiddlertoc-h6:hover {\\n color: <>;\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup {\\n border-radius: 3px;\\n background: <>;\\n width: min(90vw, 300px);\\n <>\\n filter: contrast(90%);\\n padding: 0;\\n overflow-y: auto;\\n max-height: 80vh;\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h1 {\\n padding-left: 16px;\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h2 {\\n padding-left: calc(16px + 1em);\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h3 {\\n padding-left: calc(16px + 2em);\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h4 {\\n padding-left: calc(16px + 3em);\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h5 {\\n padding-left: calc(16px + 4em);\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h6 {\\n padding-left: calc(16px + 5em);\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-empty {\\n color: <>;\\n user-select: none;\\n font-size: 24px;\\n line-height: 1em;\\n padding: 20px;\\n text-align: center;\\n margin: 0 !important;\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h1,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h2,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h3,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h4,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h5,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h6 {\\n font-size: 16px;\\n font-weight: 700;\\n line-height: 1em;\\n margin: 0 !important;\\n padding-top: 10px;\\n padding-bottom: 10px;\\n padding-right: 6px;\\n user-select: none;\\n cursor: pointer;\\n background: transparent;\\n opacity: 0.7;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n overflow: hidden;\\n transition: all {{$:/config/AnimationDuration}}ms;\\n}\\n\\n.gk0wk-tiddlertoc-viewbuttonpopup-h1:hover,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h2:hover,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h3:hover,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h4:hover,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h5:hover,\\n.gk0wk-tiddlertoc-viewbuttonpopup-h6:hover {\\n opacity: 1;\\n background: <>;\\n color: <>;\\n}\\n\",\"tags\":\"$:/tags/Stylesheet\",\"type\":\"text/vnd.tiddlywiki\"},\"$:/plugins/Gk0Wk/page-toc/PageTOCWidget.js\":{\"title\":\"$:/plugins/Gk0Wk/page-toc/PageTOCWidget.js\",\"module-type\":\"widget\",\"type\":\"application/javascript\",\"Modern.TiddlyDev#Origin\":\"PageTOCWidget.ts\",\"text\":\"\\\"use strict\\\";var import_widget=require(\\\"$:/core/modules/widgets/widget.js\\\"),PageTOCWidget=class extends import_widget.widget{constructor(){super(...arguments),this.tocNodeTag=\\\"div\\\",this.tocHeaderNodeTag=\\\"p\\\",this.tocNodeClass=\\\"gk0wk-tiddlertoc-container\\\",this.tocHeaderNodeClassPrefix=\\\"gk0wk-tiddlertoc-\\\",this.tocTitle=\\\"\\\",this.emptyMessage=\\\"\\\",this.scrollMode=\\\"center\\\",this.includeHeaderMap={h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0}}initialise(e,t){super.initialise(e,t),this.computeAttributes()}execute(){this.tocTitle=this.getAttribute(\\\"tiddler\\\",this.getVariable(\\\"currentTiddler\\\")),this.tocNodeTag=this.getAttribute(\\\"tag\\\",\\\"div\\\"),$tw.config.htmlUnsafeElements.includes(this.tocNodeTag)&&(this.tocNodeTag=\\\"div\\\"),this.tocHeaderNodeTag=this.getAttribute(\\\"headerTag\\\",\\\"p\\\"),$tw.config.htmlUnsafeElements.includes(this.tocHeaderNodeTag)&&(this.tocHeaderNodeTag=\\\"p\\\"),this.tocNodeClass=this.getAttribute(\\\"class\\\",\\\"gk0wk-tiddlertoc-container\\\"),this.tocHeaderNodeClassPrefix=this.getAttribute(\\\"headerClassPrefix\\\",\\\"gk0wk-tiddlertoc-\\\"),this.emptyMessage=this.getAttribute(\\\"emptyMessage\\\",\\\"\\\"),this.includeHeaderMap.h1=\\\"yes\\\"===this.getAttribute(\\\"h1\\\",\\\"yes\\\"),this.includeHeaderMap.h2=\\\"yes\\\"===this.getAttribute(\\\"h2\\\",\\\"yes\\\"),this.includeHeaderMap.h3=\\\"yes\\\"===this.getAttribute(\\\"h3\\\",\\\"yes\\\"),this.includeHeaderMap.h4=\\\"yes\\\"===this.getAttribute(\\\"h4\\\",\\\"yes\\\"),this.includeHeaderMap.h5=\\\"yes\\\"===this.getAttribute(\\\"h5\\\",\\\"yes\\\"),this.includeHeaderMap.h6=\\\"yes\\\"===this.getAttribute(\\\"h6\\\",\\\"yes\\\"),this.scrollMode=this.getAttribute(\\\"scrollMode\\\",\\\"center\\\"),[\\\"start\\\",\\\"center\\\",\\\"end\\\",\\\"nearest\\\"].includes(this.scrollMode)||(this.scrollMode=\\\"center\\\")}render(e,i){if(this.parentDomNode=e,this.execute(),this.parentWidget.hasVariable(\\\"page-toc-recursion-detection\\\",\\\"yes\\\"))this.domNodes.push(e.appendChild(this.document.createTextNode(\\\"[Page TOC]\\\")));else{this.setVariable(\\\"page-toc-recursion-detection\\\",\\\"yes\\\");var s=$tw.utils.domMaker(this.tocNodeTag,{\\\"class\\\":this.tocNodeClass});this.domNodes.push(s);try{const o=this.getTOCInfo();if(o&&0!==o.headers.length)for(let e=0,t=o.headers.length;e{var e,t,i=null==(t=null==(e=null==(t=document.querySelector(`.tc-tiddler-frame[data-tiddler-title=\\\"${o.title.replace('\\\"','\\\\\\\\\\\"')}\\\"]`))?void 0:t.querySelectorAll)?void 0:e.call(t,\\\".tc-tiddler-body \\\"+d))?void 0:t[a];if(i)switch(this.scrollMode){case\\\"center\\\":case\\\"nearest\\\":i.scrollIntoView({behavior:\\\"smooth\\\",block:this.scrollMode});break;default:i.scrollIntoView({behavior:\\\"auto\\\",block:this.scrollMode}),\\\"end\\\"===this.scrollMode?(document.body.scrollTop+=100,document.scrollingElement&&(document.scrollingElement.scrollTop+=100)):(document.body.scrollTop-=100,document.scrollingElement&&(document.scrollingElement.scrollTop-=100))}}),s.appendChild(r)}else s.insertBefore($tw.utils.domMaker(this.tocHeaderNodeTag,{\\\"class\\\":this.tocHeaderNodeClassPrefix+\\\"empty\\\",text:this.emptyMessage}),i)}catch(t){console.error(t),s.textContent=String(t)}e.insertBefore(s,i)}}refresh(e){var t=this.computeAttributes();return 0<$tw.utils.count(t)||Object.hasOwnProperty.call(t,this.tocTitle)?(this.refreshSelf(),this.refreshChildren(e),!0):this.refreshChildren(e)}getTOCInfo(){if(\\\"\\\"!==this.tocTitle){var e=$tw.wiki.getTiddler(this.tocTitle);if(e){var e=e.fields.type||\\\"text/vnd.tiddlywiki\\\",t=(null==(t=$tw.config.contentTypeInfo[e])?void 0:t.deserializerType)||e;if(\\\"text/vnd.tiddlywiki\\\"===t||\\\"text/x-markdown\\\"===t){for(var i=[],s={h1:0,h2:0,h3:0,h4:0,h5:0,h6:0},e=$tw.wiki.parseTiddler(this.tocTitle).tree,t=$tw.wiki.makeWidget({tree:e}),e=$tw.fakeDocument.createElement(\\\"div\\\"),r=(t.render(e,null),[e]);0=5.1.22", 5 | "dependents": "$:/plugins/linonetwo/itonnote", 6 | "description": "ZX is a tool for writing better scripts, this plugin allows you to execute a tiddler with zx.", 7 | "list": "readme demo developer", 8 | "name": "ZX Script Executor", 9 | "plugin-type": "plugin", 10 | "stability": "STABILITY_1_EXPERIMENTAL", 11 | "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/zx-script/DecorateCoreCodeblockWidget\":{\"title\":\"$:/plugins/linonetwo/zx-script/DecorateCoreCodeblockWidget\",\"tags\":\"$:/tags/Global/View/Body\",\"text\":\"\\\\widget $codeblock(code, language)\\n<%if markdown md js javascript ts typescript bash zsh shell sh +[match] %>\\n <$set name=\\\"output-id\\\" filter=\\\"[sha256[]]\\\">\\n <$button class=\\\"code-block-zx-script-execution-button\\\">\\n {{$:/plugins/linonetwo/zx-script/zx-icon}}ZX\\n <$action-sendmessage $message=\\\"tm-zx\\\" code=<> language=<> id=<> />\\n \\n <$genesis $type=\\\"$codeblock\\\" $remappable=\\\"no\\\" code=<> language=<> />\\n \\n <$let output-title={{{ [addprefix[$:/state/linonetwo/zx-script/output/]] }}} >\\n <%if [is[tiddler]] %>\\n\\n \\n <$transclude $tiddler=<> />\\n\\n <$link to=<> />\\n <%endif%>\\n \\n \\n<%else%>\\n <$genesis $type=\\\"$codeblock\\\" $remappable=\\\"no\\\" code=<> language=<> />\\n<%endif%>\\n\\\\end\\n\"},\"$:/plugins/linonetwo/zx-script/OutputBar\":{\"title\":\"$:/plugins/linonetwo/zx-script/OutputBar\",\"tags\":\"$:/tags/ViewTemplate\",\"list-before\":\"$:/plugins/linonetwo/inverse-link-and-folder/infobar\",\"text\":\"<$let output-title={{{ [{!!title}addprefix[$:/state/linonetwo/zx-script/output/]] }}} >\\n <%if [is[tiddler]] %>\\n \\n <$transclude $tiddler=<> />\\n\\n <$link to=<> />\\n <%endif%>\\n\"},\"$:/plugins/linonetwo/zx-script/ViewToolbarButton\":{\"title\":\"$:/plugins/linonetwo/zx-script/ViewToolbarButton\",\"tags\":\"$:/tags/ViewToolbar\",\"list-before\":\"$:/core/ui/Buttons/close\",\"caption\":\"{{$:/plugins/linonetwo/zx-script/zx-icon}} {{$:/plugins/linonetwo/zx-script/zx-button-caption}}\",\"short-caption\":\"zx script executor\",\"description\":\"Run tiddler as ZX Script\",\"text\":\"\\\\whitespace trim\\n<%if [all[current]!has[plugin-type]] %>\\n <%if [all[current]field:type[application/javascript]] :else[all[current]search:text[```]] %>\\n <$button>\\n <$action-sendmessage $message=\\\"tm-zx\\\" title={{!!title}} field=\\\"text\\\"/>\\n <%if [match[yes]] %>\\n {{$:/plugins/linonetwo/zx-script/zx-icon}}\\n <%endif%>\\n <%if [match[yes]] %>\\n \\n {{$:/plugins/linonetwo/zx-script/zx-button-caption}}\\n \\n <%endif%>\\n \\n <%endif%>\\n<%endif%>\\n\"},\"$:/plugins/linonetwo/zx-script/demo\":{\"title\":\"$:/plugins/linonetwo/zx-script/demo\",\"text\":\"!! ZX JS script Demo\\n\\n```js\\nconsole.log(`!! Hi!`);\\n```\\n\\nResult will form a tiddler.\\n\\n```js\\nconsole.log(`\\nCode block:\\n\\n\\\\`\\\\`\\\\`js\\nconsole.log(\\\\`!! Hi!\\\\`);\\n\\\\`\\\\`\\\\`\\n`);\\n```\\n\\n!! Dynamic WikiText Demo\\n\\n```js\\nconst ramdomID = Math.random().toString(36).slice(2);\\nconst text = `
\\n\\tQuick Add\\n\\n\\t<$button>\\n\\t\\t<$action-sendmessage $message=\\\"tm-new-tiddler\\\" title=<> tags=\\\"${ramdomID}\\\" />\\n Add New Tiddler with ID ${ramdomID}\\n\\t\\n\\n
`\\n\\nconsole.log(text)\\n```\\n\\n!! Wiki Scripting Demo\\n\\n```js\\nconst exampleTitle = '$:/plugins/linonetwo/zx-script/style.css';\\n\\n// to write script execute in tiddlywiki context, start with this separator ↓\\n/** tw */\\n// You can use $tw.wiki.getTiddler to get tiddler data, and can use some variables from previous context\\nconst tiddlerData = $tw.wiki.getTiddler(exampleTitle);\\n// This script runs in the nodejs side, and you can't access some API from nodejs ↓ it will cause error\\n// $tw.notifier.display('$:/state/notification/asdf');\\n\\n// You can even add tiddler using the API! But this will be add to the nodejs side, it will take a while to wait it sync to the browser side.\\n// $tw.syncadaptor.wiki.addTiddler({ title: 'asdf', text: 'aaa bbb' });\\n// You can't add state tiddler this way, they won't get sync to the browser. (nodejs wiki limitation)\\n// $tw.syncadaptor.wiki.addTiddler({ title: '$:/state/notification/asdf', text: 'aaa bbb' });\\n\\n// You can use console to print some data\\nconsole.log(tiddlerData.fields.type);\\n// You can assign some data to a variable, it can be used in next context\\nconst tiddlerDataString = JSON.stringify(tiddlerData);\\n\\n// ↓ If you end the block with separator, you can write script execute in zx environment again\\n/** tw */\\nconsole.log(`\\\\n!! Hi!\\\\n`);\\nconsole.log(tiddlerDataString);\\n```\\n\\n!!! DB and execution\\n\\nStart from v0.8.0-prerelease11 of [TidGi](https://github.com/tiddly-gittly/TidGi-Desktop/releases), it has a [better-sqlite3](https://github.com/WiseLibs/better-sqlite3/blob/master/docs/api.md) instance at `$tw.utils.Sqlite`. Which is accessible for server side plugin (TidGi is a launcher for nodejs wiki, so can run server side plugins) or zx script.\\n\\n```js\\n// pure nodejs context\\nconsole.log(`## Hi!`);\\nlet aaa = 3;\\n\\n/** tw */\\n\\n// now in worker_thread with $tw wiki access\\n\\nlet filterExample = $tw.wiki.filterOperators.sum((callback) => {callback({}, String(aaa));callback({}, String(aaa))})\\nconsole.log(filterExample)\\n\\n// use Sqlite\\nconst db = $tw.utils.Sqlite\\nconst stmt = db.prepare('SELECT title, text FROM tiddlers');\\nconst result = stmt.pluck().all()\\nconsole.log(result)\\n```\"},\"$:/plugins/linonetwo/zx-script/developer\":{\"title\":\"$:/plugins/linonetwo/zx-script/developer\",\"text\":\"!! Developer guide\\n\\n!!! Output\\n\\nWe place output of zx to a temporary tiddler, whose name start with \\\"$:/state/linonetwo/zx-script/output/\\\"\\n\\nAnd we get the name of this tiddler in wikitext using `[{!!title}addprefix[$:/state/linonetwo/zx-script/output/]`, so it can be transcluded with `{{{ }}}`\\n\\n!!! Batch execution\\n\\nYou can use message to programmatically execute any code:\\n\\n```tid\\n<$action-sendmessage $message=\\\"tm-zx\\\" code=<> language=<> id=<> />\\n```\\n\\nThe id should be an unique identifier, for example:\\n\\n```tid\\n<$set name=\\\"output-id\\\" filter=\\\"[sha256[]]\\\">\\n```\\n\\nRead [[$:/plugins/linonetwo/zx-script/DecorateCoreCodeblockWidget]] for how I use it.\\n\"},\"$:/plugins/linonetwo/zx-script/readme\":{\"title\":\"$:/plugins/linonetwo/zx-script/readme\",\"text\":\"!! Background\\n\\n[[google/zx|https://github.com/google/zx]] is a tool for writing better scripts, with Javascript.\\n\\nThis tiddlywiki plugin enables you to run any tiddler with zx.\\n\\n!! Prerequisit\\n\\nThis plugin requires [[TidGi Desktop App|https://github.com/tiddly-gittly/TidGi-Desktop]] environment to function properly. It will send tiddler content to the `zx` inside TidGi, and prints the output.\\n\\n!! Basic Usage\\n\\n!!! Button\\n\\nA ViewToolbar button is added. You can click on it to execute the script inside your tiddler.\\n\\nAnd the zx output will be printed below your tiddler content.\\n\\nTiddler with title extension `*.js *.md *.mjs` can be execute without problem. Other tiddler witout extension (no `.xxx`) will be executed as `*.md` file, for example, tid file without extions will be executed as `*.md`, but it works without problem too, even you are writing wiki text instead of markdown.\\n\\nIf you add filetype `application/javascript` to your tiddler, it will be recognized as `*.mjs`.\\n\\n!!! Codeblock\\n\\nAn execution button is added to the codeblock widget, if language is supported.\\n\\n```js\\nconsole.log(`!! Hi!`);\\n```\\n\\nSee [[$:/plugins/linonetwo/zx-script/demo]] for demo of full tiddler execution.\\n\\n!! Wiki Scripting\\n\\n!!! Execute the code block on the $tw context\\n\\nYou can write some code that is surrounded with `/** tw */` separator. They will be recognized as js code and executed on the context that have access to the $tw api.\\n\\nSee [[$:/plugins/linonetwo/zx-script/demo]] for examples.\\n\\nGlobal variables you can use:\\n\\n* `$tw` try it in your [[developer tool|https://developer.mozilla.org/en-US/docs/Tools]] to play around!\\n* `_` [[lodash|https://lodash.com/docs/]]\\n\\nThis means you can fetch some data on the zx script, and write the results to the wiki, creating new tiddlers.\\n\\n!!! Access filter and macros\\n\\nFilter function's call example is\\n\\n```js\\n/** tw */\\nconst result = $tw.wiki.filterOperators.sum((callback) => {callback({}, '2');callback({}, '2')})\\nconsole.log(result)\\n```\\n\\n!! Developer Documentation\\n\\nSee [[$:/plugins/linonetwo/zx-script/developer]]\\n\"},\"$:/plugins/linonetwo/zx-script/style.css\":{\"title\":\"$:/plugins/linonetwo/zx-script/style.css\",\"text\":\".code-block-zx-script-execution-button{position:absolute;right:0;transform:translate(-100%,0);opacity:.3}.code-block-zx-script-execution-button:hover{opacity:.8}.code-block-zx-script-execution-button:active{opacity:1}article.zx-script-output{display:flex;flex-direction:column}\",\"tags\":\"$:/tags/Stylesheet\",\"type\":\"text/css\"},\"$:/plugins/linonetwo/zx-script/zx-button-caption\":{\"title\":\"$:/plugins/linonetwo/zx-script/zx-button-caption\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"ZX Script\"},\"$:/plugins/linonetwo/zx-script/zx-icon\":{\"title\":\"$:/plugins/linonetwo/zx-script/zx-icon\",\"tags\":\"$:/tags/Image\",\"text\":\"\"},\"$:/plugins/linonetwo/zx-script/zx-message.js\":{\"title\":\"$:/plugins/linonetwo/zx-script/zx-message.js\",\"type\":\"application/javascript\",\"module-type\":\"startup\",\"Modern.TiddlyDev#Origin\":\"zx-message.ts\",\"text\":\"\\\"use strict\\\";function execute(e,i,a=\\\"text/vnd.tiddlywiki\\\",n,s){if(\\\"observables\\\"in window){let t=e.replaceAll(/[$/:]/g,\\\"-\\\");if(!t.endsWith(\\\".mjs\\\")&&!t.endsWith(\\\".js\\\")&&!t.endsWith(\\\".md\\\"))switch(a){case\\\"text/vnd.tiddlywiki\\\":case\\\"text/plain\\\":case\\\"text/markdown\\\":case\\\"text/x-markdown\\\":case\\\"text/html\\\":t+=\\\".md\\\";break;case\\\"text/x-shellscript\\\":i=i.split(\\\"\\\\n\\\").map(t=>\\\"await $`\\\".concat(t.trim(),\\\"`;\\\")).join(\\\"\\\\n\\\"),t+=\\\".mjs\\\";break;case\\\"application/typescript\\\":t+=\\\".ts\\\";break;default:t+=\\\".mjs\\\"}n(),window.observables[\\\"native\\\"].executeZxScript$({fileContent:i,fileName:t}).subscribe(s)}}function executeOnTiddler(t,e=\\\"text\\\"){if(t){var i=$tw.wiki.getTiddler(t),a=(null==i?void 0:i.fields.type)||\\\"text/vnd.tiddlywiki\\\",i=(null==i?void 0:i.fields[e])||\\\"\\\";const n=\\\"$:/state/linonetwo/zx-script/output/\\\".concat(t);execute(t,i,a,()=>{$tw.wiki.setText(n,\\\"text\\\",void 0,\\\"\\\")},t=>{var e=$tw.wiki.getTiddlerText(n);$tw.wiki.setText(n,\\\"text\\\",void 0,\\\"\\\".concat(null!=e?e:\\\"\\\",\\\"\\\\n\\\").concat(null!=t?t:\\\"\\\")),$tw.wiki.setText(n,\\\"type\\\",void 0,\\\"text/vnd.tiddlywiki\\\")})}}function executeOnAnyCode(t,e,i=\\\"application/javascript\\\"){if(t){const a=\\\"$:/state/linonetwo/zx-script/output/\\\".concat(t);execute(\\\"zx-tmp-\\\".concat(t),e,i,()=>{$tw.wiki.setText(a,\\\"text\\\",void 0,\\\"\\\")},t=>{var e=$tw.wiki.getTiddlerText(a);$tw.wiki.setText(a,\\\"text\\\",void 0,\\\"\\\".concat(null!=e?e:\\\"\\\",\\\"\\\\n\\\").concat(null!=t?t:\\\"\\\")),$tw.wiki.setText(a,\\\"type\\\",void 0,\\\"text/vnd.tiddlywiki\\\")})}}exports.name=\\\"zx-message\\\",exports.platforms=[\\\"browser\\\",\\\"node\\\"],exports.after=[\\\"startup\\\"],exports.synchronous=!0,exports.startup=function(){$tw.rootWidget.addEventListener(\\\"tm-zx\\\",function(e){var i,a=null==(a=e.paramObject)?void 0:a.title;if(a)return executeOnTiddler(a,null==(a=e.paramObject)?void 0:a.field),!1;var a=null==(a=e.paramObject)?void 0:a.id,n=null==(n=e.paramObject)?void 0:n.code;if(a&&n){let t=(null==(i=e.paramObject)?void 0:i.mime)||\\\"text/vnd.tiddlywiki\\\";switch(null==(i=e.paramObject)?void 0:i.language){case\\\"markdown\\\":case\\\"md\\\":t=\\\"text/x-markdown\\\";break;case\\\"js\\\":case\\\"javascript\\\":t=\\\"application/javascript\\\";break;case\\\"ts\\\":case\\\"typescript\\\":t=\\\"application/typescript\\\";break;case\\\"bash\\\":case\\\"zsh\\\":case\\\"shell\\\":case\\\"sh\\\":t=\\\"text/x-shellscript\\\"}return executeOnAnyCode(a,n,t),!1}return!0})};\"}}}", 12 | "title": "$:/plugins/linonetwo/zx-script", 13 | "type": "application/json", 14 | "version": "1.0.0", 15 | "Modern.TiddlyDev#SHA256-Hashed": "a6d1f1d5e399af7b036dc169691f6217b152f9965647639d3680c219aac5b4c2" 16 | } 17 | ] --------------------------------------------------------------------------------