1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-02-12 21:19:50 +00:00

Compare commits

..

312 Commits

Author SHA1 Message Date
webplusai
c7dc21aa81 #8868 add login button in header for guest user (#8874) 2025-01-08 13:00:54 +00:00
Jeremy Ruston
19e341c760 Add support for Node.js integrated sqlite
Available in Node.js 22.50 - see https://nodejs.org/api/sqlite.html

Given the Node.js release timeline, I think it will be reasonable to switch to the integrated Node.js sqlite as the default, which will avoid all the npm install kerfuffle too.
2025-01-08 12:47:40 +00:00
Jeremy Ruston
739ba3288b Merge branch 'master' into multi-wiki-support 2025-01-08 12:26:37 +00:00
webplusai
b4583ef9c5 #8867 add login as guest button (#8873) 2024-12-29 17:46:06 +00:00
webplusai
2a9f646ec4 #8858 fix issue with anonymous wiki access (#8869) 2024-12-25 09:29:19 +00:00
webplusai
6d448499c7 #8856 fix profile button rendering for guest users (#8865) 2024-12-24 12:02:10 +00:00
webplusai
b8f2800dab #8862 fix bug with ACL permissions (#8864) 2024-12-24 12:01:18 +00:00
webplusai
d72a4c9826 #8854 fix acl error in anon mode (#8857)
* #8854 fix acl error in anon mode

* #8854 fix test failure
2024-12-23 14:07:43 +00:00
webplusai
ddfc8c469c #8850 relocate Manage ACL button (#8852) 2024-12-23 10:25:33 +00:00
webplusai
faf5d6982e #8849 fixed 403 error on ACL page (#8851) 2024-12-23 10:15:54 +00:00
webplusai
1f1b785524 #8828 update mws documentation (#8848) 2024-12-23 08:30:20 +00:00
webplusai
1d65f0070c #8832 fixed blocked access to view wiki anonymously without admin account setup (#8847) 2024-12-23 08:27:46 +00:00
webplusai
0198eb2a1a #8832 fix favicon and access control issue (#8846) 2024-12-22 20:59:55 +00:00
webplusai
1c5648826e #8833 fix issue with multiple user sessions (#8845) 2024-12-22 20:59:01 +00:00
Jeremy Ruston
02a9fdcd06 Merge branch 'master' into multi-wiki-support 2024-12-21 09:47:47 +00:00
Jeremy Ruston
d0a3c79383 Add MWS documentation wiki 2024-12-21 09:47:14 +00:00
webplusai
e48ea2dbe6 #8818 fix default checkbox checked value issue on anon config modal (#8825) 2024-12-17 14:01:35 +00:00
Jeremy Ruston
060bea89ae Fix Jack's aspect ratio in the favicon 2024-12-14 12:40:07 +00:00
webplusai
67232aab15 Feature/#8812 anon access fix (#8815)
* #8812 resolve issue with anonymous access

* #8812 bug fix with anonymous access
2024-12-14 10:00:14 +00:00
webplusai
ae5bd9d4cd #8812 resolve issue with anonymous access (#8814) 2024-12-11 12:08:09 +00:00
webplusai
a00e3e79d6 #8774 fix add user form errors and error message clean up (#8813) 2024-12-10 20:24:02 +00:00
Jeremy Ruston
ab5a48747f Fix spelling of "anonymous" 2024-12-10 13:18:30 +00:00
Jeremy Ruston
239aacfa03 Fix streaming of attachment tiddlers from recipe URIs 2024-12-10 10:36:08 +00:00
Jeremy Ruston
e3ce053745 Fix attachment size check
I think this was introduced in #8455 sorry it took me so long to notice
2024-12-09 17:51:44 +00:00
Jeremy Ruston
2735ce23d8 Update dependencies 2024-12-09 17:24:30 +00:00
Jeremy Ruston
cb6c471967 Merge branch 'master' into multi-wiki-support 2024-12-09 17:19:31 +00:00
webplusai
8defedd611 #8771 fixed form reset issue on create user form (#8805) 2024-12-06 14:08:05 +00:00
webplusai
d7eb39c88e #8776 resolve server crash on delete role in use (#8796) 2024-12-05 12:29:58 +00:00
Jeremy Ruston
ac59af19dd Add some information about SQLite 2024-11-27 15:43:44 +00:00
webplusai
0cd2190ddf #8756 main page recipes (#8766) 2024-11-21 10:34:45 +00:00
webplusai
266b32bfee #8755 correct READ permission description (#8767) 2024-11-21 10:34:18 +00:00
webplusai
a697a664fa #8754 fix user edit form success/error message cleanup issue (#8764)
* #8754 fix issue with default user role on create, profile navigation issue

* #8754 fix user edit form success/error message cleanup issue
2024-11-20 08:10:36 +00:00
webplusai
9f48e75945 #8757 add exception handling to creating new users & roles functions (#8763) 2024-11-20 08:10:16 +00:00
webplusai
4dc2486d4b Fix issue with default user role on create, profile navigation issue (#8761) 2024-11-19 11:43:07 +00:00
Jeremy Ruston
d9256707f4 Add troubleshooting instructions 2024-11-18 12:25:07 +00:00
Jeremy Ruston
e85cfdefa6 Merge branch 'master' into multi-wiki-support 2024-11-18 11:08:43 +00:00
Jeremy Ruston
b198270cb5 Merge branch 'master' into multi-wiki-support 2024-11-18 09:53:48 +00:00
Jeremy Ruston
3836a5d08c Styles for the improvement banner 2024-11-17 18:06:54 +00:00
Jeremy Ruston
83f7b9023d Retain original tiddler paths to try to get the contribution banner working 2024-11-17 17:40:42 +00:00
Jeremy Ruston
9362121e8d Typo 2024-11-17 12:55:04 +00:00
Mario Pietsch
07c3081e7f [MWS] Move test dependencies to devDep. Update better-sqlite3 to latest (#8717)
* move test dependencies to devDep. Update better-sqlite3 to latest

* update Node version for workflow

* downgrade engines - node

* adjust wasm package
2024-11-17 10:35:49 +00:00
Jeremy Ruston
7c4d0d7f5e Docs: Add table of contents and custom palette 2024-11-16 12:35:04 +00:00
Jeremy Ruston
520188dc2b Tweak favicon 2024-11-16 08:53:20 +00:00
Jeremy Ruston
aa0d59e4ba Docs: Add basic system tiddlers 2024-11-15 21:34:47 +00:00
Jeremy Ruston
c1a441b7a1 Style tweak 2024-11-15 21:25:26 +00:00
Jeremy Ruston
0f558a1442 Move manage-acl page control into multiwikiclient plugin
@webplusai otherwise the control shows up for all wikis built with this version of the core, including those that don't include any MWS plugins. They get an "Undefined widget 'action-managetiddler'" error
2024-11-15 21:24:47 +00:00
Jeremy Ruston
31a7d648e5 Docs: Move documentation from plugin into multiwikidocs edition
@webplusai future docs updates should go to `editions/multiwikidocs`

By the way, it's worth noting that the recent updates in # 8748 were in Markdown syntax, which is slightly different from TiddlyWiki syntax. See the corrections here.
2024-11-15 21:04:15 +00:00
Jeremy Ruston
a6c5b86343 Docs: Copy content from tiddlywiki.com 2024-11-15 20:47:55 +00:00
Jeremy Ruston
ffbf24ae92 CI: We don't need to run the tests when building mws.tiddlywiki.com 2024-11-15 20:30:46 +00:00
webplusai
12e48af372 update multiwiki server documentation (#8748)
* mws authentication

* add more tests and permission checkers

* add logic to ensure that only authenticated users' requests are handled

* add custom login page

* Implement user authentication as well as session handling

* work on user operations authorization

* add middleware to route handlers for bags & tiddlers routes

* add feature that only returns the tiddlers and bags which the user has permission to access on index page

* refactor auth routes & added user management page

* fix Ci Test failure issue

* fix users list page, add manage roles page

* add commands and scripts to create new user & assign roles and permissions

* resolved ci-test failure

* add ACL permissions to bags & tiddlers on creation

* fix comments and access control list bug

* fix indentation issues

* working on user profile edit

* remove list users command & added support for database in server options

* implement user profile update and password change feature

* update plugin readme

* implement command which triggers protected mode on the server

* revert server-wide auth flag. Implement selective authorization

* ACL management feature

* Complete Access control list implementation

* Added support to manage users' assigned role by admin

* fix comments

* fix comment

* Add user profile management and account deletion functionality

* add success and error message feedback for user profile operations

* fix indentation issues

* Add command to create admin user if none exists when the start command is executed

* refactor annonymous user flow with create admin implementation

* remove mws-add-user from start command

* admin configuration for annonymous read-write opearations

* fix comments

* change get-anon handler to POST

* update multiwiki server documentation
2024-11-15 20:29:39 +00:00
Jeremy Ruston
f61a131119 Transparent background for favicon 2024-11-15 18:19:10 +00:00
Jeremy Ruston
8d53a37d34 Docs: Fix CI by including a favicon 2024-11-15 18:09:44 +00:00
Jeremy Ruston
386af03f6d Add multiwikidocs edition and CI to build it 2024-11-15 17:56:00 +00:00
Jeremy Ruston
8ac2730eb1 Merge branch 'master' into multi-wiki-support 2024-11-15 17:43:04 +00:00
webplusai
e873518d6f Admin configuration for anonymous read-write operations (#8736)
* mws authentication

* add more tests and permission checkers

* add logic to ensure that only authenticated users' requests are handled

* add custom login page

* Implement user authentication as well as session handling

* work on user operations authorization

* add middleware to route handlers for bags & tiddlers routes

* add feature that only returns the tiddlers and bags which the user has permission to access on index page

* refactor auth routes & added user management page

* fix Ci Test failure issue

* fix users list page, add manage roles page

* add commands and scripts to create new user & assign roles and permissions

* resolved ci-test failure

* add ACL permissions to bags & tiddlers on creation

* fix comments and access control list bug

* fix indentation issues

* working on user profile edit

* remove list users command & added support for database in server options

* implement user profile update and password change feature

* update plugin readme

* implement command which triggers protected mode on the server

* revert server-wide auth flag. Implement selective authorization

* ACL management feature

* Complete Access control list implementation

* Added support to manage users' assigned role by admin

* fix comments

* fix comment

* Add user profile management and account deletion functionality

* add success and error message feedback for user profile operations

* fix indentation issues

* Add command to create admin user if none exists when the start command is executed

* refactor annonymous user flow with create admin implementation

* remove mws-add-user from start command

* admin configuration for annonymous read-write opearations

* fix comments

* change get-anon handler to POST
2024-11-14 17:47:25 +00:00
webplusai
316bd65296 Add success and error message feedback for user profile operations (#8716)
* mws authentication

* add more tests and permission checkers

* add logic to ensure that only authenticated users' requests are handled

* add custom login page

* Implement user authentication as well as session handling

* work on user operations authorization

* add middleware to route handlers for bags & tiddlers routes

* add feature that only returns the tiddlers and bags which the user has permission to access on index page

* refactor auth routes & added user management page

* fix Ci Test failure issue

* fix users list page, add manage roles page

* add commands and scripts to create new user & assign roles and permissions

* resolved ci-test failure

* add ACL permissions to bags & tiddlers on creation

* fix comments and access control list bug

* fix indentation issues

* working on user profile edit

* remove list users command & added support for database in server options

* implement user profile update and password change feature

* update plugin readme

* implement command which triggers protected mode on the server

* revert server-wide auth flag. Implement selective authorization

* ACL management feature

* Complete Access control list implementation

* Added support to manage users' assigned role by admin

* fix comments

* fix comment

* Add user profile management and account deletion functionality

* add success and error message feedback for user profile operations

* fix indentation issues

* Add command to create admin user if none exists when the start command is executed

* refactor annonymous user flow with create admin implementation

* remove mws-add-user from start command
2024-11-08 10:09:42 +00:00
Jeremy Ruston
3a5f67d4f5 Update dependencies
Tests were breaking in GitHub Actions but work OK on my machine. Problem was better-sqlite3 not being prebuilt, so I am testing to see if an update helps.
2024-11-06 15:31:41 +00:00
Jeremy Ruston
ad901a9f50 Merge branch 'master' into multi-wiki-support 2024-11-06 15:20:44 +00:00
webplusai
c7531e53ab Add user profile management and account deletion functionality (#8712)
* mws authentication

* add more tests and permission checkers

* add logic to ensure that only authenticated users' requests are handled

* add custom login page

* Implement user authentication as well as session handling

* work on user operations authorization

* add middleware to route handlers for bags & tiddlers routes

* add feature that only returns the tiddlers and bags which the user has permission to access on index page

* refactor auth routes & added user management page

* fix Ci Test failure issue

* fix users list page, add manage roles page

* add commands and scripts to create new user & assign roles and permissions

* resolved ci-test failure

* add ACL permissions to bags & tiddlers on creation

* fix comments and access control list bug

* fix indentation issues

* working on user profile edit

* remove list users command & added support for database in server options

* implement user profile update and password change feature

* update plugin readme

* implement command which triggers protected mode on the server

* revert server-wide auth flag. Implement selective authorization

* ACL management feature

* Complete Access control list implementation

* Added support to manage users' assigned role by admin

* fix comments

* fix comment

* Add user profile management and account deletion functionality
2024-10-30 18:38:21 +00:00
webplusai
6a7612ddf8 MWS authentication (#8596)
* mws authentication

* add more tests and permission checkers

* add logic to ensure that only authenticated users' requests are handled

* add custom login page

* Implement user authentication as well as session handling

* work on user operations authorization

* add middleware to route handlers for bags & tiddlers routes

* add feature that only returns the tiddlers and bags which the user has permission to access on index page

* refactor auth routes & added user management page

* fix Ci Test failure issue

* fix users list page, add manage roles page

* add commands and scripts to create new user & assign roles and permissions

* resolved ci-test failure

* add ACL permissions to bags & tiddlers on creation

* fix comments and access control list bug

* fix indentation issues

* working on user profile edit

* remove list users command & added support for database in server options

* implement user profile update and password change feature

* update plugin readme

* implement command which triggers protected mode on the server

* revert server-wide auth flag. Implement selective authorization

* ACL management feature

* Complete Access control list implementation

* Added support to manage users' assigned role by admin

* fix comments

* fix comment
2024-10-30 17:59:44 +00:00
Jeremy Ruston
5d6ddaee7e Fix plugin bag names 2024-10-17 15:51:01 +01:00
Jeremy Ruston
d0575d6e8e Merge branch 'master' into multi-wiki-support 2024-10-17 13:19:19 +01:00
Jeremy Ruston
6dd6b7bef1 Refactor conditional function definitions
Function definitions within a condition do not function as expected thanks to JS hoisting, so it is better to avoid it, and keep ESLint happy as well.

See discussion at #8622 with @pmario
2024-09-30 15:28:37 +01:00
Jeremy Ruston
517dae8242 Merge branch 'master' into multi-wiki-support 2024-09-30 15:20:56 +01:00
Mario Pietsch
d0b5f413a4 MWS icon remove redundant paths (#8621) 2024-09-30 14:37:31 +01:00
Jeremy Ruston
6e7efeb126 Merge branch 'master' into multi-wiki-support 2024-09-20 13:58:19 +01:00
Jeremy Ruston
0f4f60f978 Fix load wiki folder command 2024-09-20 13:57:54 +01:00
Jeremy Ruston
a9c124cffd Whitespace clean up 2024-09-20 13:57:12 +01:00
Jeremy Ruston
4050ba5f92 Avoid optional chaining syntax
So that we can run on older Node.js versions
2024-09-11 19:22:29 +01:00
webplusai
b698b3e9cf revert playwright test (#8573) 2024-08-30 19:55:04 +01:00
webplusai
a930411cfd Handle directory creation if doesn't exist for test store (#8562)
* fix breaking bug in image tiddler attachment

* fix comments

* fix code format

* refactor processIncomingTiddler flow

* remove whitespaces after if statements

* refactor attachment_blob persistence flow

* refactor process tiddler to support different attachments

* add tests for attachment

* add more attachement test cases

* working on adding instanbul for test coverage report

* code coverage report generation

* remove unnecessary packages

* fix comments

* handle directory creation if doesn't exist for test store

* resolve issue with CI tests failure
2024-08-30 13:14:18 +01:00
Jeremy Ruston
90848a1e96 Change for the sake of CI 2024-08-29 10:00:08 +01:00
Jeremy Ruston
c73311684b Merge branch 'master' into multi-wiki-support 2024-08-28 17:17:22 +01:00
Jeremy Ruston
8a5a684218 Clean ups from #8456 2024-08-28 17:16:35 +01:00
webplusai
3287dce40c MWS: fix editing attachment tiddlers (#8455)
* fix breaking bug in image tiddler attachment

* fix comments

* fix code format

* refactor processIncomingTiddler flow

* remove whitespaces after if statements

* refactor attachment_blob persistence flow

* refactor process tiddler to support different attachments

* add tests for attachment

* add more attachement test cases

* working on adding instanbul for test coverage report

* code coverage report generation

* remove unnecessary packages

* fix comments
2024-08-28 17:13:52 +01:00
Jeremy Ruston
eac8a2c3d8 Merge branch 'master' into multi-wiki-support 2024-08-27 09:19:00 +01:00
Jeremy Ruston
535c440741 Remove extraneous storylist tiddler 2024-08-22 11:58:10 +01:00
Jeremy Ruston
9eb28a0e5f Merge branch 'master' into multi-wiki-support 2024-08-22 11:57:38 +01:00
Jeremy Ruston
edc32c5262 Merge branch 'master' into multi-wiki-support 2024-08-19 13:11:04 +01:00
Jeremy Ruston
6492ed36bf Merge branch 'master' into multi-wiki-support 2024-08-06 21:38:38 +01:00
Jeremy Ruston
2819b53c04 Merge branch 'master' into multi-wiki-support 2024-07-31 14:03:38 +01:00
Jeremy Ruston
adb2ffcd4d Update package.json 2024-07-31 14:03:35 +01:00
Jeremy Ruston
97db75e741 Merge branch 'master' into multi-wiki-support 2024-07-26 14:00:34 +01:00
Jeremy Ruston
066771e6e9 Allow attachment handling to be switched off 2024-07-16 10:32:34 +01:00
Jeremy Ruston
b4664bd7d1 getBagTiddlerStream should return bagname 2024-07-16 10:31:13 +01:00
Jeremy Ruston
882438db14 Merge branch 'master' into multi-wiki-support 2024-07-15 20:58:31 +01:00
Jeremy Ruston
e9f314579d Fix failing tests 2024-07-10 14:42:56 +01:00
Jeremy Ruston
9e2962b24e Merge branch 'master' into multi-wiki-support 2024-07-10 14:37:30 +01:00
Jeremy Ruston
5b53a14903 Use $tw.utils.encodeURIComponentExtended for consistency with encodeuricomponent operator 2024-07-10 13:16:47 +01:00
poc2go
39b7a4fb71 Adds 'created' field to attachment meta.json file (#8356) 2024-07-09 16:35:18 +01:00
Jeremy Ruston
f1d0e52ff7 New commands 2024-07-05 18:40:59 +01:00
Jeremy Ruston
d1edf6424d Merge branch 'master' into multi-wiki-support 2024-07-05 16:52:41 +01:00
Jeremy Ruston
e9cbb51f68 Merge branch 'master' into multi-wiki-support 2024-06-28 14:55:50 +01:00
Jeremy Ruston
0ff3875b8a Update readme.tid 2024-06-24 11:42:59 +01:00
Jeremy Ruston
38e1ea8f90 Merge branch 'master' into multi-wiki-support 2024-06-22 16:56:46 +01:00
Jeremy Ruston
2b2fd4bdb7 Merge branch 'master' into multi-wiki-support 2024-06-08 14:59:17 +01:00
Jeremy Ruston
b8f463d8ba Merge branch 'master' into multi-wiki-support 2024-05-31 22:39:14 +01:00
Jeremy Ruston
3f30cb4991 Merge branch 'master' into multi-wiki-support 2024-05-31 14:05:30 +01:00
Jeremy Ruston
049951e269 Merge branch 'master' into multi-wiki-support 2024-05-31 13:46:36 +01:00
Jeremy Ruston
3c36e4bd55 Merge branch 'master' into multi-wiki-support 2024-05-31 13:32:53 +01:00
Jeremy Ruston
d03ad0bca6 Merge branch 'master' into multi-wiki-support 2024-05-29 21:42:34 +01:00
Jeremy Ruston
109d92ae68 Update readme 2024-05-28 15:36:34 +01:00
Jeremy Ruston
e396334b20 Disable SSE by default
The current implementation is still broken, and actually more broken than it was before a37d50166f.

It seems that we should be exposing the SSE events to the syncer so that the resulting updates can be handled by the syncers existing task scheduler
2024-05-28 13:15:34 +01:00
Jeremy Ruston
d8fd9af63a Fix string vs. number confusion for revisions 2024-05-28 09:08:17 +01:00
Jeremy Ruston
9b6d677726 Fix revision comparisons 2024-05-27 17:33:27 +01:00
Jeremy Ruston
a37d50166f Tentative fix for SSE issue
See https://github.com/Jermolene/TiddlyWiki5/pull/7915#issuecomment-2124341900
2024-05-27 15:01:15 +01:00
Jeremy Ruston
b4564e31bd Merge branch 'master' into multi-wiki-support 2024-05-26 10:40:19 +01:00
Jeremy Ruston
33fb857d6b Merge branch 'master' into multi-wiki-support 2024-05-22 15:42:22 +01:00
Jeremy Ruston
4c2c7266d7 Make usage of SSE be configurable 2024-05-22 10:39:02 +01:00
Jeremy Ruston
3c7f06009b Temporarily Disable SSE 2024-05-22 10:33:35 +01:00
Jeremy Ruston
87f4a525f8 Mark MWS plugins as experimental 2024-05-21 12:07:01 +01:00
Jeremy Ruston
92a1c56d31 Merge branch 'master' into multi-wiki-support 2024-05-21 12:05:26 +01:00
Jeremy Ruston
d8eb5cb459 Merge branch 'master' into multi-wiki-support 2024-05-20 14:42:11 +01:00
Jeremy Ruston
268aaebaf0 Logging 2024-04-16 14:51:26 +01:00
Jeremy Ruston
ea318bab6e Fix file separator for Windows 2024-04-16 13:47:15 +01:00
Jeremy Ruston
aafe775779 Debugging 2024-04-16 12:49:09 +01:00
Jeremy Ruston
129bbe421c Debugging 2024-04-16 12:45:35 +01:00
Jeremy Ruston
471ba99a5d Debugging 2024-04-16 12:43:41 +01:00
Jeremy Ruston
516a17a6f0 More debugging 2024-04-16 12:41:50 +01:00
Jeremy Ruston
2e4980bb97 Add some error checking 2024-04-16 12:38:05 +01:00
Jeremy Ruston
db9978f8c2 Syncer should only save existing tiddlers if they have changed 2024-04-16 11:59:52 +01:00
Jeremy Ruston
cc4cb04900 Turn on WAL mode for better-sqlite3 2024-04-14 19:12:21 +01:00
Jeremy Ruston
9ba4556250 Add support for the plugin library
We create a system bag to contain each plugin/theme/language. It seems wasteful because it results in lots of bags, but the semantics are exactly right and so it seems like the right approach
2024-04-14 18:41:34 +01:00
Jeremy Ruston
131a5abeb8 Protect against syncing client state tiddlers to the server
The default sync filter omits $:/state/, but users can customise it
2024-04-12 10:58:45 +01:00
Jeremy Ruston
ce79a4add8 Add bag indicator to tiddler info panel 2024-04-12 10:28:26 +01:00
Jeremy Ruston
28a831489b Merge branch 'master' into multi-wiki-support 2024-04-12 09:59:12 +01:00
Jeremy Ruston
51cdca6841 Merge branch 'master' into multi-wiki-support 2024-04-03 21:51:51 +01:00
Jeremy Ruston
d51ad80f80 Incoming updates filter should exclude tiddlers prefixed $:/StoryList and $:/HistoryList
Thanks @pmario
2024-03-28 17:32:10 +00:00
Jeremy Ruston
ad528d6b1f Fix get wiki crash when serving a recipe with no tiddlers in it
Fixes #8110
2024-03-27 14:41:03 +00:00
Jeremy Ruston
f2947e73b3 Filter updates from the server
We don't want $:/StoryList etc.
2024-03-26 17:16:14 +00:00
Jeremy Ruston
baee0bb301 Fix broken updating of last_known_tiddler_id from streamed data 2024-03-26 12:25:49 +00:00
Jeremy Ruston
8a2111f150 Update GettingStarted 2024-03-26 12:25:13 +00:00
Jeremy Ruston
fcffff3964 npm start should use mws-listen 2024-03-25 22:38:10 +00:00
Jeremy Ruston
cca1f21d02 Undo unneeded changes to image widget 2024-03-25 22:35:42 +00:00
Jeremy Ruston
37f6930bf2 Quit command should abort any pending commands 2024-03-25 22:33:41 +00:00
Jeremy Ruston
4b1affee50 Load streamed tiddlers immediately, rather than scheduling a load 2024-03-25 17:49:34 +00:00
Jeremy Ruston
464d17b522 Update last known tiddler ID for events delivered via SSE 2024-03-25 17:43:29 +00:00
Jeremy Ruston
d1bb7159b8 Expose the connection status in the UI 2024-03-25 17:07:36 +00:00
Jeremy Ruston
b58cfe6324 SSE client: better state management to avoid multiple connections 2024-03-25 16:43:41 +00:00
Jeremy Ruston
7a0c43436f First pass at SSE support 2024-03-25 08:36:42 +00:00
Jeremy Ruston
708e21951f Fix syncing 2024-03-24 21:15:59 +00:00
Jeremy Ruston
8198574087 Remove code that is unneeded for the moment 2024-03-24 21:15:31 +00:00
Jeremy Ruston
6c9b92400e GET recipes/name/tiddlers.json should use include_deleted parameter 2024-03-24 18:32:56 +00:00
Jeremy Ruston
8091db37e8 Merge branch 'master' into multi-wiki-support 2024-03-23 17:32:03 +00:00
Jeremy Ruston
e66b67dedc Only turn binary tiddlers into attachments 2024-03-23 09:54:15 +00:00
Jeremy Ruston
a2012dcff8 Typo in comment 2024-03-23 09:54:03 +00:00
Jeremy Ruston
08649dd1eb More efficient syncing
Thank you @PotOfCoffee2Go I ended up taking some of your code from #8101 to get this up and running. There's still some stuff missing (like the tests!) but it gets things moving.
2024-03-23 09:27:54 +00:00
Jeremy Ruston
52f76380c7 Remove code relating to revision and bag as fields 2024-03-22 17:58:52 +00:00
Jeremy Ruston
1f63bcbbd0 Remove some templates that are no longer needed 2024-03-20 19:24:21 +00:00
Jeremy Ruston
3aa5607a3a Stop storing bag and revision details as tiddler fields
Instead we store them as dictionary tiddlers
2024-03-20 19:22:12 +00:00
Jeremy Ruston
eaebeb87c9 Include bagname in tiddler Etags 2024-03-20 18:52:54 +00:00
Jeremy Ruston
808b94468e Fix multipart form data POST test 2024-03-20 18:52:37 +00:00
Jeremy Ruston
60e6c8bcb2 Fix etag handling 2024-03-20 17:56:47 +00:00
Jeremy Ruston
891f0fd599 Fix page body class in static pages
So that we get the TW background colour
2024-03-20 17:55:50 +00:00
Jeremy Ruston
6154de0d2c Rename misnamed route 2024-03-20 15:53:49 +00:00
Jeremy Ruston
cae9dbf5d1 Fix colours in static renderings 2024-03-20 15:51:58 +00:00
Jeremy Ruston
ae8ef305fa Get rid of those annoying missing image icons
By adding a `?fallback=url` parameter to tiddler requests
2024-03-20 15:40:38 +00:00
Jeremy Ruston
9b3ca525ee Introduce multiwikiclient plugin
Routes are now rationalised, too.
2024-03-20 15:13:50 +00:00
Jeremy Ruston
38ee942d8f Don't do full debug logging during tests 2024-03-20 15:12:35 +00:00
Jeremy Ruston
957329d515 Add store directories to gitignore 2024-03-20 13:10:30 +00:00
Jeremy Ruston
6063256439 Create new static index route with ability to create/update bags and recipes
Also introduces a new /.system/filename route for stylesheets, scripts etc.
2024-03-20 09:44:52 +00:00
Jeremy Ruston
1c64646393 Fix quit command to work gracefully 2024-03-19 10:04:32 +00:00
Jeremy Ruston
259b3dca1b Add a new static index route 2024-03-18 22:26:24 +00:00
Jeremy Ruston
6a673e6aea Stop syncing state tiddlers to the admin wiki 2024-03-18 21:08:48 +00:00
Jeremy Ruston
f606e33415 Stop using the existing core server infrastructure
Too much of a constraint now that we're starting work on client-server sync
2024-03-18 08:44:45 +00:00
Jeremy Ruston
09de91940e Typo 2024-03-17 19:30:22 +00:00
Jeremy Ruston
3d485f0706 Expose tiddler_ids in bag and recipe listings 2024-03-17 16:34:45 +00:00
Jeremy Ruston
7eaa9b8aec Database methods that mutate tables should return IDs 2024-03-17 15:06:36 +00:00
Jeremy Ruston
faa4b9700a More consistent variable naming 2024-03-17 14:54:06 +00:00
Jeremy Ruston
dea739ff07 Introduce delete markers for deleted tiddlers 2024-03-17 14:18:47 +00:00
Jeremy Ruston
69cc45bf5c Refactor the database engine specific code 2024-03-17 13:27:00 +00:00
Jeremy Ruston
347aa4d546 Tests should cover tiddler_ids 2024-03-17 13:07:24 +00:00
Jeremy Ruston
b4855b25c4 Merge branch 'master' into multi-wiki-support 2024-03-16 22:06:02 +00:00
Jeremy Ruston
d518675e03 Get rid of some console.logs 2024-03-15 16:49:24 +00:00
Jeremy Ruston
9b59ae2b73 Add an HTTP test for multipart form data upload 2024-03-15 16:40:22 +00:00
Jeremy Ruston
f67573315e POST /wiki/:bag_name/bags/:bag_name/tiddlers/ should also return JSON 2024-03-15 16:39:59 +00:00
Jeremy Ruston
501f57499e Update readme 2024-03-14 12:25:11 +00:00
Jeremy Ruston
2916cb6fd9 Clarify comment
Thanks @pmario
2024-03-14 11:55:55 +00:00
Jeremy Ruston
e553539b2a Clarify that process.exit() is a hack 2024-03-13 22:12:41 +00:00
Jeremy Ruston
3da773c27f Add HTTP tests to npm test command 2024-03-13 18:39:42 +00:00
Jeremy Ruston
b923be5e94 Merge branch 'master' into multi-wiki-support 2024-03-13 18:03:35 +00:00
Jeremy Ruston
c9ab184c65 TODOs before merging 2024-03-12 21:32:22 +00:00
Jeremy Ruston
bc45a16f40 Fix readme build 2024-03-12 21:21:49 +00:00
Jeremy Ruston
8b6642b56d Update the root readme that is visible on GitHub 2024-03-12 17:33:07 +00:00
Jeremy Ruston
d6807cb471 Update MWS plugin readme 2024-03-12 17:32:54 +00:00
Jeremy Ruston
f9064428c5 Add npm start command 2024-03-12 17:32:35 +00:00
Jeremy Ruston
a443e5f0ad Add new command to test local or remote server via HTTP 2024-03-11 21:52:40 +00:00
Jeremy Ruston
24413c53dd The listen command shouldn't return until the server is listening 2024-03-11 21:45:27 +00:00
Jeremy Ruston
8b5c3746f8 Refactor command module filenames 2024-03-11 09:40:40 +00:00
Jeremy Ruston
9df625c44d Reorganise JS modules into subdirectories 2024-03-11 09:10:01 +00:00
Rob Hoelz
54ff0446c6 MWS: store level tests (#8021)
* Fix a few typos

The "database instead of store" change isn't a typo fix, per se, but
these tests are testing the lower-level database layer, and I'm about
to introduce some tests for the higher-level store layer, so I want to
avoid any confusion in the test names

* Start on SQL store-level tests

* Add some tests for createBag

* Add test for getBagTiddler and getBagTiddlers

* Add basic recipe tests

* Add a test for saving a tiddler within a recipe

* Add store test for deleteTiddler
2024-03-11 09:01:43 +00:00
Jeremy Ruston
0f5dfb89ad Refactor multipart form handling for more reusability 2024-03-10 20:20:06 +00:00
Jeremy Ruston
e3b27768d2 Update comment 2024-03-10 20:19:41 +00:00
Jeremy Ruston
580283433e Remove unneeded highlight plugin from multiwikiserver edition 2024-03-10 18:07:02 +00:00
Jeremy Ruston
f4ac2b92e7 Remove unneeded plugins from tw5.com edition 2024-03-10 18:06:44 +00:00
Jeremy Ruston
e35584843d Fix mws-save-archive command name 2024-03-10 18:06:26 +00:00
Jeremy Ruston
3335e87ef4 Remove unneeded option 2024-03-10 17:49:52 +00:00
Jeremy Ruston
abde67e5df MWS: Add support for large tiddlers to be stored as attachment files
Fixes #8022
2024-03-10 17:45:33 +00:00
Jeremy Ruston
2ba3643a0c Merge branch 'master' into multi-wiki-support 2024-03-07 08:26:10 +00:00
Jeremy Ruston
89ae2012c7 Merge branch 'master' into multi-wiki-support 2024-03-04 14:14:06 +00:00
Jeremy Ruston
8a209d643f Fix typo 2024-03-01 18:58:17 +00:00
Jeremy Ruston
1a28ec7ea4 Rename upload manager to multipart form manager 2024-02-28 18:36:19 +00:00
Jeremy Ruston
5fe41fc896 Reorder test tiddlers 2024-02-28 18:19:22 +00:00
Jeremy Ruston
4f9ff1ae81 Missed closing tag 2024-02-28 18:19:01 +00:00
Jeremy Ruston
d97ddf1eec Merge branch 'master' into multi-wiki-support 2024-02-28 18:04:45 +00:00
Jeremy Ruston
9facf4a067 Fix incorrect encoding of description when creating bags and recipes 2024-02-28 17:46:19 +00:00
Rob Hoelz
de4fe132a7 Unconditionally decrement transaction depth (#8008)
…otherwise we may end up in a situation where we're always stuck in an
"already in a transaction" state and often neglect to actually enter a
real transaction!
2024-02-26 11:02:55 +00:00
Jeremy Ruston
d7d0733177 Remove accidentally committed database file
Thanks @hoelzro
2024-02-25 22:27:36 +00:00
Jeremy Ruston
e614e291a2 Default to better-sqlite3 2024-02-25 18:08:59 +00:00
Jeremy Ruston
dd9a3bfeeb Re-enable loading the tw5.com docs tiddlers 2024-02-25 18:04:54 +00:00
Jeremy Ruston
83229ace63 Add a config tiddler for selecting the SQLite engine 2024-02-25 18:04:43 +00:00
Jeremy Ruston
6724fa804b Run the tests on both node-sqlite3-wasm and better-sqlite3 2024-02-25 17:58:53 +00:00
Jeremy Ruston
630b98520f Add note about transaction handling 2024-02-25 09:48:24 +00:00
Jeremy Ruston
1c0341de51 Merge branch 'master' into multi-wiki-support 2024-02-24 09:38:42 +00:00
Jeremy Ruston
d5aa74d9af Improve manual transaction handling
Thanks @hoelzro
2024-02-24 09:31:59 +00:00
Jeremy Ruston
343cc33bbe Add a test tiddler with emoji title
Useful for testing
2024-02-24 09:30:20 +00:00
Jeremy Ruston
b1edbed6a5 Fix bag static HTML to show emoji correctly 2024-02-23 17:47:00 +00:00
Jeremy Ruston
066e553f84 Introduce command to load tiddler folders into a bag 2024-02-23 12:51:29 +00:00
Jeremy Ruston
61b54125be Rename mws-load|save to mws-load|save-archive 2024-02-23 12:51:07 +00:00
Jeremy Ruston
3276703edd Fix failing tests 2024-02-23 09:30:12 +00:00
Jeremy Ruston
f9265169fd Commands to load and save tiddlers, bags and recipes as a JSON archive
@linonetwo the resulting archive should be suitable for storing in git
2024-02-23 09:27:53 +00:00
Jeremy Ruston
2361880c45 createBag should optionally set access control data 2024-02-23 09:26:45 +00:00
Jeremy Ruston
3ad87df154 Allow wiki engine to be configured 2024-02-22 17:58:30 +00:00
Jeremy Ruston
3c58788e37 Merge branch 'master' into multi-wiki-support 2024-02-22 17:39:51 +00:00
Jeremy Ruston
310b5f058a Whitespace 2024-02-22 12:13:53 +00:00
Jeremy Ruston
a33705e348 Fix error
It appears that not all statements can be finalized.
2024-02-22 12:09:36 +00:00
Jeremy Ruston
3fca82321e MWS: Add support for node-sqlite-wasm alongside better-sqlite3 (#7996)
* Switch from better-sqlite3 to node-sqlite3-wasm

Seems to be slower, but might make cloud deployments easier by not having any binary dependencies

* More logging

* Temporarily use a memory database

We will make this configurable

* Revert "More logging"

* Resume loading demo tiddlers

* Cache prepared statements

Gives a 20% reduction in startup time on my machine

* Some more logging

* Update package-lock

* More logging

* Route regexps should allow for proxies that automatically decode URLs

Astonishingly, Azure does this

* Go back to a file-based database

* Less logging

* Update package-lock.json

* Simplify startup by not loading the docs edition

* Tiddler database layer should mark statements as having been removed

* Re-introduce better-sqlite3

* Make the SQLite provider be switchable

* Support switchable SQL engines

I am not intending to make this a long term feature. We will choose one engine and stick with it until we choose to change to another.

* Adjust dependency versions

* Setting up default engine

* Make transaction handling compatible with node-sqlite3-wasm

https://github.com/tndrle/node-sqlite3-wasm doesn't have transaction support so I've tried to implement it using SQL statements directly.

@hoelzro do you think this is right? Should we be rolling back the transaction in the finally clause? It would be nice to have tests in this area...

I looked at better-sqlite3's implementation - https://github.com/WiseLibs/better-sqlite3/blob/master/lib/methods/transaction.js

* Default to better-sqlite3 for compatibility after merging
2024-02-22 11:57:41 +00:00
Rob Hoelz
790f431df0 MWS: Use transactions when modifying multiple resources (#7991)
* Use transactions when modifying multiple resources

This prevents partial changes from entering the database, and also
nets a nice speed-up.

* Keep track of transaction depth

…so we could someday potentially leverage SQL implementations that don't
implement nested transactions
2024-02-22 10:48:39 +00:00
Jeremy Ruston
0d22bf8418 Update to latest better-sqlite3 2024-02-22 10:47:08 +00:00
Jeremy Ruston
1eecfb6b3a Less logging 2024-02-21 17:55:13 +00:00
Jeremy Ruston
b8c1c6c8de Allow backslashes in trailing API path components
To make us more tolerant of proxies that "helpfully" decodeuricomponent for us (looking at you Azure)
2024-02-21 17:54:56 +00:00
Jeremy Ruston
6503fb4a04 Simple performance logging 2024-02-20 09:33:39 +00:00
Jeremy Ruston
bab14b7053 Logging 2024-02-19 16:29:14 +00:00
Jeremy Ruston
2d4b3341f6 Merge branch 'master' into multi-wiki-support 2024-02-19 09:55:57 +00:00
Jeremy Ruston
6f8a3b9261 mws-load command: more validation tiddler files 2024-02-16 16:41:39 +00:00
Jeremy Ruston
8edefffbc5 WIP: Support for streaming multipart form data to the file system 2024-02-16 16:02:40 +00:00
Jeremy Ruston
59b425fd5c Update to better-sqlite3 v9.4.1 2024-02-16 16:00:46 +00:00
Jeremy Ruston
f2267e2af0 Merge branch 'master' into multi-wiki-support 2024-02-16 15:58:08 +00:00
Jeremy Ruston
c26acfdb42 Add NOT NULL constraint to all columns
Thanks @hoelzro
2024-02-05 16:15:35 +00:00
Jeremy Ruston
f925f036c9 Introduce $tw.mws for MWS globals 2024-02-05 14:49:08 +00:00
Jeremy Ruston
2c810faeeb Add barebones support for timing HTTP response generation times 2024-02-02 15:42:47 +00:00
Jeremy Ruston
6675358e85 WIP: Add a multipart/form-data convenience function
This is the start of adding support for large attachments.

We have a new endpoint for POSTing tiddler data. The idea is that it will take any kind of data and figure out how to extract tiddlers from the upload and save them in the nominated bag.

The next step is to move the attachment files into a special folder and reference them from the database so that we can construct _canonical_uris for them.
2024-02-02 15:42:02 +00:00
Jeremy Ruston
262a730534 Move the database file into a "store" directory inside the wiki folder 2024-01-29 18:11:50 +00:00
Jeremy Ruston
4b6872aa42 Fix typo 2024-01-29 08:29:26 +00:00
Jeremy Ruston
3283d38867 First draft of a command to read tiddlers, bags and recipes from an archive
The archive format is a legacy format that I used with Xememex, and will need to be updated to iron out the wrinkles
2024-01-28 21:27:12 +00:00
Jeremy Ruston
4204ff367e A few more tests 2024-01-28 17:11:53 +00:00
Jeremy Ruston
51e646690c Allow tilde character in bag and recipe names 2024-01-28 17:11:44 +00:00
Jeremy Ruston
85607f7846 Query fixes 2024-01-28 17:11:23 +00:00
Jeremy Ruston
41a5bcc3a1 Fix canonical URI handling 2024-01-26 15:48:39 +00:00
Jeremy Ruston
84c8a9be9b Fix typo 2024-01-26 15:01:07 +00:00
Jeremy Ruston
62b2fe3e2f Add an error when creating a recipe with no bags 2024-01-26 14:42:43 +00:00
Jeremy Ruston
f5fdd79c7f Refresh when creating bags and recipes to get the change instantly 2024-01-26 14:42:17 +00:00
Jeremy Ruston
14752ccb0c Missing comma 2024-01-26 14:04:54 +00:00
Jeremy Ruston
541c166863 Error handling for bag and recipe handling 2024-01-26 14:03:32 +00:00
Jeremy Ruston
270f62bbb2 Merge branch 'master' into multi-wiki-support 2024-01-26 13:38:02 +00:00
Jeremy Ruston
8290d853c9 Merge branch 'master' into multi-wiki-support 2024-01-26 12:54:40 +00:00
Jeremy Ruston
b0a67300cc Add support for bag descriptions, validate bags and recipes, and complete the UI for creating bags and recipes
Styling to come
2024-01-24 22:24:24 +00:00
Jeremy Ruston
0b9749f3a4 Add favicon to bag listing page 2024-01-24 20:58:57 +00:00
Jeremy Ruston
3ad3e19392 Merge branch 'master' into multi-wiki-support 2024-01-24 16:21:58 +00:00
Jeremy Ruston
ed71adac7e Merge branch 'master' into multi-wiki-support 2024-01-24 12:54:39 +00:00
Jeremy Ruston
8d95c92bfb Use $:/state/ tiddler for server entity state tiddlers 2024-01-24 10:56:23 +00:00
Jeremy Ruston
41ab94978f Renaming tiddlers for consistency 2024-01-24 10:55:14 +00:00
Jeremy Ruston
26e198b7d8 First pass at MWS icon 2024-01-23 22:05:58 +00:00
Jeremy Ruston
d16746ab38 Extend image widget to support alternate content if a remote image fails to load
...and use it to add an image for bags/recipes that do not have a $:/favicon.ico
2024-01-23 22:05:22 +00:00
Jeremy Ruston
627c3e20cc Add docs bags 2024-01-23 16:53:12 +00:00
Jeremy Ruston
4d42d4a190 Escape less than sign
Otherwise tiddlers containing `</script>` will break TiddlyWiki
2024-01-23 16:52:49 +00:00
Jeremy Ruston
ff184822ca Don't wikify recipe descriptions 2024-01-23 16:52:11 +00:00
Jeremy Ruston
ddbd6d1e82 Fix favicon aspect ratio 2024-01-23 16:51:57 +00:00
Jeremy Ruston
f6d6478944 Add support for recipe descriptions 2024-01-23 14:29:50 +00:00
Jeremy Ruston
138c7f2665 Don't use the filesystem plugin
Otherwise changes to _multiwikiserver/ tiddlers are saved back to the file system

Perhaps it would work better to configure the wiki to sync state tiddlers to the browser.
2024-01-23 14:29:08 +00:00
Jeremy Ruston
239ace0c07 Avoid clients of sqlTiddlerStore having to call updateAdminWIki() explicitly 2024-01-23 12:53:06 +00:00
Jeremy Ruston
c1312100aa Admin UI styling 2024-01-23 12:52:40 +00:00
Jeremy Ruston
e343eccdc3 Refactor _canonical_uri handling out of route handlers 2024-01-23 10:51:12 +00:00
Jeremy Ruston
da5b316358 Split SqlTiddlerStore into SqlTiddlerStore and SqlTiddlerDatabase
The motivation is to encapsulate knowledge of the SQL queries
2024-01-22 22:08:55 +00:00
Jeremy Ruston
dc8692044c Use SQLite's AUTOINCREMENT to give us tiddler version identifiers
This commit fixes sync within hosted wikis
2024-01-21 18:18:29 +00:00
Jeremy Ruston
4f9ba11489 Update to newest better-sqlite3 2024-01-21 18:17:23 +00:00
Jeremy Ruston
f7914db019 Add bag and recipe favicons to dashboard 2024-01-20 21:50:12 +00:00
Jeremy Ruston
11ecaff7db Fix typo 2024-01-20 21:48:40 +00:00
Jeremy Ruston
d832bbcc70 Order the results of getRecipeTiddlers 2024-01-20 21:48:33 +00:00
Jeremy Ruston
59aed49e98 Make getRecipeTiddlers return the bagname as well 2024-01-20 20:22:46 +00:00
Jeremy Ruston
e9f83ca735 Add missing LIMIT 1 2024-01-19 22:03:07 +00:00
Jeremy Ruston
afa9ad3cde Update store.getRecipeTiddler to also return the bag from which the tiddler came 2024-01-19 20:35:47 +00:00
Jeremy Ruston
01d29ed11e get bag tiddler and put recipe tiddler should return the bag name 2024-01-19 20:12:29 +00:00
Jeremy Ruston
8f9ae7e4d5 Clarify method name 2024-01-19 19:52:57 +00:00
Jeremy Ruston
70b048f356 Fix bag links 2024-01-19 19:36:36 +00:00
Jeremy Ruston
5fddd3b104 Add support for retrieving tiddlers from bags 2024-01-19 19:33:58 +00:00
Jeremy Ruston
02afbb4000 Rename some of the routes more logically 2024-01-19 19:27:54 +00:00
Jeremy Ruston
54432485e7 Add an HTML view of bag listings 2024-01-19 19:25:58 +00:00
Jeremy Ruston
26ede2839b Add support for _canonical_uri tiddlers
Currently hard wired to kick in for tiddlers over 10MB (in base64 representation for binary tiddlers)
2024-01-19 14:46:21 +00:00
Jeremy Ruston
4b0df1a7ae Basic support for creating bags and recipes
Cannot yet specify the bags for the new recipe
2024-01-19 11:03:58 +00:00
Jeremy Ruston
9767e7d3b7 Update entity state tiddlers on startup to read bag and recipe info 2024-01-19 11:03:27 +00:00
Jeremy Ruston
4133e7d6d6 Stream wiki generation
Avoids "string too long" errors when working with big tiddlers (>100MB)
2024-01-19 10:52:12 +00:00
Jeremy Ruston
4f37355a9f Tests should use a dummy admin wiki 2024-01-19 10:28:04 +00:00
Jeremy Ruston
82fae45656 Admin styling 2024-01-18 21:48:09 +00:00
Jeremy Ruston
2f09c32d2d Fix getTiddler query 2024-01-18 21:47:57 +00:00
Jeremy Ruston
a16338ce11 Merge branch 'master' into multi-wiki-support 2024-01-18 16:43:43 +00:00
Jeremy Ruston
50d0b1412d Fix CI tests 2024-01-18 09:02:41 +00:00
Jeremy Ruston
8941bd1747 Server extension framework
May not actually be needed
2024-01-17 22:42:01 +00:00
Jeremy Ruston
615dc0c4a3 First pass at admin user interface 2024-01-17 22:41:41 +00:00
Jeremy Ruston
1fb8b2e279 Fix broken test 2024-01-05 15:45:40 +00:00
Jeremy Ruston
0799177cf4 Add another recipe, improve docs 2024-01-05 15:40:39 +00:00
Jeremy Ruston
1eed61397b Fix create recipe SQL bug 2024-01-05 15:37:48 +00:00
Jeremy Ruston
3f1f7c7ef7 Remove debugging code 2024-01-05 11:08:33 +00:00
Jeremy Ruston
8543dda4aa Fix broken test 2024-01-05 11:01:10 +00:00
Jeremy Ruston
68a89b615d Use a persistent disk-based database 2024-01-05 10:58:07 +00:00
Jeremy Ruston
e9d3f67c5c Add new multiwikiserver edition 2024-01-03 16:47:20 +00:00
Jeremy Ruston
a980390870 Implement APIs for client wikis to sync with the server
It is now possible to create and edit tiddlers, using the existing tiddlywebadaptor syncing mechanism. There are a lot of hacks and lumpiness to make things compatible, so I think I will end up with an independent implementation
2024-01-03 16:27:13 +00:00
Jeremy Ruston
299781bdba Update docs 2024-01-02 21:47:08 +00:00
Jeremy Ruston
f42d3e0536 Update usage instructions 2024-01-02 21:41:25 +00:00
Jeremy Ruston
993eb5c90d Tests need npm install 2024-01-02 21:41:06 +00:00
Jeremy Ruston
f8f8319324 Add dependencies to package.json
This is needed in order for our CI to be able to run the tests
2024-01-02 14:47:32 +00:00
Jeremy Ruston
12d84c43c9 Initial Commit 2024-01-02 14:39:14 +00:00
347 changed files with 13789 additions and 2530 deletions

View File

@@ -4,18 +4,19 @@ on:
branches:
- master
- tiddlywiki-com
- multi-wiki-support
env:
NODE_VERSION: "22"
NODE_VERSION: "23"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-test.sh"
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
@@ -30,8 +31,8 @@ jobs:
TW5_BUILD_MAIN_EDITION: "./editions/prerelease"
TW5_BUILD_OUTPUT: "./output/prerelease"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-pre-build.sh"
@@ -62,8 +63,8 @@ jobs:
TW5_BUILD_OUTPUT: "./output"
TW5_BUILD_ARCHIVE: "./output"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-pre-build.sh"
@@ -82,3 +83,14 @@ jobs:
- run: "./bin/build-tw-org.sh"
env:
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}
build-mws-tiddlywiki-com:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/multi-wiki-support'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/build-mws-site.sh"
env:
GH_TOKEN: ${{ secrets.GITHUBPUSHTOKEN }}

2
.gitignore vendored
View File

@@ -5,7 +5,9 @@
tmp/
output/
node_modules/
store/
/test-results/
/playwright-report/
/playwright/.cache/
$__StoryList.tid
/editions/test/test-store/*

View File

@@ -0,0 +1,4 @@
The `multi-wiki-support` branch includes some changes that are not intended to be merged into the `master` branch:
* Readme update (see `editions/tw5.com/tiddlers/readme/ReadMe.tid`)
* Remove `multiwikiserver` plugin from `readme-bld.sh` (see `bin/readme-bld.sh`)

97
bin/build-mws-site.sh Executable file
View File

@@ -0,0 +1,97 @@
#!/bin/bash
# Build mws.tiddlywiki.com assets.
# Default to the version of TiddlyWiki installed in this repo
if [ -z "$MWSTWCOM_BUILD_TIDDLYWIKI" ]; then
MWSTWCOM_BUILD_TIDDLYWIKI=./tiddlywiki.js
fi
echo "Using MWSTWCOM_BUILD_TIDDLYWIKI as [$MWSTWCOM_BUILD_TIDDLYWIKI]"
# Set up the build details
if [ -z "$MWSTWCOM_BUILD_DETAILS" ]; then
MWSTWCOM_BUILD_DETAILS="$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD) from $(git remote get-url origin)"
fi
echo "Using MWSTWCOM_BUILD_DETAILS as [$MWSTWCOM_BUILD_DETAILS]"
if [ -z "$MWSTWCOM_BUILD_COMMIT" ]; then
MWSTWCOM_BUILD_COMMIT="$(git rev-parse HEAD)"
fi
echo "Using MWSTWCOM_BUILD_COMMIT as [$MWSTWCOM_BUILD_COMMIT]"
# Set up the build output directory
if [ -z "$MWSTWCOM_BUILD_OUTPUT" ]; then
MWSTWCOM_BUILD_OUTPUT=$(mktemp -d)
fi
mkdir -p $MWSTWCOM_BUILD_OUTPUT
if [ ! -d "$MWSTWCOM_BUILD_OUTPUT" ]; then
echo 'A valid MWSTWCOM_BUILD_OUTPUT environment variable must be set'
exit 1
fi
echo "Using MWSTWCOM_BUILD_OUTPUT as [$MWSTWCOM_BUILD_OUTPUT]"
# Pull existing GitHub pages content
git clone --depth=1 --branch=main "https://github.com/TiddlyWiki/mws.tiddlywiki.com-gh-pages.git" $MWSTWCOM_BUILD_OUTPUT
# Make the CNAME file that GitHub Pages requires
echo "mws.tiddlywiki.com" > $MWSTWCOM_BUILD_OUTPUT/CNAME
# Delete any existing static content
mkdir -p $MWSTWCOM_BUILD_OUTPUT/static
rm $MWSTWCOM_BUILD_OUTPUT/static/*
# Put the build details into a .tid file so that it can be included in each build (deleted at the end of this script)
echo -e -n "title: $:/build\ncommit: $MWSTWCOM_BUILD_COMMIT\n\n$MWSTWCOM_BUILD_DETAILS\n" > $MWSTWCOM_BUILD_OUTPUT/build.tid
######################################################
#
# mws.tiddlywiki.com distribution
#
######################################################
# /index.html Main site
# /favicon.ico Favicon for main site
# /static.html Static rendering of default tiddlers
# /alltiddlers.html Static rendering of all tiddlers
# /static/* Static single tiddlers
# /static/static.css Static stylesheet
# /static/favicon.ico Favicon for static pages
node $MWSTWCOM_BUILD_TIDDLYWIKI \
editions/multiwikidocs \
--verbose \
--version \
--load $MWSTWCOM_BUILD_OUTPUT/build.tid \
--output $MWSTWCOM_BUILD_OUTPUT \
--build favicon static index \
|| exit 1
# Delete the temporary build tiddler
rm $MWSTWCOM_BUILD_OUTPUT/build.tid || exit 1
# Push output back to GitHub
# Exit script immediately if any command fails
set -e
pushd $MWSTWCOM_BUILD_OUTPUT
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add -A .
git commit --message "GitHub build: $GITHUB_RUN_NUMBER of $TW5_BUILD_BRANCH ($(date +'%F %T %Z'))"
git remote add deploy "https://$GH_TOKEN@github.com/TiddlyWiki/mws.tiddlywiki.com-gh-pages.git" &>/dev/null
git push deploy main &>/dev/null
popd

View File

@@ -105,7 +105,6 @@ node $TW5_BUILD_TIDDLYWIKI \
fi
# /index.html Main site
# /external-(version).html External core version of main site
# /favicon.ico Favicon for main site
# /static.html Static rendering of default tiddlers
# /alltiddlers.html Static rendering of all tiddlers
@@ -118,7 +117,7 @@ node $TW5_BUILD_TIDDLYWIKI \
--version \
--load $TW5_BUILD_OUTPUT/build.tid \
--output $TW5_BUILD_OUTPUT \
--build favicon static index external-js \
--build favicon static index \
|| exit 1
# /empty.html Empty

View File

@@ -2,6 +2,8 @@
# test TiddlyWiki5 for tiddlywiki.com
npm install
node ./tiddlywiki.js \
./editions/test \
--verbose \

View File

@@ -10,6 +10,7 @@ fi
# tw5.com readmes
node $TW5_BUILD_TIDDLYWIKI \
+plugins/tiddlywiki/multiwikiserver \
editions/tw5.com \
--verbose \
--output . \

View File

@@ -232,10 +232,10 @@ $tw.utils.error = function(err) {
var link = dm("a"),
text = JSON.stringify(tiddlers);
if(Blob !== undefined) {
var blob = new Blob([text], {type: "application/json"});
var blob = new Blob([text], {type: "text/html"});
link.setAttribute("href", URL.createObjectURL(blob));
} else {
link.setAttribute("href","data:application/json," + encodeURIComponent(text));
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
}
link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
document.body.appendChild(link);
@@ -2463,15 +2463,13 @@ $tw.boot.initStartup = function(options) {
$tw.utils.registerFileType("image/webp","base64",".webp",{flags:["image"]});
$tw.utils.registerFileType("image/heic","base64",".heic",{flags:["image"]});
$tw.utils.registerFileType("image/heif","base64",".heif",{flags:["image"]});
$tw.utils.registerFileType("image/avif","base64",".avif",{flags:["image"]});
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]});
$tw.utils.registerFileType("image/vnd.microsoft.icon","base64",".ico",{flags:["image"]});
$tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]});
$tw.utils.registerFileType("application/wasm","base64",".wasm");
$tw.utils.registerFileType("font/woff","base64",".woff");
$tw.utils.registerFileType("font/woff2","base64",".woff2");
$tw.utils.registerFileType("font/ttf","base64",".ttf");
$tw.utils.registerFileType("font/otf","base64",".otf");
$tw.utils.registerFileType("application/font-woff","base64",".woff");
$tw.utils.registerFileType("application/x-font-ttf","base64",".woff");
$tw.utils.registerFileType("application/font-woff2","base64",".woff2");
$tw.utils.registerFileType("audio/ogg","base64",".ogg");
$tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]);
$tw.utils.registerFileType("video/ogg","base64",[".ogm",".ogv",".ogg"]);

View File

@@ -5,3 +5,7 @@ TiddlyWiki incorporates code from these fine OpenSource projects:
* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]
* [[The Jasmine JavaScript Test Framework|https://jasmine.github.io/]]
* [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]]
And media from these projects:
* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]]

View File

@@ -1,5 +0,0 @@
title: $:/core/images/language
tags: $:/tags/Image
\parameters (size:"22pt")
<svg width=<<size>> height=<<size>> class="tc-image-language tc-image-button" viewBox="0 0 92 92"><path d="M0 0h2480.32v3507.87H0z" style="fill:none" transform="scale(.03696 .02613)"/><path d="M71.508 62.298c-1.243 15.83-16.758 28.344-35.714 28.344-5.713 0-11.113-1.136-15.905-3.158-2.977 2.498-8.618 4.183-15.088 4.183-.929 0-1.84-.034-2.73-.102 4.499-1.5 7.989-4.886 9.298-9.099C4.373 76.918 0 69.016 0 60.246 0 49.773 6.237 40.537 15.729 35.07c1.235 7.764 5.492 14.713 11.724 19.953l-7.269 18.453c-.393.976-.676 1.737-.847 2.285a5.326 5.326 0 0 0-.256 1.591c0 .89.368 1.686 1.103 2.388.736.702 1.583 1.052 2.542 1.052 1.13 0 1.942-.33 2.438-.988.497-.659 1.096-1.93 1.797-3.812l1.797-4.826h15.3l1.797 4.723c.239.582.526 1.254.86 2.015.333.762.646 1.327.936 1.695.291.368.65.659 1.078.873.428.213.942.32 1.54.32a3.586 3.586 0 0 0 2.632-1.09c.727-.728 1.09-1.528 1.09-2.4 0-.84-.384-2.183-1.154-4.031l-3.545-8.755c2.142.3 4.34.455 6.58.455 5.541 0 10.824-.951 15.636-2.674Zm-30.563.247 1.059 2.898H30.76l2.32-6.467a43.152 43.152 0 0 0 7.865 3.569Z"/><path d="M71.778 57.635c-4.793 2.023-10.191 3.157-15.907 3.157-19.767 0-35.793-13.61-35.793-30.396S36.104.001 55.87.001c19.772 0 35.797 13.61 35.797 30.395 0 8.77-4.373 16.674-11.371 22.221 1.309 4.211 4.8 7.6 9.299 9.1-.89.067-1.802.1-2.73.1-6.47 0-12.11-1.686-15.088-4.182Zm-15.59-15.887a44.237 44.237 0 0 0 3.3 2.496c4.284 2.942 9.06 5.381 14.33 7.315l2.334-3.517c-5.134-1.871-9.696-4.125-13.69-6.763a42.558 42.558 0 0 1-3.37-2.483c4.247-4.806 7.374-10.43 9.38-16.869h6.698V17.78h-16.7a47.226 47.226 0 0 0-1.528-2.959 52.943 52.943 0 0 0-2.885-4.562l-4.218 1.554a36.467 36.467 0 0 1 2.971 3.983c.427.661.833 1.323 1.217 1.984H36.394v4.148h6.77a36.878 36.878 0 0 0 5.422 11.56 42.918 42.918 0 0 0 4.591 5.497c-4.687 4.017-10.548 6.932-17.582 8.744l2.247 3.709c7.746-2.44 13.861-5.67 18.347-9.689Zm-9.047-19.82h16.991c-1.86 5.668-4.528 10.402-8 14.204a42.526 42.526 0 0 1-4.247-4.922c-2.126-2.883-3.71-5.977-4.744-9.283Z"/></svg>

View File

@@ -0,0 +1,13 @@
title: $:/languages/en-GB/icon
type: image/svg+xml
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="1200" height="600">
<clipPath id="t">
<path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
</clipPath>
<path d="M0,0 v30 h60 v-30 z" fill="#00247d"/>
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#cf142b" stroke-width="4"/>
<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
<path d="M30,0 v30 M0,15 h60" stroke="#cf142b" stroke-width="6"/>
</svg>

View File

@@ -38,6 +38,13 @@ Commander.prototype.log = function(str) {
}
};
/*
Clear pending commands
*/
Commander.prototype.clearCommands = function() {
this.commandTokens = this.commandTokens.slice(0,this.nextToken);
};
/*
Write a string if verbose flag is set
*/

View File

@@ -16,7 +16,7 @@ var Server = require("$:/core/modules/server/server.js").Server;
exports.info = {
name: "listen",
synchronous: true,
synchronous: false,
namedParameterMode: true,
mandatoryParameters: []
};
@@ -38,7 +38,11 @@ Command.prototype.execute = function() {
wiki: this.commander.wiki,
variables: self.params
});
var nodeServer = this.server.listen();
var nodeServer = this.server.listen(null,null,null,{
callback: function() {
self.callback();
}
});
$tw.hooks.invokeHook("th-server-command-post-start",this.server,nodeServer,"tiddlywiki");
return null;
};

View File

@@ -0,0 +1,37 @@
/*\
title: $:/core/modules/commands/quit.js
type: application/javascript
module-type: command
Immediately ends the TiddlyWiki process
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "quit",
synchronous: true
};
var Command = function(params,commander,callback) {
var self = this;
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
// Clear any pending commands
this.commander.clearCommands();
// We don't actually quit, we just issue the "th-quit" hook to give listeners a chance to exit
$tw.hooks.invokeHook("th-quit");
return null;
};
exports.Command = Command;
})();

View File

@@ -17,24 +17,19 @@ Export our filter function
*/
exports.function = function(source,operator,options) {
var functionName = operator.operands[0],
params = [],
results;
params = [];
$tw.utils.each(operator.operands.slice(1),function(param) {
params.push({value: param});
});
// console.log(`Calling ${functionName} with params ${JSON.stringify(params)}`);
var variableInfo = options.widget && options.widget.getVariableInfo && options.widget.getVariableInfo(functionName,{params: params, source: source});
if(variableInfo && variableInfo.srcVariable && variableInfo.srcVariable.isFunctionDefinition) {
results = variableInfo.resultList ? variableInfo.resultList : [variableInfo.text];
return variableInfo.resultList ? variableInfo.resultList : [variableInfo.text];
}
// Return the input list if the function wasn't found
if(!results) {
results = [];
source(function(tiddler,title) {
results.push(title);
});
}
// console.log(`function ${functionName} with params ${JSON.stringify(params)} results: ${JSON.stringify(results)}`);
var results = [];
source(function(tiddler,title) {
results.push(title);
});
return results;
};

View File

@@ -128,7 +128,7 @@ exports.minall = makeNumericReducingOperator(
exports.median = makeNumericArrayOperator(
function(values) {
var len = values.length, median;
values.sort(function(a,b) {return a-b});
values.sort();
if(len % 2) {
// Odd, return the middle number
median = values[(len - 1) / 2];

View File

@@ -40,7 +40,6 @@ exports["image/gif"] = ImageParser;
exports["image/webp"] = ImageParser;
exports["image/heic"] = ImageParser;
exports["image/heif"] = ImageParser;
exports["image/avif"] = ImageParser;
exports["image/x-icon"] = ImageParser;
exports["image/vnd.microsoft.icon"] = ImageParser;

View File

@@ -46,10 +46,8 @@ function SaverHandler(options) {
// Filter the changes so that we only count changes to tiddlers that we care about
var filteredChanges = self.filterFn.call(self.wiki,function(iterator) {
$tw.utils.each(changes,function(change,title) {
if(change.normal) {
var tiddler = self.wiki.getTiddler(title);
iterator(tiddler,title);
}
var tiddler = self.wiki.getTiddler(title);
iterator(tiddler,title);
});
});
// Adjust the number of changes
@@ -185,7 +183,7 @@ SaverHandler.prototype.saveWiki = function(options) {
// Call the highest priority saver that supports this method
for(var t=this.savers.length-1; t>=0; t--) {
var saver = this.savers[t];
if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename, type: variables.type}})) {
if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename}})) {
this.logger.log("Saving wiki with method",method,"through saver",saver.info.name);
return true;
}

View File

@@ -22,7 +22,6 @@ DownloadSaver.prototype.save = function(text,method,callback,options) {
options = options || {};
// Get the current filename
var filename = options.variables.filename;
var type = options.variables.type;
if(!filename) {
var p = document.location.pathname.lastIndexOf("/");
if(p !== -1) {
@@ -33,16 +32,13 @@ DownloadSaver.prototype.save = function(text,method,callback,options) {
if(!filename) {
filename = "tiddlywiki.html";
}
if(!type) {
type = "text/html";
}
// Set up the link
var link = document.createElement("a");
if(Blob !== undefined) {
var blob = new Blob([text], {type: type});
var blob = new Blob([text], {type: "text/html"});
link.setAttribute("href", URL.createObjectURL(blob));
} else {
link.setAttribute("href","data:" + type + "," + encodeURIComponent(text));
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
}
link.setAttribute("download",filename);
document.body.appendChild(link);

View File

@@ -364,6 +364,11 @@ Server.prototype.listen = function(port,host,prefix) {
}
// Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port)
server.on("listening",function() {
// Stop listening when we get the "th-quit" hook
$tw.hooks.addHook("th-quit",function() {
server.close();
});
// Log listening details
var address = server.address(),
url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix;
$tw.utils.log("Serving on " + url,"brown/orange");

View File

@@ -75,7 +75,7 @@ exports.startup = function() {
$tw.wiki.unpackPluginTiddlers();
// Queue change events for the changed shadow tiddlers
$tw.utils.each(Object.keys(changedShadowTiddlers),function(title) {
$tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true);
$tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title]);
});
}
}

View File

@@ -77,9 +77,8 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) {
$tw.utils.copyToClipboard(event.param,{
successNotification: event.paramObject && event.paramObject.successNotification,
failureNotification: event.paramObject && event.paramObject.failureNotification,
plainText: event.paramObject && event.paramObject.plainText
},event.paramObject && event.paramObject.type);
failureNotification: event.paramObject && event.paramObject.failureNotification
});
});
// Install the tm-focus-selector message
$tw.rootWidget.addEventListener("tm-focus-selector",function(event) {

View File

@@ -257,7 +257,11 @@ Save an incoming tiddler in the store, and updates the associated tiddlerInfo
Syncer.prototype.storeTiddler = function(tiddlerFields) {
// Save the tiddler
var tiddler = new $tw.Tiddler(tiddlerFields);
this.wiki.addTiddler(tiddler);
// Only save the tiddler if it has changed
var existingTiddler = this.wiki.getTiddler(tiddlerFields.title);
if(!existingTiddler || !existingTiddler.isEqual(tiddler)) {
this.wiki.addTiddler(tiddler);
}
// Save the tiddler revision and changeCount details
this.tiddlerInfo[tiddlerFields.title] = {
revision: this.getTiddlerRevision(tiddlerFields.title),
@@ -556,6 +560,7 @@ SaveTiddlerTask.prototype.run = function(callback) {
// Invoke the callback
callback(null);
},{
syncer: self.syncer,
tiddlerInfo: self.syncer.tiddlerInfo[self.title]
});
} else {
@@ -586,6 +591,7 @@ DeleteTiddlerTask.prototype.run = function(callback) {
// Invoke the callback
callback(null);
},{
syncer: self.syncer,
tiddlerInfo: self.syncer.tiddlerInfo[this.title]
});
};
@@ -614,6 +620,8 @@ LoadTiddlerTask.prototype.run = function(callback) {
}
// Invoke the callback
callback(null);
},{
syncer: self.syncer
});
};

View File

@@ -40,10 +40,10 @@ exports.getFieldString = function(field,defaultValue) {
};
/*
Get the value of a field as an array / list
Get the value of a field as a list
*/
exports.getFieldList = function(field) {
var value = this.getFieldString(field,null);
var value = this.fields[field];
// Check for a missing field
if(value === undefined || value === null) {
return [];

View File

@@ -268,10 +268,9 @@ exports.copyStyles = function(srcDomNode,dstDomNode) {
/*
Copy plain text to the clipboard on browsers that support it
*/
exports.copyToClipboard = function(text,options,type) {
var text = text || "";
var options = options || {};
var type = type || "text/plain";
exports.copyToClipboard = function(text,options) {
options = options || {};
text = text || "";
var textArea = document.createElement("textarea");
textArea.style.position = "fixed";
textArea.style.top = 0;
@@ -284,16 +283,10 @@ exports.copyToClipboard = function(text,options,type) {
textArea.style.outline = "none";
textArea.style.boxShadow = "none";
textArea.style.background = "transparent";
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
textArea.setSelectionRange(0,text.length);
textArea.addEventListener("copy",function(event) {
event.preventDefault();
if (options.plainText) {
event.clipboardData.setData("text/plain",options.plainText);
}
event.clipboardData.setData(type,text);
});
var succeeded = false;
try {
succeeded = document.execCommand("copy");

View File

@@ -216,11 +216,11 @@ HttpClientRequest.prototype.send = function(callback) {
if(lengthComputable) {
setBinding(self.bindProgress,"" + Math.floor((loaded/total) * 100))
}
self.wiki.invokeActionString(self.progressActions,undefined,$tw.utils.extend({},self.variables,{
self.wiki.invokeActionString(self.progressActions,undefined,{
lengthComputable: lengthComputable ? "yes" : "no",
loaded: loaded,
total: total
}),{parentWidget: $tw.rootWidget});
},{parentWidget: $tw.rootWidget});
}
});
}

View File

@@ -104,7 +104,7 @@ CreateTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {
}
this.setVariable("createTiddler-title",title);
this.setVariable("createTiddler-draftTitle",draftTitle);
this.refreshChildren([]);
this.refreshChildren();
return true; // Action was invoked
};

View File

@@ -157,7 +157,7 @@ CheckboxWidget.prototype.getValue = function() {
if(this.checkboxTag) {
return false;
}
if(this.checkboxField || this.checkboxIndex) {
if(this.checkboxField) {
if(this.checkboxDefault === this.checkboxChecked) {
return true;
}

View File

@@ -43,6 +43,15 @@ EditWidget.prototype.execute = function() {
// Get our parameters
this.editTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.editField = this.getAttribute("field","text");
this.editIndex = this.getAttribute("index");
this.editClass = this.getAttribute("class");
this.editPlaceholder = this.getAttribute("placeholder");
this.editTabIndex = this.getAttribute("tabindex");
this.editFocus = this.getAttribute("focus","");
this.editCancelPopups = this.getAttribute("cancelPopups","");
this.editInputActions = this.getAttribute("inputActions");
this.editRefreshTitle = this.getAttribute("refreshTitle");
this.editAutoComplete = this.getAttribute("autocomplete");
// Choose the appropriate edit widget
this.editorType = this.getEditorType();
// Make the child widgets
@@ -80,8 +89,8 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
EditWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
// Refresh if the editor type has changed
if(changedAttributes.tiddler || changedAttributes.field || (this.getEditorType() !== this.editorType)) {
// Refresh if an attribute has changed, or the type associated with the target tiddler has changed
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || (this.getEditorType() !== this.editorType)) {
this.refreshSelf();
return true;
} else {

View File

@@ -24,10 +24,6 @@ Inherit from the base widget class
*/
FillWidget.prototype = new Widget();
FillWidget.prototype.execute = function() {
// Do nothing. Make no child widgets. $Fill widgets should be invisible when naturally encountered. Instead, their parseTreeNodes are made available to $slot widgets that want it.
};
exports.fill = FillWidget;
})();

View File

@@ -23,21 +23,15 @@ Inherit from the base widget class
*/
GenesisWidget.prototype = new Widget();
GenesisWidget.prototype.computeAttributes = function(options) {
options = options || Object.create(null);
options.filterFn = function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}
return Widget.prototype.computeAttributes.call(this,options);
};
/*
Render this widget into the DOM
*/
GenesisWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.computeAttributes({filterFn: function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}});
this.execute();
this.renderChildren(parent,nextSibling);
};

View File

@@ -163,4 +163,4 @@ ImageWidget.prototype.refresh = function(changedTiddlers) {
exports.image = ImageWidget;
})();
})();

View File

@@ -107,7 +107,6 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
ImportVariablesWidget.prototype.refresh = function(changedTiddlers) {
changedTiddlers = changedTiddlers || {};
// Recompute our attributes and the filter list
var changedAttributes = this.computeAttributes(),
tiddlerList = this.wiki.filterTiddlers(this.getAttribute("filter"),this);

View File

@@ -141,15 +141,12 @@ This method should be called after the changes it describes have been made to th
title: Title of tiddler
isDeleted: defaults to false (meaning the tiddler has been created or modified),
true if the tiddler has been deleted
isShadow: defaults to false (meaning the change applies to the normal tiddler),
true if the tiddler being changed is a shadow tiddler
*/
exports.enqueueTiddlerEvent = function(title,isDeleted,isShadow) {
exports.enqueueTiddlerEvent = function(title,isDeleted) {
// Record the touch in the list of changed tiddlers
this.changedTiddlers = this.changedTiddlers || Object.create(null);
this.changedTiddlers[title] = this.changedTiddlers[title] || Object.create(null);
this.changedTiddlers[title][isDeleted ? "deleted" : "modified"] = true;
this.changedTiddlers[title][isShadow ? "shadow" : "normal"] = true;
// Increment the change count
this.changeCount = this.changeCount || Object.create(null);
if($tw.utils.hop(this.changeCount,title)) {

View File

@@ -78,13 +78,13 @@ code-background: <<colour background>>
code-border: <<colour flexoki-tx>>
code-foreground: <<colour flexoki-tx>>
diff-delete-background: <<colour flexoki-re>>
diff-delete-foreground: <<colour flexoki-bg-2>>
diff-delete-foreground: <<colour flexoki-paper>>
diff-equal-background:
diff-equal-foreground: inherit
diff-insert-background: <<colour flexoki-gr>>
diff-insert-foreground: <<colour flexoki-bg-2>>
diff-insert-foreground: <<colour flexoki-paper>>
diff-invisible-background: <<colour flexoki-ye>>
diff-invisible-foreground: <<colour flexoki-bg-2>>
diff-invisible-foreground: <<colour flexoki-paper>>
dirty-indicator: <<colour flexoki-re>>
download-background: <<colour flexoki-cy-2>>
download-foreground: <<colour background>>
@@ -103,8 +103,8 @@ external-link-foreground-visited: <<colour flexoki-bl>>
external-link-foreground: <<colour flexoki-bl>>
footnote-target-background: <<colour flexoki-bg-2>>
foreground: #CECDC3
highlight-background: <<colour flexoki-yellow-900>>
highlight-foreground: inherit
highlight-background: <<colour flexoki-cyan-950>>
highlight-foreground: <<colour flexoki-cyan-400>>
menubar-background: <<colour primary>>
menubar-foreground: <<colour flexoki-paper>>
message-background: <<colour background>>

View File

@@ -105,7 +105,7 @@ external-link-foreground-visited: <<colour flexoki-bl>>
external-link-foreground: <<colour flexoki-bl>>
footnote-target-background: <<colour flexoki-bg-2>>
foreground: #100F0F
highlight-background: <<colour flexoki-yellow-100>>
highlight-background: <<colour flexoki-cyan-050>>
highlight-foreground: inherit
menubar-background: <<colour primary>>
menubar-foreground: <<colour flexoki-paper>>

View File

@@ -2,6 +2,5 @@ title: $:/core/templates/exporters/CsvFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/CsvFile}}
extension: .csv
file-type: text/csv
<$macrocall $name="csvtiddlers" filter=<<exportFilter>> format="quoted-comma-sep" $output="text/raw"/>

View File

@@ -2,6 +2,5 @@ title: $:/core/templates/exporters/JsonFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/JsonFile}}
extension: .json
file-type: application/json
<$macrocall $name="jsontiddlers" filter=<<exportFilter>> $output="text/raw"/>

View File

@@ -2,7 +2,6 @@ title: $:/core/templates/exporters/TidFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/TidFile}}
extension: .tid
file-type: text/vnd.tiddlywiki
condition: [<count>compare:lte[1]]
\define renderContent()

View File

@@ -5,7 +5,6 @@ description: {{$:/language/Buttons/AdvancedSearch/Hint}}
\whitespace trim
\procedure advanced-search-button(class)
\whitespace trim
<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/advanced-search-button}}

View File

@@ -5,7 +5,6 @@ description: {{$:/language/Buttons/ControlPanel/Hint}}
\whitespace trim
\procedure control-panel-button(class)
\whitespace trim
<$button to="$:/ControlPanel" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/options-button}}

View File

@@ -7,7 +7,11 @@ description: {{$:/language/Buttons/Language/Hint}}
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/language">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/language}}
<span class="tc-image-button">
<$set name="languagePluginTitle" value={{$:/language}}>
<$image source=`$(languagePluginTitle)$/icon`/>
</$set>
</span>
<%endif%>
<%if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span>

View File

@@ -5,7 +5,6 @@ description: {{$:/language/Buttons/Manager/Hint}}
\whitespace trim
\procedure manager-button(class)
\whitespace trim
<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/list}}

View File

@@ -4,17 +4,10 @@ caption: {{$:/core/images/save-button-dynamic}} {{$:/language/Buttons/SaveWiki/C
description: {{$:/language/Buttons/SaveWiki/Hint}}
\whitespace trim
\procedure saveActions()
<$button tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>
<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}>
<$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
<$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
</$wikify>
\end
<$button actions=<<saveActions>>
tooltip={{$:/language/Buttons/SaveWiki/Hint}}
aria-label={{$:/language/Buttons/SaveWiki/Caption}}
class=<<tv-config-toolbar-class>>
>
<span class="tc-dirty-indicator">
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/save-button-dynamic}}

View File

@@ -5,7 +5,6 @@ description: {{$:/language/Buttons/TagManager/Hint}}
\whitespace trim
\procedure control-panel-button(class)
\whitespace trim
<$button to="$:/TagManager" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`>
<%if [<tv-config-toolbar-icons>match[yes]] %>
{{$:/core/images/tag-button}}

View File

@@ -1,12 +1,25 @@
title: $:/snippets/languageswitcher
\define flag-title()
$(languagePluginTitle)$/icon
\end
\whitespace trim
<$linkcatcher to="$:/language">
<div class="tc-chooser tc-language-chooser">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[description]]">
<$set name="cls" filter="[all[current]field:title{$:/language}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
<div class=<<cls>> lang={{!!name}}>
<$set name="cls" filter="[all[current]field:title{$:/language}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item"><div class=<<cls>>>
<$link>
<span class="tc-image-button">
<$set name="languagePluginTitle" value=<<currentTiddler>>>
<$transclude subtiddler=<<flag-title>>>
<$list filter="[all[current]field:title[$:/languages/en-GB]]">
<$transclude tiddler="$:/languages/en-GB/icon"/>
</$list>
</$transclude>
</$set>
</span>
&#32;
<$view field="description">
<$view field="name">
<$view field="title"/>

View File

@@ -3,11 +3,9 @@ tags: $:/tags/Macro
\whitespace trim
\procedure copy-to-clipboard(src,class:"tc-btn-invisible",style,type:"text/plain",plain)
\procedure copy-to-clipboard-actions()
<$action-sendmessage $message="tm-copy-to-clipboard" $param=<<src>> type=<<type>> plainText=<<plain>>/>
\end copy-to-clipboard-actions
<$button actions=<<copy-to-clipboard-actions>>
\procedure copy-to-clipboard(src,class:"tc-btn-invisible",style)
<$button message="tm-copy-to-clipboard"
param=<<src>>
class=<<class>>
style=<<style>>
tooltip={{$:/language/Buttons/CopyToClipboard/Hint}}
@@ -17,12 +15,12 @@ tags: $:/tags/Macro
<$text text={{$:/language/Buttons/CopyToClipboard/Caption}}/>
</span>
</$button>
\end copy-to-clipboard
\end
\procedure copy-to-clipboard-above-right(src,class:"tc-btn-invisible",style,type:"text/plain")
<div style.position="relative">
<div style.position="absolute" style.bottom="0" style.right="0">
<$transclude $variable="copy-to-clipboard" src=<<src>> class=<<class>> style=<<style>> type=<<type>> plain=<<plain>>/>
\procedure copy-to-clipboard-above-right(src,class:"tc-btn-invisible",style)
<div style="position: relative;">
<div style="position: absolute; bottom: 0; right: 0;">
<$macrocall $name="copy-to-clipboard" src=<<src>> class=<<class>> style=<<style>>/>
</div>
</div>
\end

View File

@@ -39,7 +39,6 @@ tags: $:/tags/Macro
$param=<<currentTiddler>>
exportFilter=<<exportFilter>>
filename={{{ [<baseFilename>addsuffix{!!extension}] }}}
type={{!!file-type}}
/>
<$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/>
<$transclude field="description"/>

View File

@@ -102,11 +102,7 @@ tags: $:/tags/Macro
<$genesis $type=<<elementTag>>>
<$transclude tiddler=<<itemTemplate>>>
<$link to={{!!title}}>
<$let tv-wikilinks="no">
<$transclude field="caption">
<$view field="title"/>
</$transclude>
</$let>
<$view field="title"/>
</$link>
</$transclude>
</$genesis>

View File

@@ -1,6 +1,7 @@
title: $:/core/macros/toc
tags: $:/tags/Macro
\define toc-open-icon() $:/core/images/down-arrow
\define toc-closed-icon() $:/core/images/right-arrow
@@ -120,7 +121,7 @@ tags: $:/tags/Macro
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item" >
<li class=<<toc-item-class>>>
<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}>
<$list filter="[all[current]tagging[]$sort$] -[subfilter<__exclude__>] +[limit[1]]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
<$list filter="[all[current]tagging[]$sort$limit[1]] -[subfilter<__exclude__>]" variable="ignore" emptyMessage="<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$transclude tiddler=<<toc-closed-icon>> />
@@ -147,7 +148,7 @@ tags: $:/tags/Macro
<$qualify name="toc-state" title={{{ [[$:/state/toc]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>
<$set name="toc-item-class" filter=<<__itemClassFilter__>> emptyValue="toc-item-selected" value="toc-item">
<li class=<<toc-item-class>>>
<$list filter="[all[current]tagging[]$sort$] -[subfilter<__exclude__>] +[limit[1]]" variable="ignore" emptyMessage="""<$button class="tc-btn-invisible">{{$:/core/images/blank}}</$button><span class="toc-item-muted"><<toc-caption>></span>""">
<$list filter="[all[current]tagging[]$sort$limit[1]] -[subfilter<__exclude__>]" variable="ignore" emptyMessage="""<$button class="tc-btn-invisible">{{$:/core/images/blank}}</$button><span class="toc-item-muted"><<toc-caption>></span>""">
<$reveal type="nomatch" stateTitle=<<toc-state>> text="open">
<$button setTitle=<<toc-state>> setTo="open" class="tc-btn-invisible tc-popup-keep">
<$transclude tiddler=<<toc-closed-icon>> />

View File

@@ -3,7 +3,7 @@ title: $:/snippets/paletteswitcher
\whitespace trim
<$linkcatcher to="$:/palette">
<div class="tc-chooser">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]!is[draft]sort[name]]">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]]">
<$set name="cls" filter="[all[current]prefix{$:/palette}]" value="tc-chooser-item tc-chosen" emptyValue="tc-chooser-item">
<div class=<<cls>>>
<$link to={{!!title}}>

View File

@@ -1,9 +1,33 @@
title: Translations
\define flag-title()
$(languagePluginTitle)$/icon
\end
TiddlyWiki is currently available in <$count filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]] -[[$:/languages/de-AT]]"/> languages:
<div style.height="400px" style.overflowY="auto">
{{$:/snippets/languageswitcher}}
<div class="tc-drop-down-language-chooser" style="font-size: 7px; line-height: 8px; -moz-columns:6; -webkit-columns:6; columns:6;">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]] -[[$:/languages/de-AT]]">
<div class="tc-language-list">
<span class="tc-language-list-name tc-image-button">
<$set name="languagePluginTitle" value=<<currentTiddler>>>
<$transclude subtiddler=<<flag-title>>>
<$list filter="[all[current]field:title[$:/languages/en-GB]]">
<$transclude tiddler="$:/languages/en-GB/icon"/>
</$list>
</$transclude>
</$set>
<$view field="description">
<$view field="name">
<$view field="title"/>
</$view>
</$view>
<$view subtiddler="$:/language/ControlPanel/Basics/Language/Prompt">
<$view tiddler="$:/language/ControlPanel/Basics/Language/Prompt"/>
</$view>
</span>
</div>
</$list>
</div>
Find out how to [[Get Started]].

View File

@@ -25,7 +25,6 @@
"de-DE",
"el-GR",
"en-US",
"en-PH",
"es-ES",
"fa-IR",
"fr-FR",
@@ -35,15 +34,12 @@
"it-IT",
"ja-JP",
"ko-KR",
"mk-MK",
"nl-NL",
"pa-IN",
"pl-PL",
"pt-BR",
"pt-PT",
"ru-RU",
"sk-SK",
"sl-SI",
"sv-SE",
"zh-CN",
"zh-Hans",

View File

@@ -1,24 +0,0 @@
created: 20180626122427188
modified: 20241228111603066
original-modified: 20211117234223960
tags: [[TiddlyWiki on Node.js]]
title: NamedCommandParameters
ja-title: 名前付きコマンドパラメータ
type: text/vnd.tiddlywiki
<<.from-version "5.1.18">> ほとんどのTiddlyWiki[[コマンド|Commands]]は、パラメータに位置に基づくシステムを使用しており、各パラメータはコマンドで定義された正確な順序でリストされる必要があります。より複雑なコマンドの中には、名前付きコマンドパラメータの代替スキームを提供するものもあります。たとえば、ここでは"port"と"host"という2つのパラメータを提供します:
```
--listen port=8090 host=0.0.0.0
```
パラメータの順序は重要ではないことに注意してください。
パラメータ内で特殊文字を使用するには引用符が必要です。Unix、Linux、Macではシングルクォートが使用され、Windowsではダブルクォートが使用されます:
```
--listen port=8090 username=joe 'password=s3cret(!'
--listen port=8090 username=joe "password=s3cret(!"
```
引用符は値の部分だけでなく、名前=値のペア全体を括ることに注意してください。

View File

@@ -1,42 +0,0 @@
created: 20130825214200000
modified: 20250203103623306
original-modified: 20161015134454785
tags: [[TiddlyWiki on Node.js]]
title: TiddlyWikiFolders
ja-title: TiddlyWikiフォルダ
type: text/vnd.tiddlywiki
[[Node.js上のTiddlyWiki|TiddlyWiki on Node.js]]は、従来の単一ファイルWikiと同様に、フォルダーに保存される個々のTiddlerファイルのWikiもサポートします。
! Wikiフォルダ構造
Wikiフォルダーには、次のファイルとフォルダーを含めることができます:
* ''tiddlywiki.info'' - Wikiのメタデータを含むJSONファイル -- [[tiddlywiki.infoファイル|tiddlywiki.info Files]]を参照
* ''\tiddlers'' - Wikiを構成するTiddlerファイルを含むフォルダ
* ''\plugins'' - Wikiに含める[[プラグインフォルダ|PluginFolders]]を含むフォルダ
* ''\languages'' - Wikiに含める言語プラグインの[[プラグインフォルダ|PluginFolders]]を含むフォルダ
* ''\themes'' - Wikiに含めるテーマプラグインの[[プラグインフォルダ|PluginFolders]]を含むフォルダ
''tiddlywiki.info''ファイルのみが必須で、その他はすべてオプションです。上記にリストされていないファイルとフォルダーは無視されます。
!! プラグイン処理
ブラウザで使用できるようにするには、プラグインをWikiに含める必要があります。サーバー上で生成されるWikiの場合、[[TiddlyWikiフォルダ|TiddlyWikiFolders]]には、このWikiに含めるプラグインの識別を[[tiddlywiki.infoファイル|tiddlywiki.info Files]]に含めることができます:
```
{
"plugins": [
"tiddlywiki/slider",
"tiddlytools/chooser"
]
}
```
プラグイン名は、TiddlyWiki5のルート`plugins`フォルダーにリストされているプラグインフォルダーを参照します。プラグインは、Wikiの`plugins`サブフォルダーにコピーして手動で含めることもできます。
!! `tiddlers`フォルダの処理
`tiddlers`フォルダー内のすべての[[Tiddlerファイル|TiddlerFiles]]は、起動時にWikiに読み込まれます。サブフォルダーは[[Tiddlerファイル|TiddlerFiles]]の再帰スキャンの対象となります。新しく作成されたTiddlerは、[[特に設定されて|Customising Tiddler File Naming]]いない限り、`tiddlers`フォルダーの直下の[[Tiddlerファイル|TiddlerFiles]]に保存されます。
`tiddlers`フォルダー内のサブフォルダーのデフォルトの処理は、`tiddlywiki.files`と呼ばれるJSONファイルを提供することで上書きできます -- [[tiddlywiki.filesファイル|tiddlywiki.files Files]]を参照。

View File

@@ -1,21 +0,0 @@
created: 20140126125259638
modified: 20241227104451970
original-modified: 20171118195316103
tags: Definitions Platforms
title: TiddlyDesktop
ja-title: TiddlyDesktop
type: text/vnd.tiddlywiki
TiddlyDesktopは、TiddlyWikiファイル(TiddlyWikiClassicとTiddlyWikiバージョン5の両方)を操作するためのアプリです。Windowsや、Mac OS X、Linuxにインストールできます。TiddlyWikiバージョン5と古いTiddlyWikiClassicと互換性があります
{{Saving on TiddlyDesktop}}
{{Introducing TiddlyDesktop Video}}
! ソース
TiddlyDesktopは、[[オープンソース|OpenSource]]プロジェクト[[NW.js]]をベースにしています。ソースはGitHubにあります:
https://github.com/TiddlyWiki/TiddlyDesktop/
[[TiddlyDesktopのリリース|TiddlyDesktop Releases]]と[[TiddlyDesktopのカスタマイズ方法|How to Customize TiddlyDesktop]]を参照してください

View File

@@ -1,31 +0,0 @@
created: 20150621181334837
modified: 20250124111732489
original-modified: 20150621181400844
tags: [[TiddlyWiki on Node.js]]
title: MultiTiddlerFileSyntax
ja-title: マルチTiddlerファイル構文
type: text/vnd.tiddlywiki
!!! [[マルチTiddlerファイル|MultiTiddlerFiles]]
<$railroad text="""
{<"ヘッダー行">} "空行" {(<"Tiddler記述行"> | <"コメント行">)}
"""/>
!!! ヘッダー行
<$railroad text="""
<"識別子"> ":" {"ホワイトスペース"} <"値"> "改行"
"""/>
!!! Tiddler記述行
<$railroad text="""
<"ファイルパス"> ":" {"ホワイトスペース"} <"Tiddlerタイトル"> "改行"
"""/>
!!! コメント行
<$railroad text="""
"#" {("テキスト" | "ホワイトスペース")} "改行"
"""/>

View File

@@ -1,38 +0,0 @@
created: 20140209143652456
modified: 20250123115055695
original-modified: 20150621182140407
tags: [[TiddlyWiki on Node.js]]
title: MultiTiddlerFiles
ja-title: マルチTiddlerファイル
type: text/vnd.tiddlywiki
MultiTiddlerFilesを使用すると、複数のTiddlerを1つのテキストファイルに簡潔に表現できます。
この形式の目標は次のとおりです:
* 入力しやすく、読みやすい
* 単一行の文字列に最適化
* Tiddlerのグループ内で共通のフィールドやタグを共有できるようにする
* 外部ツールで簡単に処理できるようにする
MultiTiddlerFilesの拡張子は`multids`です。ファイルは、共有フィールドのブロックとそれに続く空白行で構成されます。ファイルの残りの部分は、コメントとTiddlerのシーケンスです。Tiddlerはタイトルで指定され、その後にコロン、少なくとも1つのスペース文字が続き、行の残りの部分はTiddlerのテキストフィールドになります。
例:
```
title: $:/language/ControlPanel/
tags: strings
modifier: JoeBloggs
Basics/Caption: Basics
# This is a comment
Basics/Version: ~TiddlyWiki Version
```
この例では、[[$:/language/ControlPanel/Basics/Caption]]と[[$:/language/ControlPanel/Basics/Version]]の2つのTiddlerを定義します。
ヘッダーで`title`フィールドが指定されている場合、タイトルで定義された個々のTiddlerのプレフィックスとして扱われます。
!! 構文の仕様
{{MultiTiddlerFileSyntax}}

View File

@@ -1,112 +0,0 @@
created: 20130825150000000
modified: 20250125105846987
original-modified: 20210714130751701
tags: [[TiddlyWiki on Node.js]]
title: TiddlerFiles
ja-title: Tiddlerファイル
type: text/vnd.tiddlywiki
Tiddlerは、さまざまな形式でテキストファイルに保存できます。単一のTiddlerを含むファイルには、名前:値のペアのシーケンスとしてフォーマットされた`.meta`補助ファイルを持つこともできます。
```
title: TheTitle
modifier: someone
```
!! ~TiddlyWebスタイルの.tidファイル
これらのファイルは、名前:値のペア、空白行、そしてTiddlerのテキストを含む一連の行で構成されます。例:
```
title: MyTiddler
modifier: Jeremy
This is the text of my tiddler.
```
多くのテキストエディターでは、ファイルに終了改行が含まれている必要があることに注意してください。Tiddlerのテキストに終了改行を含めたくない場合は、次の代替構文を使用できます:
```
title: MyTiddler
modifier: Jeremy
text: This is the text of my tiddler.
```
//`application/x-tiddler` ContentTypeはこれらのファイルの内部で使用されます//
!! TiddlyWiki `<DIV>` .tiddlerファイル
TiddlyWiki 5では、`*.tiddler`ファイルは次のようになります。
```
<div title="AnotherExampleStyleSheet" modifier="blaine" created="201102111106" modified="201102111310" tags="examples" creator="psd">
<pre>Note that there is an embedded <pre> tag, and line feeds are not escaped.
And, weirdly, there is no HTML encoding of the body.</pre>
</div>
```
これらの`*.tiddler`ファイルは、HTML エンコードされたTiddlyWiki HTMLファイル内のTiddlerとまったく同じではありません。
Older `*.tiddler` files more closely matched the store format used by TiddlyWiki at the time:
古い`*.tiddler`ファイルは、当時TiddlyWikiで使用されていたストア形式に似ています:
```
<div tiddler="AnotherExampleStyleSheet" modifier="JeremyRuston" modified="200508181432" created="200508181432" tags="examples">This is an old-school .tiddler file, without an embedded &lt;pre&gt; tag.\nNote how the body is &quot;HTML encoded&quot; and new lines are escaped to \\n</div>
```
//`application/x-tiddler-html-div` ContentTypeはこれらのファイルの内部で使用されます//
!! ~TiddlyWebスタイルのJSONファイル
これらのファイルは、`name:value`プロパティのハッシュマップの単純な配列です。すべてのフィールド値は文字列として指定する必要があります。
例:
```
[
{
"title": "First Tiddler",
"text": "Text of first tiddler",
"tags": "one two [[t h r e e]]"
},{
"title": "Second Tiddler",
"text": "Text of second tiddler",
"modified": "20150216171751154"
}
]
```
`application/json` ContentTypeはこれらのファイルに対して内部で使用されます。
Tiddler構造に準拠していないJSONファイルは、代わりにJSONデータを含む単一のTiddlerとしてインポートされることに注意してください。
!! TiddlyWiki HTMLファイル用の新しいJSONベースの形式
TiddlyWiki HTMLファイルの新しい形式では、スクリプトタグ内にJSON形式のTiddlerが埋め込まれます:
```json
<script class="tiddlywiki-tiddler-store" type="application/json">[
{"title": "A","text": "One"},
{"title": "B","text": "Two"}
]</script>
```
!! TiddlyWiki HTMLファイル用の古いDIVベースの形式
TiddlyWikiクラシックおよびバージョンv5.2.0より前のTiddlyWiki 5では、Tiddlerは`<DIV>`形式でエンコードされて保存されていました。
TiddlyWikiが暗号化されていないDIVベースのHTMLファイルをインポートするには、上で説明したようにTiddler DIVを含んだ`<div id="storeArea">`が必要です。例:
```
<div id="storeArea">
<div created="20130302085406905" modified="20130302084548184" tags="Examples" title="A tiddler title">
<pre>HTML encoded text of tiddler
</pre>
</div>
<div created="20140315085406905" modified="20140321084548184" tags="One Two [[Three with Space]]" title="Another title" customfield="field value">
<pre>Text of this tiddler
</pre>
</div>
</div>
```

View File

@@ -1,37 +0,0 @@
created: 20130828190200000
modified: 20250120105549696
original-modified: 20241008031135403
tags: [[TiddlyWiki on Node.js]]
title: Generating Static Sites with TiddlyWiki
ja-title: TiddlyWikiで静的サイトを生成する
type: text/vnd.tiddlywiki
TiddlyWiki5は、JavaScriptを必要としないTiddlyWikiの静的HTML表現を生成できます。このプロセスでは、ローカルシステムのNode.jsにTiddlyWikiがインストールされている必要があります。詳細については、[[Node.jsにTiddlyWikiをインストールする|Installing TiddlyWiki on Node.js]]を参照してください。
静的HTMLの生成方法には多くの柔軟性があります。次のシナリオはすべて https://tiddlywiki.com で説明されています。
! WikiスナップショットとTiddlerスナップショット
https://tiddlywiki.com/static.html で、メインのTiddlyWikiサイトの静的な表現を見ることができます。このファイルは、現在のDefaultTiddlersの静的スナップショットです。このファイルにリンクされているすべてのTiddlerは、個々のTiddlerの静的スナップショットを指す`/static/HelloThere.html`形式のURLによって参照されます。TiddlerのHTMLファイルは、`static.css`スタイルシートファイルを参照します。
次のコマンドは、TiddlyWiki5サイトの静的バージョンのサンプルを生成するために使用されます:
```sh
tiddlywiki wikipath --render '[!is[system]]' '[encodeuricomponent[]addprefix[static/]addsuffix[.html]]' text/plain $:/core/templates/static.tiddler.html
tiddlywiki wikipath --render $:/core/templates/static.template.html static.html text/plain
tiddlywiki wikipath --render $:/core/templates/static.template.css static/static.css text/plain
```
最初のRenderCommandは、フィルタ`[!is[system]]`を使用してすべての個別の非システムTiddlerのHTML表現を生成し、次のフィルタ`[encodeuricomponent[]addprefix[static/]addsufixx[.html]]`は各タイトルにURIエンコーディングを適用し、プレフィックス`static/`を追加して、最後にサフィックス`.html`を追加します。2番目のRenderCommandは、DefaultTiddlersの静的バージョンを`static.html`に保存し、最後のRenderCommandはスタイルシートを保存します。(すべてのファイルは、Wikiフォルダの`output`フォルダに配置されます)。
! 内部リンク付きWikiスナップショット
Tiddlerの静的表現を含み、標準のHTMLアンカーリンクを使用してそれらの間を移動する単一のHTMLファイルを作成することも可能です。
例: https://tiddlywiki.com/alltiddlers.html
この例は次のコマンドによって構築できます:
```
--render $:/core/templates/alltiddlers.template.html alltiddlers.html text/plain
```

View File

@@ -1,19 +0,0 @@
created: 20131124220600000
modified: 20250121112457196
original-modified: 20241025051111864
tags: [[TiddlyWiki on Node.js]]
title: How to build a TiddlyWiki5 from individual tiddlers
ja-title: 個々のTiddlerからTiddlyWiki5を構築する方法
type: text/vnd.tiddlywiki
まず、[[Node.jsにTiddlyWikiをインストール|Installing TiddlyWiki on Node.js]]の説明に従ってTiddlyWikiをインストールします。
# 空の[[TiddlyWikiFolder|TiddlyWikiFolders]]を作成します
## 適当な場所に新しいフォルダを作成します (例: `~/MyWiki`)
## 次のテキストを含む`tiddlywiki.info`というファイルを作成します:
##* `{"themes": ["tiddlywiki/vanilla","tiddlywiki/snowwhite"]}`
## `tiddlers`というサブフォルダを作成します
##* あるいは、TiddlyWiki5リポジトリから、`editions/empty`フォルダをコピーします
# `~/MyWiki/tiddlers`ディレクトリ内に個々のTiddlerFilesを作成します
# TiddlyWiki5ルートディレクトリから次のコマンドを実行して、TiddlerからTiddlyWiki5ファイルを構築します:
## `tiddlywiki ~/MyWiki --render $:/core/save/all index.html text/plain`

View File

@@ -1,31 +0,0 @@
created: 20130825150100000
modified: 20250204104525288
original-modified: 20140912141559011
tags: [[TiddlyWiki on Node.js]]
title: Using TiddlyWiki for GitHub project documentation
ja-title: GitHubプロジェクトのドキュメントにTiddlyWikiを使用する
type: text/vnd.tiddlywiki
TiddlyWiki5は、GitHubプロジェクトのドキュメントを作成するために使用できます。ソースコード管理下にある個別のTiddlerファイルを含む[[TiddlyWikiフォルダ|TiddlyWikiFolders]]として単一のドキュメントセットを維持し、それを使用してプロジェクトフォルダーに含める`readme.md`ファイルや[[GitHub Pages|http://pages.github.com/]]に保存するHTMLファイルを作成できます。両方の機能は、TiddlyWiki5自身によって実証されています。
! `readme.md`ファイルの生成
フォルダーの内容を表示する際、GitHubは`readme.md`ファイルを探して表示します。この方法では完全なHTMLファイルではなく、静的なMarkDownファイルのみが表示されることに注意してください(これはセキュリティ対策です)。幸いなことに、MarkDownはHTMLの安全なサブセットを許可しているため、GitHubに適した`readme.md`ファイルを生成するには、TiddlyWiki5がHTMLドキュメントの`<body>`要素の内容を生成し、適切なファイル名を付けるだけで済みます。
これは次のコマンドで実行できます:
```
--rendertiddler ReadMe ./readme.md text/html
```
ReadMe Tiddlerを`text/html`形式でファイル`./readme.md`に保存します。
デフォルトでは、Tiddlerのリンクは、Tiddlerのタイトルで構成される相対URIへのリンクとしてレンダリングされます。この動作は、ReadMe Tiddlerの先頭で行われているように、マクロ`tv-wikilink-template`を定義することで上書きできます
```
\define tv-wikilink-template() https://tiddlywiki.com/static/$uri_doubleencoded$.html
```
詳細については、LinkWidgetを参照してください。
この例では、Tiddlerのリンクはtw5.comの静的レンダリングへのリンクとしてレンダリングされます。

View File

@@ -1,16 +0,0 @@
created: 20140613133627669
modified: 20241230102718926
original-modified: 20140912141613393
tags: [[TiddlyWiki on Node.js]]
title: Using a custom path prefix with the client-server edition
ja-title: クライアント-サーバーエディションでカスタムのパスプレフィックスを使用する
type: text/vnd.tiddlywiki
デフォルトでは、[[Node.js上のTiddlyWiki|TiddlyWiki on Node.js]]を実行すると、サーバーはプロトコル、ホスト、ポートから形成されたURI - 例えば、`http://127.0.0.1:8080/`でWikiを公開します。
`http://127.0.0.1:8080/path/to/my/wiki/`のようなカスタムパスでWikiを実行するには、2つの手順があります:
# ServerCommandの''pathprefix''属性として`/path/to/my/wiki`を渡してサーバーを設定します
# `$protocol$//$host$/path/to/my/wiki/`を含む、`$:/config/tiddlyweb/host`というTiddlerを作成してクライアントを設定します

View File

@@ -0,0 +1,27 @@
created: 20151231083708980
modified: 20241221105811581
original-modified: 20211117212723856
tags: Languages
title: LanguageGallery Example
ja-title: 言語ギャラリー
type: text/vnd.tiddlywiki
これは、ListWidgetとTranscludeWidgetを使用して、<<tag Language>>と<<tag Icon>>の[[タグ付け|Tagging]]された言語アイコンすべてをグリッド表示する例です。
<style>
.language-gallery img {
width: 5em;
height: auto;
margin: 0.5em;
-webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
-moz-box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}
</style>
<div class="language-gallery">
<$list filter="[all[tiddlers+shadows]tag[Language]tag[Icon]]">
<span title=<<currentTiddler>>>
<$transclude/>
</span>
</$list>
</div>

View File

@@ -1,27 +0,0 @@
created: 20131129094452285
modified: 20241227110457591
original-modified: 20140912141658212
tags: [[TiddlyWiki on Node.js]]
title: Building TiddlyWikiClassic
ja-title: TiddlyWikiClassicの構築
type: text/vnd.tiddlywiki
TiddlyWiki5を使用すれば、TiddlyWikiClassicの古いバージョン2.xxをその構成コンポーネントから構築できます。これには次の機能が含まれます:
* `tiddlywiki/classictools`プラグインには、TiddlyWiki 2.xxの`.recipe`ファイルからTiddlerをロードできるようにするデシリアライザモジュールが含まれています
* ViewWidgetのための`stripcomments`フォーマットは、`//#`で始まる1行のJavaScriptコメントを削除します
* FieldsWidgetの`stripTitlePrefix='yes'`属性は、`title`属性から中括弧で囲まれたプレフィックスを削除します
** 例えば、`{tiddler}HelloThere`は、`HelloThere`に変換されます
! 使用法
TiddlyWikiClassicは、[[Node.js上のTiddlyWiki|TiddlyWiki on Node.js]]を実行することによってコマンドラインから構築されます。一般的な使用法は次のようになります:
```
node ../../tiddlywiki.js \
--verbose \
--load <path_to_recipe_file> \
--rendertiddler $:/core/templates/tiddlywiki2.template.html <path_to_write_index_file> text/plain \
|| exit 1
```

View File

@@ -1,58 +0,0 @@
created: 20160424181300000
modified: 20241230104855826
original-modified: 20210803204659026
tags: [[TiddlyWiki on Node.js]]
title: Customising Tiddler File Naming
ja-title: Tiddlerファイル名のカスタマイズ
type: text/vnd.tiddlywiki
デフォルトでは、[[Wikiフォルダー|TiddlyWikiFolders]]を使用する[[Node.js上のTiddlyWiki|TiddlyWiki on Node.js]]インスタンスは、サニタイズされ、曖昧さが解消されたタイトルをファイル名として使用して、新しいTiddlerファイルを作成します。すべてのファイルパス操作は、`default-tiddler-location`からの相対で、デフォルトではWikiフォルダーの`tiddlers/`ディレクトリです。`config`オブジェクトの`default-tiddler-location`プロパティを使用して、Wikiのtiddlywiki.infoファイル内のパスをマッピングすることで、これを上書きできます。
デフォルトのファイル拡張子`.tid`は、`type`フィールドが欠落しているTiddlerや、"text/vnd.tiddlywiki"タイプが"text/vnd.tiddlywiki"のTiddlerに使用されます。他のタイプのTiddlerは、(ブートスタートアップ時に定義される)MIMEタイプに従って保存されます。
オプションのTiddler[[$:/config/FileSystemPaths]]と[[$:/config/FileSystemExtensions]]を作成することにより、論理パス(ディレクトリとファイル名)とファイル拡張子を個別にカスタマイズできます。
! ファイルシステムパス
論理パスは、1つ以上の[[フィルター式|Filter Syntax]](各フィルター式は1行に1つずつ)を含む[[$:/config/FileSystemPaths]] Tiddlerを作成することでカスタマイズできます。Tiddlerがディスクに保存されるたびに、各フィルターが順番にテストされ、出力を生成する最初のフィルターの最初の出力が、Tiddlerファイルに使用される論理パスとして取得されます。論理パスが変更された場合は、新しいファイルが作成され、古いファイルは削除されます。
Tiddlerは、[[Wikiフォルダ|TiddlyWikiFolders]]、`default-tiddler-location`設定で定義されたパス、または $:/config/OriginalTiddlerPaths Tiddlerに保存された特定のパス([[tiddlywiki.filesファイル|tiddlywiki.files Files]]を参照)にのみ書き込むことができます。Tiddlerをディスクに保存するときに、論理パスがWikiフォルダのパスで始まらない(最も一般的なエラー)と、ファイルパスがJavascriptの`encodeURIComponent()`メソッドによってエンコードされ、Wikiフォルダの`default-tiddler-location`にTiddlerがファイルとして保存されます。
論理パスにはディスク上のファイルの拡張子は含まれません(下記参照)。また、ディレクトリ区切り文字として`/`や`\`を使用できます(物理パスを生成するときに、~TiddlyWikiが動作しているプラットフォームの正しい区切り文字に置き換えられます)。フィルターがどれも一致しない場合、論理パスは、結果のパスがすべてのサポートされているプラ​​ットフォームで有効であることを保証するため、すべての`/\<>~:"|?*^`文字が`_`に置き換えられたタイトルになります。論理パスも200文字に制限されています。この名前のファイルがすでに存在する場合、スペースと数字が最終的なファイルパスに追加され、未使用のパスが見つかるまで数字が増加していきます。
!! 例
```
[is[system]!has[draft.of]removeprefix[$:/]addprefix[_system/]]
[is[draft]search-replace:g:regexp[/|\\],[_]addprefix[drafts/]]
[tag[task]addprefix[mytasks/]]
[!tag[externalnote]addprefix[wiki/]]
```
<<.note "すべてのパスはWikiの`default-tiddler-location`からの相対パスです。">>
これにより、他のTiddlerの下書きではない、新しく作成されたシステムTiddlerが`./_system/`(`$:/`プレフィックスの削除後)に保存されます。次に、すべての下書きのタイトルのパス区切り文字が"_"に置き換えられ、`./drafts/`に保存されます。そして、[[task]]タグが付けられたTiddlerがサブディレクトリ`./mytasks/`に保存されます。最後に、"externalnote"タグが付けられていないすべてのTiddlerが最終的に`[!tag[externalnote]addprefix[wiki/]]`に一致し、これらが`./wiki/`に保存されます。この例では、"externalnote"タグが付けられたTiddlerが[[tiddlywiki.filesファイル|tiddlywiki.files Files]]を使用してインポートされています。"isEditableFile"フラグがtrueに設定されているファイルにより、サーバーは$:/config/OriginalTiddlerPaths Tiddlerに元のファイルパスを記憶します。
Tiddlerが $:/config/FileSystemPaths フィルターのマッチを生成するたびに、Tiddlerのタイトル内の`/`や`\`がパス区切り文字にマップされます。上記のフィルターを使用すると、非システム、非ドラフトのTillder(タグなし)`some/thing/entirely/new`が`./wiki/some/thing/entirely/new.tid`に保存されます(つまり、`entirely/`というディレクトリ内の`new.tid`ファイル)。したがって、プラットフォームに応じて、 $:/config/FileSystemPaths 自体は`./_system/config/FileSystemPaths.tid`や`.\_system\config\FileSystemPaths.tid`に保存されます。
! ファイルシステム拡張子
通常、ディスク上のTiddlerのファイルシステム拡張子は、改行を含むフィールド値や空白で始まるか終わる(テキストフィールド以外の)フィールド値の存在によって決定されます。この場合、単一ファイル".json" Tiddlerファイル形式が使用されます。
Tiddlerにこのようなフィールド値がない場合、`type`フィールドが参照され、一致するファイルタイプが検索されます。タイプ値のないTiddlerの場合は`.tid`が使用されます。ブートエンジンは、[[$:/boot/boot.js]] Tiddlerで、Tiddlerタイプとファイルタイプの関係のセットを定義します。これらの関係を定義するコードのセクションを見つけるには、`// Add file extension information`を検索してください。
個々のTiddlerのファイル拡張子は、1つ以上の[[フィルタ式|Filter Syntax]](各行に1つずつ)を含むTiddler[[$:/config/FileSystemExtensions]]を作成することでカスタマイズできます。Tiddlerがディスクに保存されるたびに、これらのフィルタに対してテストされ、出力を生成する最初のフィルタの最初の出力が、Tiddlerファイルに使用されるファイル拡張子として使用されます。拡張子は常に先頭にドットを付ける必要があります(例を参照)。一致するフィルタがない場合は、デフォルトの拡張子が使用されます。拡張子が変更された場合は、新しいファイルが作成され、古いファイルは削除されます。
<<.note """".tid"の結果は、Tiddlerを単一ファイルのテキストTiddlerとしてディスクに書き込むことを強制します。".json"の結果は、Tiddlerをjson形式(配列内の単一のTiddler フィールドオブジェクト)の単一ファイルTiddlerとしてディスクに書き込むことを強制します。"application/json"タイプのTiddlerとしては書き込まれません。認識されるその他のすべてのファイルタイプは、定義された拡張子を使用して保存され、"text"フィールド以外のすべてのフィールドを説明する同じ名前の *.meta ファイルが付随します。""">>
!! 例
```
[tag[.txt]then[.txt]]
[tag[.json]then[.json]]
[tag[.tid]then[.tid]]
```
これにより、タグ".txt"を持つすべてのTiddlerが、ファイルシステムのパスフィルターによって決定されたファイルパスに保存されますが、テキストフィールドは *.txt ファイルとして保存され、その他のすべてのフィールドは *.txt.meta ファイルとして保存されます。
次に、".json"タグを持つすべてのTiddlerが *.json ファイルとして保存されます。最後に、タグ".tid"を持つすべてのTiddlerが単一のファイルとして保存されます。Tiddlerがどのフィルターにも一致しない場合は、Tiddlerの`type`フィールドによって決定されるデフォルトの拡張子が使用されます。

View File

@@ -1,27 +0,0 @@
created: 20140617211749290
modified: 20250120104354585
original-modified: 20220613114121229
tags: [[TiddlyWiki on Node.js]]
title: Environment Variables on Node.js
ja-title: Node.jsの環境変数
type: text/vnd.tiddlywiki
[[Node.js上のTiddlyWiki|TiddlyWiki on Node.js]]は、プラグインとエディションを検索するためのパスの区切りリストを指定するために、次のOS環境変数をサポートしています:
* `TIDDLYWIKI_PLUGIN_PATH` - 通常のプラグインの検索パス
* `TIDDLYWIKI_THEME_PATH` - テーマの検索パス
* `TIDDLYWIKI_LANGUAGE_PATH` - 言語の検索パス
* `TIDDLYWIKI_EDITION_PATH` - エディションの検索パス (InitCommandによって使用される)
<$macrocall $name=".note" _="""''1.'' 区切り文字はオペレーティングシステムによって異なる場合があります。Windowsではセミコロン`;`が使用されますが、Linux ではコロン`:`が使用されます。<br><br>''2.'' Linuxシステムでは、変数を定義するだけでなく//''export''//する必要もあります。
"""/>
追加のパスはそれぞれ、~TiddlyWiki5 GitHubリポジトリの同等のディレクトリのように、構造化されたフォルダを指す必要があります: プラグイン、テーマ、言語のディレクトリには`publisher/pluginname/<files>`が含まれ、エディションのディレクトリには`editionname/<files>`が含まれます
例:
```
export TIDDLYWIKI_PLUGIN_PATH=~/MyPluginStore
tiddlywiki mywiki --build index
```

View File

@@ -1,16 +0,0 @@
created: 20150926162849519
modified: 20241228110350676
original-modified: 20191022095509822
tags: [[TiddlyWiki on Node.js]]
title: Installing TiddlyWiki Prerelease on Node.js
ja-title: Node.jsにTiddlyWikiプレリリースをインストールする
type: text/vnd.tiddlywiki
# https://github.com/TiddlyWiki/TiddlyWiki5 からTiddlyWiki5 GitHubリポジトリのローカルコピーをクローンします
# コマンドラインターミナルを開き、現在の作業ディレクトリをTiddlyWiki5リポジトリのルートに変更します
# `npm link` (Windows) または `sudo npm link` (Mac/Linux) と入力して、[[npm]]にこのリポジトリのコピーをグローバルにインストールされたものとして使用するように指示します
# ルート内で、次のようにして~TiddlyWikiを起動できます: <br/>``tiddlywiki editions/tw5.com-server --listen``
この手順を実行すると、通常の方法`npm install -g tiddlywiki`でインストールした場合と同じように、[[npm]]経由でTiddlyWiki5を操作できるようになります。
最新のコードを確実に取得するために、クローンを定期的に更新してください。

View File

@@ -1,23 +0,0 @@
created: 20191022095653896
modified: 20250122105447127
original-modified: 20220617130125173
tags: [[TiddlyWiki on Node.js]] PluginsCS
title: Installing custom plugins on Node.js
ja-title: Node.jsにカスタムプラグインをインストールする
type: text/vnd.tiddlywiki
\rules except wikilink
! 紹介
Node.jsクライアントサーバー構成でTiddlyWikiを使用する場合、公式プラグインとカスタムプラグインをインストールするにはいくつかの方法があります。
注記
<$macrocall $name=".note" _="""ライブラリから単一ファイルWikiにプラグインをインストールする手順については、[[プラグイン|Plugins]]で詳細を確認してください。
"""/>
!! プラグインのロード順序
{{Plugin Ordering}}

View File

@@ -1,41 +0,0 @@
created: 20220611123344385
modified: 20250123113223702
original-modified: 20220617132351460
tags: [[TiddlyWiki on Node.js]] PluginsCS
title: Installing official plugins on Node.js
ja-title: Node.jsに公式プラグインをインストールする
type: text/vnd.tiddlywiki
クライアント-サーバーNode.js構成でTiddlyWikiを使用する場合は、次の手順に従ってください:
# <<controlPanel-plugin-link>>の''プラグイン''タブを使用してインストールするプラグインを特定します。(ただし、ここからプラグインをインストール''しないで''ください)
#* プラグインは、その種類(言語、テーマ、プラグイン)と発行元、タイトルによって識別されます。たとえば、`$:/plugins/tiddlywiki/internals`プラグインは''tiddlywiki/internals''として参照されます
# サーバーが実行中の場合は終了します
# `tiddlywiki.info`ファイル(JSON形式)を編集し、`plugins`、`themes`、`languages`セクションを見つけます(下記参照)
# 追加したいプラグインに対応するエントリを追加します
#* 項目を区切る''カンマ''を残すように注意してください
#* リストの最後の項目をコンマで終わらせ''ないで''ください
# サーバーを再起動します
```
{
"plugins": [
"tiddlywiki/codemirror"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
],
"languages": [
"es-ES",
"fr-FR",
"en-EN"
]
}
```
<$macrocall $name=".note" _="プラグインの操作の概要については、[[プラグイン|Plugins]]を参照してください。<br>また、[[Node.jsにカスタムプラグインをインストールする|Installing custom plugins on Node.js]]も参照してください。"/>

View File

@@ -1,52 +0,0 @@
created: 20131219100637788
modified: 20250124112753177
original-modified: 20141015165343893
tags: [[TiddlyWiki on Node.js]]
title: Scripts for TiddlyWiki on Node.js
ja-title: Node.js上のTiddlyWiki用スクリプト
type: text/vnd.tiddlywiki
! スクリプトファイル
TiddlyWiki5リポジトリの`bin`フォルダーには、共通のタスクを自動化したり、独自のスクリプトの便利な開始点として使用したりできるスクリプトがいくつか含まれています。https://tiddlywiki.com/ の構築とリリースに使用されるスクリプトの詳細については、[[Scripts for building tiddlywiki.com]]を参照してください。
すべてのスクリプトは、リポジトリのルートフォルダーから実行されることを想定しています。
!! `serve`: tw5.comを提供する
```
./bin/serve.sh -h
./bin/serve.sh [edition dir] [username] [password] [host] [port]
```
または:
```
./bin/serve.cmd -h
./bin/serve.cmd [edition dir] [username] [password] [host] [port]
```
このスクリプトは、TiddlyWiki5をHTTPサーバーとして実行し、`tw5.com-server`エディションのコンテンツをデフォルトにします。デフォルトでは、Node.jsは8080ポート でサービスを提供します。オプションの`username`パラメータが指定されている場合は、編集の署名に使用されます。`password`が指定されている場合は、HTTP基本認証が使用されます。`-h`パラメータを指定してスクリプトを実行すると、オンラインヘルプが表示されます。
この構成を試すには、スクリプトを実行してからブラウザで`http://127.0.0.1:8080`にアクセスしてください。
ブラウザで行われた変更は、HTTP経由でサーバーに伝えられます(これらのリクエストを確認するには、ブラウザ開発者コンソールを使用します)。その後、サーバーは変更をファイルシステムに同期します(各変更をスクリーンに記録します)。
!! `test`: テストをビルドして実行する
This script runs the `test` edition of TiddlyWiki on the server to perform the server-side tests and to build `test.html` for running the tests in the browser.
このスクリプトは、サーバー側のテストを実行し、ブラウザでテストを実行するために、`test.html`をビルドし、サーバー上でTiddlyWikiの`test`のエディションを実行します。
!! `lazy`: tw5.comを遅延読み込み画像で提供する
```
./bin/lazy.sh <username> [<password>]
```
または:
```
./bin/lazy.cmd <username> [<password>]
```
このスクリプトは、画像に[[遅延読み込み|LazyLoading]]を適用して`tw5.com-server`エディションコンテンツを提供します。

View File

@@ -1,24 +0,0 @@
created: 20131129094353704
modified: 20241227105025118
original-modified: 20220617114433107
tags: Platforms
title: TiddlyWiki on Node.js
ja-title: Node.js上のTiddlyWiki
type: text/vnd.tiddlywiki
\rules except wikilink
[[Node.js]]でTiddlyWikiを実行すると、単一ファイルバージョンに比べていくつかの重要な利点が得られます:
* 個々のTiddlerは別々のファイルに保存され、必要に応じて整理できます。
* 共有コンテンツと独自コンテンツのさまざまな組み合わせをブレンドした複数のWikiを構築する機能
* スマートフォンやタブレットを含むあらゆる最新ブラウザでコンテンツを編集できます
<<.warning """Node.js上のTiddlyWikiは現在、実行中にファイルシステム経由でTiddlerファイルを直接変更することをサポートしていないことに注意してください。変更を有効にするには、サーバーを再起動する必要があります。実行中の Wikiを編集するには、HTTPやJavaScript APIを使用することをお勧めします。""">>
詳細については、以下を参照してください:
<<list-links "[tag[TiddlyWiki on Node.js]]">>

View File

@@ -1,33 +0,0 @@
created: 20220611125113040
modified: 20250204103637098
original-modified: 20220617133704286
tags: [[TiddlyWiki on Node.js]] PluginsCS
title: Uninstalling a plugin with Node.js
ja-title: Node.jsでプラグインをアンインストールする
type: text/vnd.tiddlywiki
クライアント-サーバー Node.js構成でTiddlyWikiを使用する場合は、次の手順に従ってください:
# サーバーが実行中の場合は終了します
# `tiddlywiki.info`ファイル(JSON形式)を編集し、`plugins`と`themes`セクションを見つけます(下記参照)
# 削除したいプラグインに対応するエントリを削除します
#* 項目を区切る''カンマ''を残すように注意してください
#* リストの最後の項目をコンマで終わらせ''ない''でください
# サーバーを再起動します
```
{
"plugins": [
"tiddlywiki/codemirror"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
]
}
```
<$macrocall $name=".note" _="プラグインの操作方法の概要については、[[プラグイン|Plugins]]で確認できます"/>

View File

@@ -1,19 +0,0 @@
created: 20131219100544073
modified: 20241228112745930
original-modified: 20140912141800426
tags: [[TiddlyWiki on Node.js]]
title: Upgrading TiddlyWiki on Node.js
ja-title: Node.js上のTiddlyWikiのアップグレード
type: text/vnd.tiddlywiki
通常の方法で[[Node.js上のTiddlyWiki|TiddlyWiki on Node.js]]をインストールした場合、新しいバージョンがリリースされたときに、次のコマンドでアップグレードできます:
```
npm update -g tiddlywiki
```
MacやLinuxでは、次のように''sudo''を追加する必要があります:
```
sudo npm update -g tiddlywiki
```

View File

@@ -1,43 +0,0 @@
created: 20131219100520659
modified: 20250206101730728
original-modified: 20241025051303991
tags: [[TiddlyWiki on Node.js]]
title: Using TiddlyWiki on Node.js
ja-title: Node.jsでTiddlyWikiを使用する
type: text/vnd.tiddlywiki
~TiddlyWiki5には、[[TiddlyWikiフォルダ|TiddlyWikiFolders]]、[[Tiddlerファイル|TiddlerFiles]]に基づいて広範な操作を実行するためにコマンドラインで使用するコマンドセットが含まれています。
たとえば、次のコマンドは、~TiddlyWiki HTMLファイルからTiddlerを読み込み、そのうちの1つを静的HTMLに保存します:
```
tiddlywiki --verbose --load mywiki.html --render ReadMe ./readme.html
```
コマンドラインから`tiddlywiki`を実行すると、~TiddlyWikiカーネルが起動し、コアプラグインがロードされ、空のWikiストアが確立されます。次に、コマンドライン引数を左から右に順番に処理します。引数はスペースで区切られます。
<<.from-version "5.1.20">> まず、プレフィックス`+`で始まるプラグイン名や、`++`で始まるプラグインフォルダーへのパスによって識別される0個以上のプラグイン参照が存在する可能性があります。これらのプラグインは、[[TiddlyWikiフォルダ|TiddlyWikiFolders]]で指定されたプラグインに加えてロードされます。
次の引数は、ロードする[[TiddlyWikiフォルダ|TiddlyWikiFolders]]へのオプションのパスです。存在しない場合は、現在のディレクトリが使用されます。
コマンドとそれぞれの引数は以下のように示されます。各コマンドはプレフィックス`--`で識別されます。
```
tiddlywiki [+<pluginname> | ++<pluginpath>] [<wikipath>] [--<command> [<arg>[,<arg>]]]
```
例えば:
```
tiddlywiki --version
tiddlywiki +plugins/tiddlywiki/filesystem +plugins/tiddlywiki/tiddlyweb mywiki --listen
tiddlywiki ++./mygreatplugin mywiki --listen
```
<<.from-version "5.1.18">> 多数のパラメータをサポートするListenCommandなどのコマンドでは、[[名前付きコマンドパラメータ|NamedCommandParameters]]を使用して扱いやすくすることができます。例:
```
tiddlywiki wikipath --listen username=jeremy port=8090
```
使用可能なコマンドの完全なリストについては、[[コマンド|Commands]]を参照してください。

View File

@@ -1,25 +0,0 @@
created: 20131219100444289
modified: 20250206103847601
original-modified: 20140920134404247
tags: [[TiddlyWiki on Node.js]]
title: Working with the TiddlyWiki5 repository
ja-title: TiddlyWiki5リポジトリの操作
type: text/vnd.tiddlywiki
! 紹介
TiddlyWikiの開発に[[貢献|Contributing]]したい場合は、[[通常の方法でTiddlyWikiをインストールする|Installing TiddlyWiki on Node.js]]のではなく、GitHubリポジトリを直接動かすことができます。
Mario Pietschが[[短い紹介動画|Working with the TiddlyWiki5 repository video]]を作成しました。
! セットアップ
# GitHubのアカウントをお持ちでない場合は、アカウントを作成してください
# https://github.com/TiddlyWiki/TiddlyWiki5 からTiddlyWiki5 GitHubリポジトリをフォークします
# フォークのローカルコピーをクローンします
# コマンドラインターミナルを開き、現在の作業ディレクトリをリポジトリのルートに変更します
# `npm link` (Windows)か`sudo npm link` (Mac/Linux)と入力して、[[npm]]にこのリポジトリのコピーをグローバルにインストールされたものとして使用するように指示します
この手順を実行すると、`npm install -g tiddlywiki`による通常の方法でインストールした場合と同じように、[[npm]]経由でTiddlyWiki5を操作できるようになります。
[[Node.js上のTiddlyWiki用スクリプト|Scripts for TiddlyWiki on Node.js]]も参照してください。

View File

@@ -1,172 +0,0 @@
created: 20161015114118243
modified: 20250201104758596
original-modified: 20211114101256212
tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]]
title: tiddlywiki.files Files
ja-title: tiddlywiki.filesファイル
type: text/vnd.tiddlywiki
! 紹介
[[TiddlyWikiフォルダ|TiddlyWikiFolders]]内のサブフォルダーにあるJSONファイル`tiddlywiki.files`は、フォルダーを再帰的にスキャンしてTiddlerファイルを探す通常のロジックをオーバーライドします。代わりに、`tiddlywiki.files`ファイルは特定のファイルとフォルダーからTiddlerをロードするための指示を指定します。
ファイルの形式は、2つのオプションプロパティを持つオブジェクトです:
* ''tiddlers'' - ファイルから読み取ったフィールドを上書きや変更する機能を持つ外部ファイルを記述するオブジェクトの配列
* ''directories'' - 外部ディレクトリを記述するオブジェクトの配列、それらのディレクトリ内のどのファイルを処理すべきかを決定するフィルターと、ファイルから読み取ったフィールドのいずれかを上書きや変更する機能
`tiddlywiki.files`の処理に大幅な機能強化が[[リリース 5.1.14|Release 5.1.14]]で導入されたことに注意してください。
!! フィールドのオーバーライド
`tiddlywiki.files`ファイルの''tiddlers''セクションと''directories''セクションの両方に、`fields`オブジェクトを使用してフィールドの値を上書きやカスタマイズする機能が含まれています。
各フィールドは、フィールドに直接割り当てられる''文字列''や''配列''値として指定することも、<<.from-version "5.1.14">>フィールドの値を生成する方法を説明する''オブジェクト''として指定することもできます。オブジェクトには次のプロパティが含まれます:
* ''source'' - (オプション) フィールドのソース値を指定する文字列。指定しない場合は、既存の値が使用されます
** //filename// Tiddlerを含むファイルのファイル名
** //filename-uri-decoded// [[URIデコード|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent]]を適用した、Tiddlerを含むファイルのファイル名
** //basename// 拡張子なしのTiddlerを含むファイルのファイル名
** //basename-uri-decoded// [[URIデコード|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent]]を適用した、拡張子なしのTiddlerを含むファイルのファイル名
** //extname// Tiddlerを含むファイル名の拡張子
** //created// Tiddlerを含むファイルの作成日時
** //modified// Tiddlerを含むファイルの更新日時
** <<.from-version "5.3.0">> //filepath// ディレクトリの''path''プロパティを基準とした、Tiddlerを含むファイルのパス(''directories''宣言でのみ使用可能)
** <<.from-version "5.3.0">> //subdirectories// ディレクトリの''path''プロパティを基準とした、ファイルの相対パス内のサブディレクトリの配列(''directories''宣言でのみ使用可能)
* ''prefix'' - (オプション) フィールドの値の先頭に追加する文字列
* ''suffix'' - (オプション) フィールドの値の末尾に追加する文字列
! Tiddlersセクション
`tiddlers`配列内のファイルの仕様は、次のプロパティをサポートします:
* ''file'': (必須) Tiddlerデータを含むファイルへの絶対パスまたは相対パス (相対パスは`tiddlywiki.files`ファイルのパスを基準とします)
* ''isTiddlerFile'': (オプション) `true`の場合、ファイルは[[tiddlerファイル|TiddlerFiles]]として扱われ、Tiddlerを抽出するためにデシリアライズされます。それ以外の場合は、ファイルの生のコンテンツが解析されずに`text`フィールドに割り当てられます
* ''fields'': (オプション) Tiddlerファイルで提供されるフィールドを上書きやカスタマイズする値を含むオブジェクト (上記を参照)
* ''prefix''と''suffix'': (オプション) Tiddlerの`text`フィールドにプレフィックスとサフィックスとして付加される文字列
*> ''prefix''を指定することは、''fields''オブジェクトの`text`のフィールドを`{"prefix":"<prefixvalue>"}`に設定することと同じであることに注意してください。
! Directoriesセクション
`directories`配列内のディレクトリの仕様は次の形式を取ることができます:
* Tiddlerファイルを含むディレクトリへの絶対パスか相対パスを指定する、''string''リテラル(相対パスは`tiddlywiki.files`ファイルのパスを基準として解釈されます)。Tiddlerファイルはディレクトリを再帰的に検索されます
* <<.from-version "5.1.14">> 次のプロパティを持つ''object'':
** ''path'' - (必須) Tiddlerファイルを含むディレクトリへの絶対パスか相対パス(相対パスは`tiddlywiki.files`ファイルのパスを基準として解釈されます)。デフォルトではディレクトリは再帰的に検索されないことに注意してください。//searchSubdirectories//フラグが`true`に設定されていない限り、サブディレクトリは無視されます(以下を参照)。
** ''filesRegExp'' - (オプション) ディレクトリ内で処理するファイルのファイル名に一致する[[正規表現|https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions]]
** ''isTiddlerFile'' - (必須) `true`の場合、ファイルは[[Tiddlerファイル|TiddlerFiles]]として扱われ、Tiddlerを抽出するためにデシリアライズされます。それ以外の場合、ファイルの生のコンテンツが解析されずに`text`フィールドに割り当てられます
** ''isEditableFile'' - <<.from-version "5.1.23">> (オプション) `true`の場合、Tiddlerへの変更は元のファイルに保存されます。Tiddlerは、$:/config/FileSystemPathフィルターから結果が生成されない限り、元のファイルパスに保存されます。フィルターから結果が返された場合、生成された最終的なファイルパスが上書きされます。
** ''searchSubdirectories'' - <<.from-version "5.1.23">> (オプション) `true`の場合、//path//のすべてのサブディレクトリで(オプションの)//filesRegExp//に一致するファイルが再帰的に検索されます。//filesRegExp//が指定されていない場合は、//path//のすべてのサブディレクトリ内のすべてのファイルがロードされます。//source//属性の//filename//(上記を参照)によって生成されたTiddlerタイトルにはファイル名のみが含まれ、パスのサブディレクトリは含まれません。この結果、同じTiddlerタイトルでロードされた複数のファイルが存在する場合、そのTiddlerタイトルでロードされた最後のファイルのみがメモリに格納されます。これを防ぐには、//filename//の代わりに//filepath//属性を使用できます。または、複数のディレクトリオブジェクトを含め、//source//属性とともに//prefix//または//suffix//を使用してタイトルフィールドをカスタマイズすることもできます。
** ''fields'' - (必須) Tiddlerファイルで提供されるフィールドを上書きやカスタマイズする値を含むオブジェクト(上記を参照)
同じ名前にサフィックス`.meta`を加えたファイルを作成することで、特定のファイルのフィールドを上書きすることもできます。 -- TiddlerFilesを参照してください。
! 例
これらの`tiddlywiki.files`の例は、[[Wikiフォルダ|TiddlyWikiFolders]]の独自のサブディレクトリに配置する必要があります。
メインの[[TiddlyWiki 5 GitHub リポジトリ|https://github.com/TiddlyWiki/TiddlyWiki5]]にも`tiddlywiki.files`ファイルの例がいくつかあります。
!! PDFのフォルダをインポートする
この例では、相対パスで指定されたフォルダーから拡張子`.pdf`を持つすべてのファイルを取得します。このパスは"../../../"で始まり、この構成ファイルが格納されているフォルダーの3ディレクトリ階層上を示します。各Tiddlerは、次のフィールドを使用してLazyLoading用にセットアップされています:
* ''title'' - PDFファイルのURIデコードされたベースファイル名を設定。[[URIデコード|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent]]により、"/"などの文字をURIエンコードして"%2F"としてタイトルに含めることができます
* ''created'' - PDFファイルの作成日時を設定
* ''modified'' - PDFファイルの変更日時を設定
* ''type'' - `application/pdf`を設定
* ''tags'' - `$:/tags/AttachedFile`を設定
* ''text'' - 空の文字列を設定
* ''_canonical_uri'' - ファイル名と文字列"pdfs/"を連結した値を設定
```
{
"directories": [
{
"path": "../../../input/pdfs",
"filesRegExp": "^.*\\.pdf$",
"isTiddlerFile": false,
"fields": {
"title": {"source": "basename-uri-decoded"},
"created": {"source": "created"},
"modified": {"source": "modified"},
"type": "application/pdf",
"tags": ["$:/tags/AttachedFile"],
"text": "",
"_canonical_uri": {"source": "filename", "prefix": "pdfs/"}
}
}
]
}
```
!! テキストファイルのフォルダをインポートする
この例では、相対パスで指定されたフォルダから拡張子`.txt`を持つすべてのファイルを取得します。このフォルダはWikiのベースディレクトリ内にあり、現在の構成ファイルはWikiの"tiddlers/"ディレクトリ内のディレクトリにあります。したがって、この場合、パスは"../../"で始まり、2つのディレクトリ階層上に移動し、次に "externalnotes/"ディレクトリまで下ります。各Tiddlerは次のフィールドで設定されます:
* ''title'' - テキストファイルのURIデコードされたベースファイル名を設定します。[[URIデコード|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent]]により、"/"などの文字をURIエンコードして"%2F"としてタイトルに含めることができます
* ''created'' - テキストファイルの作成日時を設定
* ''modified'' - テキストファイルの変更日時を設定
* ''type'' - `text/plain`を設定
* ''tags'' - `[[note]] [[externalnote]] [[.txt]]`を設定(配列表記を使用)
* ''text'' - 設定されないため、ファイルの内容がテキストフィールドとして読み込まれます
```
{
"directories": [
{
"path": "../../externalnotes",
"filesRegExp": ".+\\.txt",
"isTiddlerFile": false,
"isEditableFile": true,
"fields": {
"title": {"source": "basename-uri-decoded"},
"created": {"source": "created"},
"modified": {"source": "modified"},
"type": "text/plain",
"tags": ["note", "externalnote", ".txt"]
}
}
]
}
```
これにより、`../../externalnotes/`ディレクトリ内のすべてのテキストファイルが個別のTiddlerとしてWikiに読み込まれます。これらは、さまざまなマークアップ言語のスニペットコレクションである可能性があります。次に、これらの各Tiddlerの`type`フィールドを、言語に合わせて変更できます。たとえば、Wikitextの場合は"text/vnd.tiddlywiki"、マークダウンファイルの場合は"text/markdown"です。次に、次の行で$:/config/FileSystemPathsと$:/config/FileSystemExtentions Tiddlerを使用すると、これらのTiddlerへの変更が、開始元のディレクトリに保存され、"*.txt"ファイルとして、"*.txt.meta"ファイルとともに保存されます。これらのメタファイルは必要に応じて生成され、サーバーの再起動時に、`tiddlywiki.files`構成ファイルから生成されたフィールド(Tiddlerの`type`フィールドなど)が上書きされます。
[[Tiddlerファイル名のカスタマイズ|Customising Tiddler File Naming]]の例から、$:/config/FileSystemPaths Tiddler内の最後のフィルター`[!tag[externalnote]addprefix[wiki/]]`は、`externalnotes`でタグ付けされたすべてのTiddler(以前のフィルターに一致しなかったもの)を除外することがわかります。これらのTiddlerのファイルパスは、ブート起動時に生成された$:/config/OriginalTiddlerPathsから取得されます。
次に、$:/config/FileSystemExtensions Tiddler内のフィルター`[tag[.txt]then[.txt]]`により、これらすべてのTiddlerが*.txtおよび付随する*.txt.metaファイルとしてディスクに保存されます(通常のTiddlerタイプとファイルタイプのマッピングを上書きします)。この場合、Tiddlywiki Wikitextやマークダウンテキストのスニペットを"テキスト"(*.txtファイル)に保存できるようになります。
!! 画像のインポートと自動タグ付け
この例では、`files`ディレクトリとそのすべてのサブディレクトリ内のすべての画像ファイルを外部画像Tiddlerとしてインポートし、ファイルパスに基づいてタグ付けします。各Tiddlerには、次のフィールドが設定されます:
* ''title'' - テキストファイルのURIデコードされたベースファイル名を設定
* ''created'' - テキストファイルの作成日時を設定
* ''modified'' - テキストファイルの更新日時を設定
* ''type'' - `image/jpeg`に設定します。現在、ファイルから画像Tiddlerの正しいContentTypeを推測する方法はありませんが、`image/jpeg`Tiddlerはpngやgif画像でも正しくレンダリングされるはずです。代わりに、jpg、png、gifファイルの個別の定義を、`image/jpeg`、`image/png`、`image/gif`タイプをそれぞれ使用して作成することもできます。
* ''tags'' - 親ディレクトリ(この場合は`files`)を基準とした画像の相対パスに基づいて生成されます。たとえば、`files/photos`内の画像には`photos`のタグが付けられ、 `files/photos/family`内の画像には`photos`と`family`両方のタグが付けられ、ルート`files`ディレクトリ内の画像にはタグが付けられません。
* ''text'' - 空の文字列に設定
* ''_canonical_uri'' - Wikiルートを基準とした画像の完全な相対ファイルパスを設定
```
{
"directories": [
{
"path": "../../files/",
"filesRegExp": "^.*\\.(?:jpg|jpeg|png|gif)$",
"isTiddlerFile": false,
"searchSubdirectories": true,
"fields": {
"title": {"source": "basename-uri-decoded"},
"created": {"source": "created"},
"modified": {"source": "modified"},
"type": "image/jpeg",
"tags": { "source": "subdirectories" },
"text": "",
"_canonical_uri": { "source": "filepath", "prefix": "files/" }
}
}
]
}
```

View File

@@ -1,60 +0,0 @@
created: 20161015114042793
modified: 20250201105445142
original-modified: 20241030132156792
tags: TiddlyWikiFolders [[TiddlyWiki on Node.js]]
title: tiddlywiki.info Files
ja-title: tiddlywiki.infoファイル
type: text/vnd.tiddlywiki
[[TiddlyWikiフォルダ|TiddlyWikiFolders]]はWikiフォルダーのルートにある1つの`tiddlywiki.info`ファイルで構成されます。このファイルには、次のプロパティを含むJSONオブジェクトが含まれている必要があります:
* ''plugins'' - Wikiに含めるプラグインの配列
* ''themes'' - Wikiに含めるテーマの配列
* ''languages'' - Wikiに含める言語の配列
* ''includeWikis'' - Wikiに含める外部Wikiフォルダへの参照の配列
* ''build'' - 名前付きビルドターゲットのハッシュマップ。それぞれはコマンドトークンの配列で定義されます(BuildCommandを参照)
* ''config'' - 設定オプションのオプションのハッシュマップ(下記参照)
!!! ''includeWikis''
''includeWikis''配列のエントリは、Wikiへの相対パスを指定する文字列か、次のフィールドを持つオブジェクトのいずれかになります:
* ''path'' - Wikiフォルダへの相対パス
* ''read-only'' - //true//に設定すると、含まれているWiki内のTiddlerが変更されるのを防ぎます。変更は、以下で説明する''default-tiddler-location''で指定されたディレクトリに書き込まれます
!!! ''build''
現在の`tiddlywiki.info`ファイルでその名前のターゲットが定義されていない場合、含まれているWikiのビルドターゲットはマージされることに注意してください。
!!! ''config''
構成オプションには以下が含まれます:
* ''default-tiddler-location'' - ファイルシステムアダプタが新しいTiddlerを保存するためのデフォルトの場所への文字列パス(Wikiフォルダを基準に解決)
* ''retain-original-tiddler-path'' - trueの場合、サーバーはWiki内の各Tiddlerの元のファイルパスを含むティドラー[[$:/config/OriginalTiddlerPaths]]を生成します
!!! 例
例:
```
{
"plugins": [
"tiddlywiki/tiddlyweb",
"tiddlywiki/filesystem"
],
"includeWikis": [
{"path": "../tw5.com", "read-only": true}
],
"build": {
"index": [
"--render","$:/core/save/all","index.html","text/plain"],
"favicon": [
"--save", "$:/favicon.ico", "favicon.ico",
"--save", "$:/green_favicon.ico", "static/favicon.ico"]
},
"config": {
"retain-original-tiddler-path": true
}
}
```

View File

@@ -1,12 +0,0 @@
created: 20150412185300152
modified: 20241227104147434
original-modified: 20150412185427211
tags: TableOfContents
title: Platforms
ja-title: プラットフォーム
type: text/vnd.tiddlywiki
TiddlyWikiはいくつかのプラットフォームで使用できます:
<<list-links "[tag[Platforms]]">>

View File

@@ -1,49 +0,0 @@
created: 20220613115453346
modified: 20250207104327815
original-modified: 20220628160136158
tags: PluginMechanism
title: Plugin Ordering
ja-title: プラグインの順序
type: text/vnd.tiddlywiki
Node.jsクライアント-サーバー構成を使用すると、プラグインは次の順序でアクティブになります:
# OS環境変数を使用して見つかったプラグイン
#* 参照: [[PluginFolders]]
#* および: [[Node.jsの環境変数|Environment Variables on Node.js]]
# Wiki`/plugins`パスに保存されたプラグイン
#* 参照: [[PluginFolders]]
# コマンドラインで指定されたプラグイン
#* 参照: [[Node.jsでTiddlyWikiを使用する|Using TiddlyWiki on Node.js]] ... <<.from-version "5.1.20">>に関する注記
# ドラッグアンドドロップでWikiコンテンツとしてインポートされたプラグイン
#* 参照: [[プラグインライブラリからプラグインをインストールする|Installing a plugin from the plugin library]]や[[プラグインを手動でインストールする|Manually installing a plugin]]
''重要:''
* ''リストの下位の要素が優先されます''
*ブラウザにドラッグアンドドロップして通常のTiddlerとしてプラグインを追加すると、プラグインはブラウザ内でのみアクティブになります
** Node.js下では利用できません
オプション 1:
* Node.js構成を使用する場合、オプション1が最も一般的な方法です
* すべてのプラグインを一度に更新できるため、メンテナンスの手間が軽減されます
オプション 2:
* 構成を固定して作業したい場合はオプション2が推奨されます
* プラグインの更新は対応するWikiにのみ影響します
オプション 3:
* このオプションを使用すると、既存の`tiddlywiki.info`ファイルを上書きすることなくエディションを''追加して開始''できます
* tiddlywiki.infoファイルで指定されていない場合でも、任意のエディションをクライアント-サーバーエディションとして起動できます。
オプション 4:
* 単一ファイルのWikiで使用されるのと全く同じメカニズムです
* このメカニズムは、プラグインが`tiddlers/`ディレクトリに保存されるため、Node.js構成では''テストとデバッグ''の目的でのみ使用する必要があります

View File

@@ -1,2 +0,0 @@
title: $:/config/tiddlyweb/host
text: $protocol$//$host$/MyApp/

View File

@@ -1,7 +0,0 @@
title: Example config-tiddlyweb-host for IIS
ja-title: IISのconfig-tiddlyweb-hostの例
created: 20180328145039530
modified: 20250123113649343
original-modified: 20180328145234871
tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]]
type: text/plain

View File

@@ -1,8 +0,0 @@
{
"name": "MyStuff",
"description": "A description of this wiki",
"dependencies": {
"sax": "1.2.4",
"tiddlywiki": "*"
}
}

View File

@@ -1,7 +0,0 @@
created: 20180328145039530
modified: 20250123114135455
original-modified: 20180328145234871
tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]]
title: Example package.json for IIS
ja-title: IISのpackage.jsonの例
type: text/plain

View File

@@ -1,11 +0,0 @@
{
"description": "My wiki",
"plugins": [
"tiddlywiki/tiddlyweb",
"tiddlywiki/filesystem"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
]
}

View File

@@ -1,7 +0,0 @@
created: 20180328151124878
modified: 20250123114435480
original-modified: 20180328151214616
tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]]
title: Example tiddlywiki.info for IIS
ja-title: IISのtiddlywiki.infoの例
type: text/plain

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add
name="httpplatformhandler"
path="*"
verb="*"
modules="httpPlatformHandler"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
<httpPlatform
stdoutLogEnabled="true"
stdoutLogFile=".\node.log"
startupTimeLimit="20"
processPath="C:\Program Files\nodejs\node.exe"
arguments=".\node_modules\tiddlywiki\tiddlywiki.js ./wiki --listen port=PORT path-prefix=/MyApp">
<environmentVariables>
<environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%" />
<environmentVariable name="NODE_ENV" value="Production" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>

View File

@@ -1,7 +0,0 @@
created: 20180328145259455
modified: 20250123114732207
original-modified: 20180701185215523
tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]]
title: Example web.config for IIS
ja-title: IISのweb.configの例
type: text/plain

View File

@@ -0,0 +1,41 @@
created: 20240309135835396
modified: 20240309142156125
title: Bags and Recipes
type: text/vnd.tiddlywiki
The bags and recipes model is a reference architecture for how tiddlers can be shared between multiple wikis. It was first introduced by TiddlyWeb in 2008.
The principles of bags and recipes can be simply stated:
# Tiddlers are stored in named "bags"
# Bags have access controls that determines which users can read or write to them
# Recipes are named lists of bags, ordered from lowest priority to highest
# The tiddlers within a recipe are accumulated in turn from each bag in the recipe in order of increasing priority. Thus, if there are multiple tiddlers with the same title in different bags then the one from the highest priority bag will be used as the recipe tiddler
# Wikis are composed by splicing the tiddlers from the corresponding recipe into the standard TW5 HTML template
A very simple example of the recipe/bag model might be for a single user who maintains the following bags:
* ''recipes'' - tiddlers related to cooking recipes
* ''work'' - tiddlers related to work
* ''app'' - common tiddlers for customising TiddlyWiki
Those bags would be used with the following recipes:
* ''recipes'' --> recipes, app - wiki for working with recipes, with common custom components
* ''work'' --> work, app - wiki for working with work, with common custom components
* ''app'' --> app - wiki for maintaining custom components
All of this will work dynamically, so changes to the app bag will instantly ripple into the affected hosted wikis.
A more complex example might be for a teacher working with a group of students:
* ''student-{name}'' bag for each students work
* ''teacher-course'' bag for the coursework, editable by the teacher
* ''teacher-tools'' bag for custom tools used by the teacher
Those bags would be exposed through the following hosted wikis:
* ''student-{name}'' hosted wiki for each students work, including the coursework material
* ''teacher-course'' hosted wiki for the coursework, editable by the teacher
* ''teacher'' hosted wiki for the teacher, bringing together all the bags, giving them an overview of all the students work

View File

@@ -0,0 +1,15 @@
title: Database Engines
tags: Reference
MWS uses [[SQLite]] for data storage. It supports choosing between two "database engines" that are based on two different npm modules:
* [[better-sqlite3|https://www.npmjs.com/package/better-sqlite3]] is written partially in C/C++ and so requires compilation for the target platform
* [[node-sqlite3-wasm|https://www.npmjs.com/package/node-sqlite3-wasm]] is written entirely in JavaScript and does not require compilation, but does require a WebAssembly-capable Node.js host. This is not currently possible on some platforms such as iOS/iPadOS
By default `npm install` will install both database engines. By default it will use `better-sqlite3`. To switch to using `node-sqlite3-wasm`, set the system configuration tiddler `$:/config/MultiWikiServer/Engine` to `wasm` (the default value is `better`). Note that this tiddler resides in the [[Administration Wiki]].
!! Avoiding Installation Errors
If you encounter errors during `npm install` related to `gyp` or `prebuild`, you may be able to avoid them by using `node-sqlite3-wasm` instead of `better-sqlite3`. However, it will be necessary to manually install `node-sqlite3-wasm` and its dependencies. This can be done by running the following commands in your terminal:
<<.copy-code-to-clipboard "npm install node-sqlite3-wasm">>

View File

@@ -0,0 +1,6 @@
title: $:/DefaultTiddlers
HelloThere
Installation
Usage
Reference

View File

@@ -0,0 +1,19 @@
title: HelloThere
tags: TableOfContents
!! ~TiddlyWiki is Growing Up
<span class="tc-float-right">[img width=200 [MWS Banner.png]]</span>
~MultiWikiServer is a new development that drastically improves ~TiddlyWiki's capabilities when running as a server under Node.js. It brings ~TiddlyWiki up to par with common web-based tools like ~WordPress or ~MediaWiki by supporting multiple wikis and multiple users at the same time.
Features under development include:
* Hosting multiple wikis at once, using the [[Bags and Recipes]] mechanism for sharing data between them
* Based on [[SQLite|MWS and SQLite]] for performance and reliability
* Robust built-in synchronisation handlers for syncing data to the filesystem
* Flexible authentication and authorisation options
* Improved handling of file uploads and attachments, allowing gigabyte video files to be uploaded and streamed
* Instantaneous synchronisation of changes between the server and all connected clients
* Workflow processing on the server, for example to automatically compress images, or to archive webpages
MWS is currently [[under development at GitHub|https://github.com/TiddlyWiki/TiddlyWiki5/pull/7915]] but it is already functional and usable.

View File

@@ -0,0 +1,19 @@
title: Installation using Git
tags: Installation
modified: 20241105133737778
created: 20241105133737778
These instructions require basic knowledge both of the terminal and of Git. There are also [[alternative instructions without using Git|Installation]].
# Clone the code from GitHub with: <<.copy-code-to-clipboard "git clone -b multi-wiki-support --single-branch https://github.com/TiddlyWiki/TiddlyWiki5">>
# Open a terminal window and set the current directory to the root of the downloaded folder
# Install the dependencies with the command: <<.copy-code-to-clipboard "npm install">>
# Start the server with the command: <<.copy-code-to-clipboard "npm start">>
# To use MWS, visit http://localhost:8080 in a browser on the same computer
# When you have finished using MWS, stop the server with <kbd>ctrl-C</kbd>
See [[Troubleshooting]] if you encounter any errors.
To update your copy of MWS with newer changes from ~GitHub, run the following command:
<<.copy-code-to-clipboard "git pull">>

View File

@@ -0,0 +1,18 @@
title: Installation
tags: TableOfContents
modified: 20241105133737778
created: 20241105133737778
These instructions require minimal knowledge of the terminal. There are also [[alternative instructions for those using Git|Installation using Git]].
# Download the code [[direct from GitHub|https://github.com/TiddlyWiki/TiddlyWiki5/archive/refs/pull/7915/head.zip]]
# Open a terminal window and set the current directory to the root of the downloaded folder
# Install the dependencies with the command: <<.copy-code-to-clipboard "npm install">>
# To verify that MWS is working correctly, start the server with the command: <<.copy-code-to-clipboard "npm start">> and then visit http://localhost:8080 in a browser on the same computer
# When you have finished using MWS, stop the server with <kbd>ctrl-C</kbd>
See [[Troubleshooting]] if you encounter any errors.
To update your copy of MWS in the future with newer changes will require re-downloading the code, taking care not to lose any changes you might have made.

View File

@@ -0,0 +1,2 @@
title: Architecture
tags: TableOfContents

View File

@@ -0,0 +1,25 @@
title: MWS and SQLite
tags: Architecture
! Introduction
SQLite is a very popular open source embedded SQL database with some [[unusual characteristics|https://www.sqlite.org/different.html]]. It has proved itself to be robust, fast and scalable, and has been widely adopted in a range of applications including web browsers, mobile devices, and embedded systems.
The "embedded" part means that developers access SQLite as a library of C functions that run as part of a larger application. This contrasts with more familiar database applications like Microsoft's SQL Server or Oracle that are accessed as network services.
MWS uses SQLite for the tiddler store and associated data. It brings many advantages:
* ''Performance'': the optimising query engine inside SQLite makes it much faster and more efficient than could be achieved in plain JavaScript. In some cases, it is [[faster than writing directly to the file system||https://www.sqlite.org/fasterthanfs.html]]
* ''Reliability'': SQLite uses protocols that [[ensure data integrity and consistency|https://www.sqlite.org/hirely.html]], even when the application crashes
* ''Scalability'': SQLite can handle extremely [[large datasets and complex queries|https://www.sqlite.org/limits.html]]
* ''Portability'': SQLite databases are stored as [[a single file|https://www.sqlite.org/fileformat.html]] that can be easily copied and moved between systems
! Misconceptions
TiddlyWiki 5 has always incorporated a database. Until MWS, that database has always been a custom tiddler database written in JavaScript. Over the years it has been enhanced and optimised with indexes and other database features that have given us reasonably decent performance for a range of common operations.
In terms of the traditional architecture of TiddlyWiki, MWS uses SQLite as the basis for an internal API that is equivalent to that of the `$tw.Wiki` object: basic CRUD operations on a database of tiddlers stored by their titles.
In the context of MWS, SQLite is just a fast and efficient equivalent of TiddlyWiki's existing JavaScript database engine. It gives us the option of persisting the database in file storage, but we also retain the option to run the database entirely within memory and rely on a file synchronisation process to save changes as individual `.tid` files in the file system, just as we do today.
One particular misconception to avoid is the idea that SQLite replaces the folders of `.tid` files that characterise the Node.js configuration of TiddlyWiki. These are separate components with a different purpose. The tiddler files are the result of syncing a database to the filesystem, and that database can be conceptually interchanged between our custom JavaScript database or the new SQLite implementation in MWS.

View File

@@ -0,0 +1,230 @@
title: Reference
tags: TableOfContents
! Authentication & Authorization
!! Overview
Our application has transitioned from a conventional username/password authentication system to a more robust Authentication and Authorization implementation. This new system supports multiple user accounts, roles, permissions, and a comprehensive access control list.
!! Key Features
# Multiple User Accounts
# Role-based Access Control
# Granular Permissions
# Access Control List (ACL)
!! Application Access & Security
!!! Initial Setup
When you first launch the Multiwiki Server, it operates in an unauthenticated mode to facilitate initial configuration. During this initial state, the system creates a temporary anonymous administrator account. Upon accessing the landing page, you'll receive a prominent security warning with instructions to establish a permanent ADMIN account. It's crucial to create this account immediately to secure your installation.
!!! User Types and Permissions
!!!! Administrator (ADMIN)
* Full system access and configuration rights
* Can create, modify, and delete user accounts
* Manages role assignments and permissions
* Controls global system settings
* Can configure guest access policies
* Has complete control over all recipes and tiddlers
!!!! Regular Users
* Custom accounts created by administrators
* Permissions determined by assigned roles
* Access limited to specific recipes based on role permissions
* Can have READ and/or WRITE permissions
!!!! Guest Users
* Default anonymous access level
* No inherent permissions
* Can only access recipes without Access Control Lists (ACLs)
* Read/write capabilities configurable by ADMIN
* Useful for public wikis or documentation sites
!!! Access Control System
!!!! Recipe-Level Security
* Access control is implemented at the recipe level
* Each recipe can have its own Access Control List (ACL)
* Permissions are granular:
** READ: Allows viewing recipe contents
** WRITE: Allows modifications to recipe contents
!!!! Role-Based Access Control (RBAC)
* Administrators can create custom roles
* Roles can be assigned specific READ/WRITE permissions
* Users inherit permissions from their assigned roles
* Multiple roles can be assigned to a single user
* Provides flexible and scalable access management
!!!! Permission Inheritance
* Users receive combined permissions from all assigned roles
* When roles grant different permission levels for the same resource, the higher access level is granted. For example, if one role grants "read" and another grants "write" access to a recipe, the user receives "write" access since it includes all lower-level permissions.
* Guest access is overridden by recipe ACLs
* When different permission rules conflict, the system follows a "most restrictive wins" principle: if any applicable rule denies access or requires a higher security level, that restriction takes precedence over more permissive rules. This ensures security is maintained even when users have multiple overlapping role assignments or inherited permissions.
This security model allows for fine-grained control over content access while maintaining flexibility for both private and public wiki deployments.
!! User Management & Security Architecture
!!! User Account Management
Users can be administered through two interfaces:
# Web-based Administrative Interface
#* Accessible only to ADMIN users
#* Provides graphical interface for user operations
#* Real-time validation and feedback
# Command-line Interface (CLI) Tools
#* Suitable for automation and scripting
#* Enables batch operations
#* Useful for system initialization
Each user account contains the following essential components:
* ''Username''
** Must be unique across the system
** Case-sensitive
** Used for authentication and audit trails
* ''Password''
** Stored using secure hashing algorithms
** Never stored in plaintext
** Subject to complexity requirements
* ''Role Assignments''
** Multiple roles can be assigned
** Inherited permissions from all assigned roles
** Dynamic permission calculation based on role combination
!!! Role & Permission Framework
!!!! Role Management
Roles serve as permission containers and provide organized access control. The system includes:
Built-in Roles:
* `ADMIN`
** Highest privilege level
** Full system access
** Cannot be modified or deleted
** Can create and manage other roles
** Controls guest access policies
* `USER`
** Basic access rights
** Typically limited to specific recipes
**Custom Roles (Examples):**
* `MANAGER`
** Intermediate access level
** Can manage subset of resources
** Custom roles as needed for specific use cases
!!!! Permission Architecture
Core Permissions:
* `READ` Permission
** View recipe contents
** Access tiddler data
** View metadata
** Export capabilities
* `WRITE` Permission
** Create new tiddlers
** Modify existing content
** Delete resources
** Manage recipe contents
**Guest Access:**
* No default permissions
* Access limited to non-ACL recipes
* Configurable by ADMIN users
* Suitable for public wikis
!!! Access Control List (ACL) Implementation
The ACL system provides granular security control through:
!!!! Entity-Level Control
* Recipe-based access control
* Individual resource protection
* Hierarchical permission inheritance
!!! Authentication Process Flow
* Initial Authentication
** User submits credentials
** System validates username existence
** Password hash comparison
** Session token generation
* Session Management
** Secure session storage
** Token-based authentication
** Automatic session expiration
** Re-authentication requirements
!!! Authorization Workflow
* Request Processing
** Capture user action request
** Identify target resource
** Extract required permissions
* Permission Validation
** Check user roles
** Aggregate permissions
** Verify ACL entries
** Apply guest policies if applicable
* Access Decision
** Compare required vs. available permissions
** Apply most restrictive policy
** Return access decision
!!! System Extension Guidelines
!!!! Adding New Roles
# Access administrative interface
# Define role identifier
# Assign base permissions
# Configure ACL mappings
# Test role functionality
!!!! Permission Expansion
# Define new permission type
# Update ACL structure
# Implement permission checks
# Update validation logic
# Document new permission
!!!! Security Considerations
* Regular permission audits
* Role assignment reviews
* Guest access monitoring
* Security log analysis
* Access pattern monitoring
This comprehensive security model provides flexible, maintainable, and secure access control while supporting both authenticated and guest users within the Multiwiki Server environment.
! HTTP API
The ~MultiWikiServer HTTP API provides access to resources hosted by the MWS store. It is based on [[the API of TiddlyWeb|https://tank.peermore.com/tanks/tiddlyweb/HTTP%20API]], first developed in 2008 by Chris Dent.
The design goals of the API are:
* To follow the principles of REST where practical
* To present resources as nouns, not verbs
General points about the design:
* In MWS there are no resources that end with / (except for the root path which is /)

View File

@@ -0,0 +1,19 @@
title: Troublesheeting gyp/prebuild Installation Errors
tags: Troubleshooting
modified: 20241105133737778
created: 20241105133737778
Installation may fail with errors related to `gyp` or `prebuild`. These errors are caused by missing dependencies or incorrect versions of dependencies.
Note that in most cases, these errors occur because of the use of the npm module [[better-sqlite3|https://www.npmjs.com/package/better-sqlite3]]. This module is mostly written in C, and thus requires compilation for the target platform. MWS supports switchable database engines, and also supports the use of the [[node-sqlite3-wasm|https://www.npmjs.com/package/node-sqlite3-wasm]] module which is written in ~JavaScript and does not require compilation and so may avoid these errors. See [[Database Engines]] for more details of how to switch between engines.
The following steps may help resolve errors involving `gyp` or `prebuild`:
# Ensure that you have the latest version of Node.js installed. You can download the latest version from the [[Node.js website|https://nodejs.org/]].
# Update npm to the latest version by running the following command in your terminal: <<.copy-code-to-clipboard "npm install -g npm@latest">>
# Clear the npm cache by running the following command in your terminal: <<.copy-code-to-clipboard "npm cache clean --force">>
# Delete the `node_modules` folder in your TiddlyWiki directory by running the following command in your terminal: <<.copy-code-to-clipboard "rm -rf node_modules">>
# Reinstall the dependencies by running the following command in your terminal: <<.copy-code-to-clipboard "npm install">>
# If you continue to encounter errors, try running the following command in your terminal: <<.copy-code-to-clipboard "npm rebuild">>
# If you are still experiencing issues, you may need to manually install the `gyp` and `prebuild` dependencies. You can do this by running the following commands in your terminal: <<.copy-code-to-clipboard "npm install -g node-gyp">> <<.copy-code-to-clipboard "npm install -g prebuild">>
# Once you have installed the dependencies, try reinstalling the TiddlyWiki dependencies by running the following command in your terminal: <<.copy-code-to-clipboard "npm install">>

View File

@@ -0,0 +1,4 @@
title: Troubleshooting
tags: TableOfContents
<<list-links "[tag[Troubleshooting]]">>

View File

@@ -0,0 +1,13 @@
title: Usage
tags: TableOfContents
modified: 20241105133737778
created: 20241105133737778
Once MWS is successfully [[installed|Installation]], you can access it by visiting http://localhost:8080 in a browser on the same computer.
By default, MWS is installed with full anonymous access enabled, meaning that anyone with access to the server has full access to read and modify anything. However, also by default, the server is only accessible to browsers on the same machine.
If you intend to put an MWS installation on a public network like the Internet, the server will need to be secured with the following steps:
* Create and login with a new administrator account
* Disable anonymouse access

Some files were not shown because too many files have changed in this diff Show More