mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-22 19:04:38 +00:00
Compare commits
25 Commits
wikify-ope
...
intrinsic-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c05400021c | ||
|
|
5111be1953 | ||
|
|
9dadd3fafb | ||
|
|
12ced06d1d | ||
|
|
a4e8308e75 | ||
|
|
9a2534fc5e | ||
|
|
2ae1e5aa09 | ||
|
|
e01c428a17 | ||
|
|
752c5cfbda | ||
|
|
094428b1ab | ||
|
|
41cd335cf4 | ||
|
|
26b2768294 | ||
|
|
4e3d07b16a | ||
|
|
01beac1d7c | ||
|
|
0c80e1b35c | ||
|
|
55c634692b | ||
|
|
7e2a8238b5 | ||
|
|
ee90ad2fa6 | ||
|
|
afabe5b714 | ||
|
|
3a60e0eb17 | ||
|
|
6b0a13b8cc | ||
|
|
c142bfc50d | ||
|
|
e8de413fba | ||
|
|
4cbf1b4d91 | ||
|
|
778e544f1c |
317
.eslintrc.json
Normal file
317
.eslintrc.json
Normal file
@@ -0,0 +1,317 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended"
|
||||
],
|
||||
"globals": {
|
||||
"$tw": "writable"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 5
|
||||
},
|
||||
"plugins": [],
|
||||
"rules": {
|
||||
"array-bracket-newline": "off",
|
||||
"array-bracket-spacing": "off",
|
||||
"array-callback-return": "off",
|
||||
"array-element-newline": "off",
|
||||
"arrow-body-style": "error",
|
||||
"arrow-parens": [
|
||||
"error",
|
||||
"as-needed"
|
||||
],
|
||||
"arrow-spacing": [
|
||||
"error",
|
||||
{
|
||||
"after": true,
|
||||
"before": true
|
||||
}
|
||||
],
|
||||
"block-scoped-var": "off",
|
||||
"block-spacing": "off",
|
||||
"brace-style": "off",
|
||||
"callback-return": "off",
|
||||
"camelcase": "off",
|
||||
"capitalized-comments": "off",
|
||||
"class-methods-use-this": "error",
|
||||
"comma-dangle": "off",
|
||||
"comma-spacing": "off",
|
||||
"comma-style": "off",
|
||||
"complexity": "off",
|
||||
"computed-property-spacing": "off",
|
||||
"consistent-return": "off",
|
||||
"consistent-this": "off",
|
||||
"curly": "off",
|
||||
"default-case": "off",
|
||||
"default-case-last": "error",
|
||||
"default-param-last": "error",
|
||||
"dot-location": "off",
|
||||
"dot-notation": "off",
|
||||
"eol-last": "off",
|
||||
"eqeqeq": "off",
|
||||
"func-call-spacing": "off",
|
||||
"func-name-matching": "off",
|
||||
"func-names": "off",
|
||||
"func-style": "off",
|
||||
"function-call-argument-newline": "off",
|
||||
"function-paren-newline": "off",
|
||||
"generator-star-spacing": "error",
|
||||
"global-require": "off",
|
||||
"grouped-accessor-pairs": "error",
|
||||
"guard-for-in": "off",
|
||||
"handle-callback-err": "off",
|
||||
"id-blacklist": "error",
|
||||
"id-denylist": "error",
|
||||
"id-length": "off",
|
||||
"id-match": "error",
|
||||
"implicit-arrow-linebreak": "error",
|
||||
"indent": "off",
|
||||
"indent-legacy": "off",
|
||||
"init-declarations": "off",
|
||||
"jsx-quotes": "error",
|
||||
"key-spacing": "off",
|
||||
"keyword-spacing": [
|
||||
"error",
|
||||
{
|
||||
"before": true,
|
||||
"after": false,
|
||||
"overrides": {
|
||||
"case": {
|
||||
"after": true
|
||||
},
|
||||
"do": {
|
||||
"after": true
|
||||
},
|
||||
"else": {
|
||||
"after": true
|
||||
},
|
||||
"return": {
|
||||
"after": true
|
||||
},
|
||||
"throw": {
|
||||
"after": true
|
||||
},
|
||||
"try": {
|
||||
"after": true
|
||||
},
|
||||
"catch": {
|
||||
"after": true
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"line-comment-position": "off",
|
||||
"linebreak-style": "off",
|
||||
"lines-around-comment": "off",
|
||||
"lines-around-directive": "off",
|
||||
"lines-between-class-members": "error",
|
||||
"max-classes-per-file": "error",
|
||||
"max-depth": "off",
|
||||
"max-len": "off",
|
||||
"max-lines": "off",
|
||||
"max-lines-per-function": "off",
|
||||
"max-nested-callbacks": "error",
|
||||
"max-params": "off",
|
||||
"max-statements": "off",
|
||||
"max-statements-per-line": "off",
|
||||
"multiline-comment-style": "off",
|
||||
"multiline-ternary": "off",
|
||||
"new-parens": "off",
|
||||
"newline-after-var": "off",
|
||||
"newline-before-return": "off",
|
||||
"newline-per-chained-call": "off",
|
||||
"no-alert": "off",
|
||||
"no-array-constructor": "off",
|
||||
"no-await-in-loop": "error",
|
||||
"no-bitwise": "off",
|
||||
"no-buffer-constructor": "off",
|
||||
"no-caller": "error",
|
||||
"no-catch-shadow": "off",
|
||||
"no-confusing-arrow": "error",
|
||||
"no-console": "off",
|
||||
"no-constant-condition": [
|
||||
"error",
|
||||
{
|
||||
"checkLoops": false
|
||||
}
|
||||
],
|
||||
"no-constructor-return": "error",
|
||||
"no-continue": "off",
|
||||
"no-div-regex": "off",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-else-return": "off",
|
||||
"no-empty-function": "off",
|
||||
"no-eq-null": "off",
|
||||
"no-eval": "off",
|
||||
"no-extend-native": "off",
|
||||
"no-extra-bind": "off",
|
||||
"no-extra-label": "off",
|
||||
"no-extra-parens": "off",
|
||||
"no-floating-decimal": "off",
|
||||
"no-implicit-coercion": [
|
||||
"error",
|
||||
{
|
||||
"boolean": false,
|
||||
"number": false,
|
||||
"string": false
|
||||
}
|
||||
],
|
||||
"no-implicit-globals": "off",
|
||||
"no-implied-eval": "error",
|
||||
"no-inline-comments": "off",
|
||||
"no-invalid-this": "off",
|
||||
"no-iterator": "error",
|
||||
"no-label-var": "off",
|
||||
"no-labels": "off",
|
||||
"no-lone-blocks": "off",
|
||||
"no-lonely-if": "off",
|
||||
"no-loop-func": "off",
|
||||
"no-loss-of-precision": "error",
|
||||
"no-magic-numbers": "off",
|
||||
"no-mixed-operators": "off",
|
||||
"no-mixed-requires": "off",
|
||||
"no-multi-assign": "off",
|
||||
"no-multi-spaces": "off",
|
||||
"no-multi-str": "error",
|
||||
"no-multiple-empty-lines": ["warn", { "max": 4, "maxEOF": 0 }],
|
||||
"no-native-reassign": "off",
|
||||
"no-negated-condition": "off",
|
||||
"no-negated-in-lhs": "error",
|
||||
"no-nested-ternary": "off",
|
||||
"no-new": "off",
|
||||
"no-new-func": "off",
|
||||
"no-new-object": "off",
|
||||
"no-new-require": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-param-reassign": "off",
|
||||
"no-path-concat": "error",
|
||||
"no-plusplus": "off",
|
||||
"no-process-env": "off",
|
||||
"no-process-exit": "off",
|
||||
"no-promise-executor-return": "error",
|
||||
"no-proto": "off",
|
||||
"no-restricted-exports": "error",
|
||||
"no-restricted-globals": "error",
|
||||
"no-restricted-imports": "error",
|
||||
"no-restricted-modules": "error",
|
||||
"no-restricted-properties": "error",
|
||||
"no-restricted-syntax": "error",
|
||||
"no-return-assign": "off",
|
||||
"no-return-await": "error",
|
||||
"no-script-url": "off",
|
||||
"no-self-compare": "off",
|
||||
"no-sequences": "off",
|
||||
"no-shadow": "off",
|
||||
"no-spaced-func": "off",
|
||||
"no-sync": "off",
|
||||
"no-tabs": "off",
|
||||
"no-template-curly-in-string": "error",
|
||||
"no-ternary": "off",
|
||||
"no-throw-literal": "off",
|
||||
"no-trailing-spaces": "error",
|
||||
"no-undef-init": "off",
|
||||
"no-undefined": "off",
|
||||
"no-underscore-dangle": "off",
|
||||
"no-unmodified-loop-condition": "off",
|
||||
"no-unneeded-ternary": "off",
|
||||
"no-unreachable-loop": "error",
|
||||
"no-unused-expressions": "off",
|
||||
"no-use-before-define": "off",
|
||||
"no-useless-backreference": "error",
|
||||
"no-useless-call": "off",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-concat": "off",
|
||||
"no-useless-constructor": "error",
|
||||
"no-useless-rename": "error",
|
||||
"no-useless-return": "off",
|
||||
"no-var": "off",
|
||||
"no-void": "off",
|
||||
"no-warning-comments": "off",
|
||||
"no-whitespace-before-property": "error",
|
||||
"nonblock-statement-body-position": [
|
||||
"error",
|
||||
"any"
|
||||
],
|
||||
"object-curly-newline": "off",
|
||||
"object-curly-spacing": "off",
|
||||
"object-property-newline": "off",
|
||||
"object-shorthand": "off",
|
||||
"one-var": "off",
|
||||
"one-var-declaration-per-line": "off",
|
||||
"operator-assignment": "off",
|
||||
"operator-linebreak": "off",
|
||||
"padded-blocks": "off",
|
||||
"padding-line-between-statements": "error",
|
||||
"prefer-arrow-callback": "off",
|
||||
"prefer-const": "off",
|
||||
"prefer-destructuring": "off",
|
||||
"prefer-exponentiation-operator": "off",
|
||||
"prefer-named-capture-group": "off",
|
||||
"prefer-numeric-literals": "error",
|
||||
"prefer-object-spread": "off",
|
||||
"prefer-promise-reject-errors": "error",
|
||||
"prefer-reflect": "off",
|
||||
"prefer-regex-literals": "off",
|
||||
"prefer-rest-params": "off",
|
||||
"prefer-spread": "off",
|
||||
"prefer-template": "off",
|
||||
"quote-props": "off",
|
||||
"quotes": "off",
|
||||
"radix": "off",
|
||||
"require-atomic-updates": "error",
|
||||
"require-await": "error",
|
||||
"require-jsdoc": "off",
|
||||
"require-unicode-regexp": "off",
|
||||
"rest-spread-spacing": "error",
|
||||
"semi": "off",
|
||||
"semi-spacing": "off",
|
||||
"semi-style": "off",
|
||||
"sort-imports": "error",
|
||||
"sort-keys": "off",
|
||||
"sort-vars": "off",
|
||||
"space-before-blocks": "off",
|
||||
"space-before-function-paren": "off",
|
||||
"space-in-parens": "off",
|
||||
"space-infix-ops": "off",
|
||||
"space-unary-ops": "off",
|
||||
"spaced-comment": "off",
|
||||
"strict": "off",
|
||||
"switch-colon-spacing": "off",
|
||||
"symbol-description": "error",
|
||||
"template-curly-spacing": "error",
|
||||
"template-tag-spacing": "error",
|
||||
"unicode-bom": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"valid-jsdoc": "off",
|
||||
"valid-typeof": [
|
||||
"error",
|
||||
{
|
||||
"requireStringLiterals": false
|
||||
}
|
||||
],
|
||||
"vars-on-top": "off",
|
||||
"wrap-iife": "off",
|
||||
"wrap-regex": "off",
|
||||
"yield-star-spacing": "error",
|
||||
"yoda": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-empty": "off",
|
||||
"no-extra-semi": "off",
|
||||
"no-redeclare": "off",
|
||||
"no-control-regex": "off",
|
||||
"no-mixed-spaces-and-tabs": "off",
|
||||
"no-extra-boolean-cast": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-undef": "off",
|
||||
"no-unreachable": "off",
|
||||
"no-self-assign": "off"
|
||||
}
|
||||
}
|
||||
50
.github/workflows/pr-check-build-size.yml
vendored
50
.github/workflows/pr-check-build-size.yml
vendored
@@ -1,50 +0,0 @@
|
||||
name: Calculate PR build size
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
calculate-build-size:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
outputs:
|
||||
pr_size: ${{ steps.get_sizes.outputs.pr_size }}
|
||||
base_size: ${{ steps.get_sizes.outputs.base_size }}
|
||||
steps:
|
||||
- name: build-size-check
|
||||
id: get_sizes
|
||||
uses: TiddlyWiki/cerebrus@v4
|
||||
with:
|
||||
pr_number: ${{ github.event.pull_request.number }}
|
||||
repo: ${{ github.repository }}
|
||||
base_ref: ${{ github.base_ref }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
mode: size:calc
|
||||
|
||||
dispatch-followup:
|
||||
needs: calculate-build-size
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write # Required to dispatch another workflow
|
||||
pull-requests: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Trigger follow-up workflow
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'pr-comment-build-size.yml',
|
||||
ref: 'master',
|
||||
inputs: {
|
||||
pr_number: '${{ github.event.pull_request.number }}',
|
||||
base_ref: '${{ github.event.pull_request.base.ref }}',
|
||||
pr_size: '${{ needs.calculate-build-size.outputs.pr_size }}',
|
||||
base_size: '${{ needs.calculate-build-size.outputs.base_size }}'
|
||||
}
|
||||
});
|
||||
36
.github/workflows/pr-comment-build-size.yml
vendored
36
.github/workflows/pr-comment-build-size.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Comment on PR build size (Trusted workflow)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_number:
|
||||
required: true
|
||||
type: string
|
||||
base_ref:
|
||||
required: true
|
||||
type: string
|
||||
pr_size:
|
||||
required: true
|
||||
type: string
|
||||
base_size:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
comment-on-pr:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Build and check size
|
||||
uses: TiddlyWiki/cerebrus@v4
|
||||
with:
|
||||
pr_number: ${{ inputs.pr_number }}
|
||||
repo: ${{ github.repository }}
|
||||
base_ref: ${{ inputs.base_ref }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
mode: size:comment
|
||||
pr_size: ${{ inputs.pr_size }}
|
||||
base_size: ${{ inputs.base_size }}
|
||||
18
.github/workflows/pr-path-validation.yml
vendored
18
.github/workflows/pr-path-validation.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: Validate PR Paths
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
validate-pr:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Validate PR
|
||||
uses: TiddlyWiki/cerebrus@v4
|
||||
with:
|
||||
pr_number: ${{ github.event.pull_request.number }}
|
||||
repo: ${{ github.repository }}
|
||||
base_ref: ${{ github.base_ref }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -156,7 +156,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/tour \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js tour.html text/plain \
|
||||
--rendertiddler $:/core/save/all tour.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# /share.html Custom edition for sharing via the URL
|
||||
@@ -195,7 +195,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/xlsx-utils \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT/editions/xlsx-utils/ \
|
||||
--build external \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
# /editions/resumebuilder/index.html Resume builder edition
|
||||
@@ -211,7 +211,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/text-slicer \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT/editions/text-slicer/ \
|
||||
--build external \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
# /editions/translators/index.html Translators edition
|
||||
@@ -243,7 +243,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/tw5.com-docs \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT/editions/tw5.com-docs/ \
|
||||
--build external \
|
||||
--build index \
|
||||
|| exit 1
|
||||
|
||||
# /editions/twitter-archivist/index.html Twitter Archivist edition
|
||||
@@ -266,7 +266,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/innerwikidemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/innerwiki/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/innerwiki/index.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
# /plugins/tiddlywiki/dynaview/index.html Demo wiki with DynaView plugin
|
||||
@@ -276,7 +276,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/dynaviewdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/dynaview/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/dynaview/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/dynaview/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -290,7 +290,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/katexdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/katex/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/katex/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/katex/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -320,7 +320,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/codemirrordemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/codemirror/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/codemirror/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/codemirror/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -330,7 +330,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/markdowndemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/markdown/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/markdown/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/markdown/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -340,7 +340,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/classicparserdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/tw2parser/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/tw2parser/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/tw2parser/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -350,7 +350,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/highlightdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/highlight/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/highlight/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/highlight/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
@@ -360,7 +360,7 @@ node $TW5_BUILD_TIDDLYWIKI \
|
||||
./editions/geospatialdemo \
|
||||
--load $TW5_BUILD_OUTPUT/build.tid \
|
||||
--output $TW5_BUILD_OUTPUT \
|
||||
--rendertiddler $:/core/save/all-external-js plugins/tiddlywiki/geospatial/index.html text/plain \
|
||||
--rendertiddler $:/core/save/all plugins/tiddlywiki/geospatial/index.html text/plain \
|
||||
--rendertiddler $:/core/save/empty plugins/tiddlywiki/geospatial/empty.html text/plain \
|
||||
|| exit 1
|
||||
|
||||
|
||||
301
boot/boot.js
301
boot/boot.js
@@ -1068,6 +1068,10 @@ $tw.Tiddler.prototype.hasField = function(field) {
|
||||
return $tw.utils.hop(this.fields,field);
|
||||
};
|
||||
|
||||
$tw.Tiddler.prototype.isPlugin = function() {
|
||||
return this.fields.type === "application/json" && this.hasField("plugin-type") && !this.hasField("draft.of");
|
||||
};
|
||||
|
||||
/*
|
||||
Compare two tiddlers for equality
|
||||
tiddler: the tiddler to compare
|
||||
@@ -1162,21 +1166,21 @@ enableIndexers - Array of indexer names to enable, or null to use all available
|
||||
$tw.Wiki = function(options) {
|
||||
options = options || {};
|
||||
var self = this,
|
||||
tiddlers = Object.create(null), // Hashmap of tiddlers
|
||||
tiddlerTitles = null, // Array of tiddler titles
|
||||
tiddlerStore = Object.create(null), // Hashmap of tiddlers
|
||||
tiddlerTitles = null, // Array of tiddler titles, calculated and cached when needed
|
||||
getTiddlerTitles = function() {
|
||||
if(!tiddlerTitles) {
|
||||
tiddlerTitles = Object.keys(tiddlers).sort(function(a,b) {return a.localeCompare(b);});
|
||||
tiddlerTitles = Object.keys(tiddlerStore).sort(function(a,b) {return a.localeCompare(b);});
|
||||
}
|
||||
return tiddlerTitles;
|
||||
},
|
||||
pluginTiddlers = [], // Array of tiddlers containing registered plugins, ordered by priority
|
||||
pluginInfo = Object.create(null), // Hashmap of parsed plugin content
|
||||
shadowTiddlers = Object.create(null), // Hashmap by title of {source:, tiddler:}
|
||||
shadowTiddlerTitles = null,
|
||||
pluginTiddlersInfo = [], // Array of tiddler fields for all plugins and sub-plugins, ordered by priority
|
||||
pluginContents = Object.create(null), // Hashmap by title of {contents:<parsed plugin contents>,fields:<fields>,subPluginTitles:<list>}
|
||||
shadowTiddlerInfo = Object.create(null), // Hashmap by title of {source:, tiddler:}
|
||||
shadowTiddlerTitles = null, // Array of tiddler titles, calculated and cached when needed
|
||||
getShadowTiddlerTitles = function() {
|
||||
if(!shadowTiddlerTitles) {
|
||||
shadowTiddlerTitles = Object.keys(shadowTiddlers).sort(function(a,b) {return a.localeCompare(b);});
|
||||
shadowTiddlerTitles = Object.keys(shadowTiddlerInfo).sort(function(a,b) {return a.localeCompare(b);});
|
||||
}
|
||||
return shadowTiddlerTitles;
|
||||
},
|
||||
@@ -1218,7 +1222,7 @@ $tw.Wiki = function(options) {
|
||||
}
|
||||
}
|
||||
// Save the new tiddler
|
||||
tiddlers[title] = tiddler;
|
||||
tiddlerStore[title] = tiddler;
|
||||
// Check we've got the title
|
||||
tiddlerTitles = $tw.utils.insertSortedArray(tiddlerTitles || [],title);
|
||||
// Record the new tiddler state
|
||||
@@ -1243,7 +1247,7 @@ $tw.Wiki = function(options) {
|
||||
this.deleteTiddler = function(title) {
|
||||
// Uncomment the following line for detailed logs of all tiddler deletions
|
||||
// console.log("Deleting",title)
|
||||
if($tw.utils.hop(tiddlers,title)) {
|
||||
if($tw.utils.hop(tiddlerStore,title)) {
|
||||
// Record the old tiddler state
|
||||
var updateDescriptor = {
|
||||
old: {
|
||||
@@ -1253,7 +1257,7 @@ $tw.Wiki = function(options) {
|
||||
}
|
||||
}
|
||||
// Delete the tiddler
|
||||
delete tiddlers[title];
|
||||
delete tiddlerStore[title];
|
||||
// Delete it from the list of titles
|
||||
if(tiddlerTitles) {
|
||||
var index = tiddlerTitles.indexOf(title);
|
||||
@@ -1281,11 +1285,11 @@ $tw.Wiki = function(options) {
|
||||
// Get a tiddler from the store
|
||||
this.getTiddler = function(title) {
|
||||
if(title) {
|
||||
var t = tiddlers[title];
|
||||
var t = tiddlerStore[title];
|
||||
if(t !== undefined) {
|
||||
return t;
|
||||
} else {
|
||||
var s = shadowTiddlers[title];
|
||||
var s = shadowTiddlerInfo[title];
|
||||
if(s !== undefined) {
|
||||
return s.tiddler;
|
||||
}
|
||||
@@ -1305,7 +1309,7 @@ $tw.Wiki = function(options) {
|
||||
index,titlesLength,title;
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
callback(tiddlers[title],title);
|
||||
callback(tiddlerStore[title],title);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1320,10 +1324,10 @@ $tw.Wiki = function(options) {
|
||||
index,titlesLength,title;
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(tiddlers[title]) {
|
||||
callback(tiddlers[title],title);
|
||||
if(tiddlerStore[title]) {
|
||||
callback(tiddlerStore[title],title);
|
||||
} else {
|
||||
var shadowInfo = shadowTiddlers[title];
|
||||
var shadowInfo = shadowTiddlerInfo[title];
|
||||
callback(shadowInfo.tiddler,title);
|
||||
}
|
||||
}
|
||||
@@ -1335,13 +1339,13 @@ $tw.Wiki = function(options) {
|
||||
titles = getTiddlerTitles();
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
callback(tiddlers[title],title);
|
||||
callback(tiddlerStore[title],title);
|
||||
}
|
||||
titles = getShadowTiddlerTitles();
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(!tiddlers[title]) {
|
||||
var shadowInfo = shadowTiddlers[title];
|
||||
if(!tiddlerStore[title]) {
|
||||
var shadowInfo = shadowTiddlerInfo[title];
|
||||
callback(shadowInfo.tiddler,title);
|
||||
}
|
||||
}
|
||||
@@ -1353,35 +1357,35 @@ $tw.Wiki = function(options) {
|
||||
titles = getShadowTiddlerTitles();
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(tiddlers[title]) {
|
||||
callback(tiddlers[title],title);
|
||||
if(tiddlerStore[title]) {
|
||||
callback(tiddlerStore[title],title);
|
||||
} else {
|
||||
var shadowInfo = shadowTiddlers[title];
|
||||
var shadowInfo = shadowTiddlerInfo[title];
|
||||
callback(shadowInfo.tiddler,title);
|
||||
}
|
||||
}
|
||||
titles = getTiddlerTitles();
|
||||
for(index = 0, titlesLength = titles.length; index < titlesLength; index++) {
|
||||
title = titles[index];
|
||||
if(!shadowTiddlers[title]) {
|
||||
callback(tiddlers[title],title);
|
||||
if(!shadowTiddlerInfo[title]) {
|
||||
callback(tiddlerStore[title],title);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Test for the existence of a tiddler (excludes shadow tiddlers)
|
||||
this.tiddlerExists = function(title) {
|
||||
return !!$tw.utils.hop(tiddlers,title);
|
||||
return !!$tw.utils.hop(tiddlerStore,title);
|
||||
};
|
||||
|
||||
// Determines if a tiddler is a shadow tiddler, regardless of whether it has been overridden by a real tiddler
|
||||
this.isShadowTiddler = function(title) {
|
||||
return $tw.utils.hop(shadowTiddlers,title);
|
||||
return $tw.utils.hop(shadowTiddlerInfo,title);
|
||||
};
|
||||
|
||||
this.getShadowSource = function(title) {
|
||||
if($tw.utils.hop(shadowTiddlers,title)) {
|
||||
return shadowTiddlers[title].source;
|
||||
if($tw.utils.hop(shadowTiddlerInfo,title)) {
|
||||
return shadowTiddlerInfo[title].source;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
@@ -1389,8 +1393,8 @@ $tw.Wiki = function(options) {
|
||||
// Get an array of all the currently recognised plugin types
|
||||
this.getPluginTypes = function() {
|
||||
var types = [];
|
||||
$tw.utils.each(pluginTiddlers,function(pluginTiddler) {
|
||||
var pluginType = pluginTiddler.fields["plugin-type"];
|
||||
$tw.utils.each(pluginTiddlersInfo,function(pluginTiddlerFields) {
|
||||
var pluginType = pluginTiddlerFields["plugin-type"];
|
||||
if(pluginType && types.indexOf(pluginType) === -1) {
|
||||
types.push(pluginType);
|
||||
}
|
||||
@@ -1398,22 +1402,45 @@ $tw.Wiki = function(options) {
|
||||
return types;
|
||||
};
|
||||
|
||||
// Read plugin info for all plugins, or just an array of titles. Returns the number of plugins updated or deleted
|
||||
// Read plugin contents for all plugins, or just an array of titles. Returns the list of updated plugin titles, the list of deleted plugin titles and
|
||||
// a hashmap of the deleted plugin contents. Clears the pluginContents cache for any plugins that have been deleted
|
||||
this.readPluginInfo = function(titles) {
|
||||
var results = {
|
||||
var self = this,
|
||||
results = {
|
||||
modifiedPlugins: [],
|
||||
deletedPlugins: []
|
||||
deletedPlugins: [],
|
||||
deletedPluginContents: {}
|
||||
};
|
||||
$tw.utils.each(titles || getTiddlerTitles(),function(title) {
|
||||
var tiddler = tiddlers[title];
|
||||
var tiddler = self.getTiddler(title);
|
||||
if(!tiddler) {
|
||||
for(var t=0; t<pluginContents.length; t++) {
|
||||
if(pluginContents[t].subPluginTitles.indexOf(title) !== -1) {
|
||||
tiddler = new $tw.Tiddler(pluginContents[t].fields);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(tiddler) {
|
||||
if(tiddler.fields.type === "application/json" && tiddler.hasField("plugin-type") && tiddler.fields.text) {
|
||||
pluginInfo[tiddler.fields.title] = $tw.utils.parseJSONSafe(tiddler.fields.text);
|
||||
results.modifiedPlugins.push(tiddler.fields.title);
|
||||
if(tiddler.isPlugin() && tiddler.fields.text) {
|
||||
var contents = $tw.utils.parseJSONSafe(tiddler.fields.text).tiddlers;
|
||||
var subPluginTitles = [];
|
||||
// Read any sub-plugins
|
||||
$tw.utils.each(contents,function(subPluginFields,subPluginTitle) {
|
||||
if(subPluginFields["plugin-type"] && subPluginFields["type"] === "application/json") {
|
||||
var contents = $tw.utils.parseJSONSafe(subPluginFields.text).tiddlers
|
||||
pluginContents[subPluginTitle] = {contents: contents,fields: subPluginFields};
|
||||
results.modifiedPlugins.push(subPluginTitle);
|
||||
subPluginTitles.push(subPluginTitle)
|
||||
}
|
||||
});
|
||||
pluginContents[title] = {contents: contents,fields: tiddler.fields,subPluginTitles: subPluginTitles};
|
||||
results.modifiedPlugins.push(title);
|
||||
}
|
||||
} else {
|
||||
if(pluginInfo[title]) {
|
||||
delete pluginInfo[title];
|
||||
if(pluginContents[title]) {
|
||||
results.deletedPluginContents[title] = {tiddlers: pluginContents[title].contents};
|
||||
delete pluginContents[title];
|
||||
results.deletedPlugins.push(title);
|
||||
}
|
||||
}
|
||||
@@ -1421,34 +1448,42 @@ $tw.Wiki = function(options) {
|
||||
return results;
|
||||
};
|
||||
|
||||
this.isSubPlugin = function(title) {
|
||||
for(var t=0; t<pluginContents.length; t++) {
|
||||
if(pluginContents[t].subPluginTitles.indexOf(title) !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Get plugin info for a plugin
|
||||
this.getPluginInfo = function(title) {
|
||||
return pluginInfo[title];
|
||||
var pluginContent = pluginContents[title];
|
||||
if(pluginContent) {
|
||||
return {tiddlers: pluginContent.contents, subPluginTitles: pluginContent.subPluginTitles, fields: pluginContent.fields};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
// Register the plugin tiddlers of a particular type, or null/undefined for any type, optionally restricting registration to an array of tiddler titles. Return the array of titles affected
|
||||
this.registerPluginTiddlers = function(pluginType,titles) {
|
||||
var self = this,
|
||||
registeredTitles = [],
|
||||
checkTiddler = function(tiddler,title) {
|
||||
if(tiddler && tiddler.fields.type === "application/json" && tiddler.fields["plugin-type"] && (!pluginType || tiddler.fields["plugin-type"] === pluginType)) {
|
||||
var disablingTiddler = self.getTiddler("$:/config/Plugins/Disabled/" + title);
|
||||
if(title === "$:/core" || !disablingTiddler || (disablingTiddler.fields.text || "").trim() !== "yes") {
|
||||
self.unregisterPluginTiddlers(null,[title]); // Unregister the plugin if it's already registered
|
||||
pluginTiddlers.push(tiddler);
|
||||
registeredTitles.push(tiddler.fields.title);
|
||||
registeredTitles = [];
|
||||
$tw.utils.each(pluginContents,function(pluginContent,pluginTitle) {
|
||||
var pluginFields = pluginContent.fields;
|
||||
if(!titles || titles.indexOf(pluginTitle) !== -1) {
|
||||
if(!pluginType || pluginFields["plugin-type"] === pluginType) {
|
||||
var disablingTiddler = self.getTiddler("$:/config/Plugins/Disabled/" + pluginTitle);
|
||||
if(pluginTitle === "$:/core" || !disablingTiddler || (disablingTiddler.fields.text || "").trim() !== "yes") {
|
||||
self.unregisterPluginTiddlers(null,[pluginTitle]); // Unregister the plugin if it's already registered
|
||||
pluginTiddlersInfo.push(pluginFields);
|
||||
registeredTitles.push(pluginTitle);
|
||||
}
|
||||
}
|
||||
};
|
||||
if(titles) {
|
||||
$tw.utils.each(titles,function(title) {
|
||||
checkTiddler(self.getTiddler(title),title);
|
||||
});
|
||||
} else {
|
||||
this.each(function(tiddler,title) {
|
||||
checkTiddler(tiddler,title);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return registeredTitles;
|
||||
};
|
||||
|
||||
@@ -1457,11 +1492,11 @@ $tw.Wiki = function(options) {
|
||||
var self = this,
|
||||
unregisteredTitles = [];
|
||||
// Remove any previous registered plugins of this type
|
||||
for(var t=pluginTiddlers.length-1; t>=0; t--) {
|
||||
var tiddler = pluginTiddlers[t];
|
||||
if(tiddler.fields["plugin-type"] && (!pluginType || tiddler.fields["plugin-type"] === pluginType) && (!titles || titles.indexOf(tiddler.fields.title) !== -1)) {
|
||||
unregisteredTitles.push(tiddler.fields.title);
|
||||
pluginTiddlers.splice(t,1);
|
||||
for(var t=pluginTiddlersInfo.length-1; t>=0; t--) {
|
||||
var pluginFields = pluginTiddlersInfo[t];
|
||||
if(pluginFields["plugin-type"] && (!pluginType || pluginFields["plugin-type"] === pluginType) && (!titles || titles.indexOf(pluginFields.title) !== -1)) {
|
||||
unregisteredTitles.push(pluginFields.title);
|
||||
pluginTiddlersInfo.splice(t,1);
|
||||
}
|
||||
}
|
||||
return unregisteredTitles;
|
||||
@@ -1471,36 +1506,33 @@ $tw.Wiki = function(options) {
|
||||
this.unpackPluginTiddlers = function() {
|
||||
var self = this;
|
||||
// Sort the plugin titles by the `plugin-priority` field, if this field is missing, default to 1
|
||||
pluginTiddlers.sort(function(a, b) {
|
||||
var priorityA = "plugin-priority" in a.fields ? a.fields["plugin-priority"] : 1;
|
||||
var priorityB = "plugin-priority" in b.fields ? b.fields["plugin-priority"] : 1;
|
||||
pluginTiddlersInfo.sort(function(a, b) {
|
||||
var priorityA = "plugin-priority" in a ? a["plugin-priority"] : 1,
|
||||
priorityB = "plugin-priority" in b ? b["plugin-priority"] : 1;
|
||||
if (priorityA !== priorityB) {
|
||||
return priorityA - priorityB;
|
||||
} else if (a.fields.title < b.fields.title) {
|
||||
} else if (a.title < b.title) {
|
||||
return -1;
|
||||
} else if (a.fields.title === b.fields.title) {
|
||||
} else if (a.title === b.title) {
|
||||
return 0;
|
||||
} else {
|
||||
return +1;
|
||||
}
|
||||
});
|
||||
// Now go through the plugins in ascending order and assign the shadows
|
||||
shadowTiddlers = Object.create(null);
|
||||
$tw.utils.each(pluginTiddlers,function(tiddler) {
|
||||
shadowTiddlerInfo = Object.create(null);
|
||||
$tw.utils.each(pluginTiddlersInfo,function(tiddlerFields) {
|
||||
var contents = pluginContents[tiddlerFields.title].contents;
|
||||
// Extract the constituent tiddlers
|
||||
if($tw.utils.hop(pluginInfo,tiddler.fields.title)) {
|
||||
$tw.utils.each(pluginInfo[tiddler.fields.title].tiddlers,function(constituentTiddler,constituentTitle) {
|
||||
// Save the tiddler object
|
||||
if(constituentTitle) {
|
||||
shadowTiddlers[constituentTitle] = {
|
||||
source: tiddler.fields.title,
|
||||
tiddler: new $tw.Tiddler(constituentTiddler,{title: constituentTitle})
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
$tw.utils.each(contents,function(constituentTiddler,constituentTitle) {
|
||||
// Save the tiddler object
|
||||
shadowTiddlerInfo[constituentTitle] = {
|
||||
source: tiddlerFields.title,
|
||||
tiddler: new $tw.Tiddler(constituentTiddler,{title: constituentTitle})
|
||||
};
|
||||
});
|
||||
});
|
||||
shadowTiddlerTitles = null;
|
||||
shadowTiddlerTitles = null; // Force regeneration of the shadow tiddler titles list
|
||||
this.clearCache(null);
|
||||
this.clearGlobalCache();
|
||||
$tw.utils.each(indexers,function(indexer) {
|
||||
@@ -1944,7 +1976,7 @@ $tw.boot.excludeRegExp = /^\.DS_Store$|^.*\.meta$|^\..*\.swp$|^\._.*$|^\.git$|^\
|
||||
/*
|
||||
Load all the tiddlers recursively from a directory, including honouring `tiddlywiki.files` files for drawing in external files. Returns an array of {filepath:,type:,tiddlers: [{..fields...}],hasMetaFile:}. Note that no file information is returned for externally loaded tiddlers, just the `tiddlers` property.
|
||||
*/
|
||||
$tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
|
||||
$tw.loadTiddlersFromPath = function(filepath,excludeRegExp,excludePluginInfo) {
|
||||
excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp;
|
||||
var tiddlers = [];
|
||||
if(fs.existsSync(filepath)) {
|
||||
@@ -1954,11 +1986,17 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
|
||||
// Look for a tiddlywiki.files file
|
||||
if(files.indexOf("tiddlywiki.files") !== -1) {
|
||||
Array.prototype.push.apply(tiddlers,$tw.loadTiddlersFromSpecification(filepath,excludeRegExp));
|
||||
} else if(files.indexOf("plugin.info") !== -1 && !excludePluginInfo) {
|
||||
// Load sub-plugin
|
||||
var tiddler = $tw.loadPluginFolder(filepath);
|
||||
if(tiddler) {
|
||||
tiddlers.push({tiddlers: [tiddler]});
|
||||
}
|
||||
} else {
|
||||
// If not, read all the files in the directory
|
||||
$tw.utils.each(files,function(file) {
|
||||
if(!excludeRegExp.test(file) && file !== "plugin.info") {
|
||||
tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(filepath + path.sep + file,excludeRegExp));
|
||||
tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(path.join(filepath,file),excludeRegExp));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2000,7 +2038,7 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
|
||||
var value = tiddler[name];
|
||||
switch(fieldInfo.source) {
|
||||
case "subdirectories":
|
||||
value = $tw.utils.stringifyList(path.relative(rootPath, filename).split(path.sep).slice(0, -1));
|
||||
value = path.relative(rootPath, filename).split(path.sep).slice(0, -1);
|
||||
break;
|
||||
case "filepath":
|
||||
value = path.relative(rootPath, filename).split(path.sep).join('/');
|
||||
@@ -2021,10 +2059,10 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
|
||||
value = path.extname(filename);
|
||||
break;
|
||||
case "created":
|
||||
value = $tw.utils.stringifyDate(new Date(fs.statSync(pathname).birthtime));
|
||||
value = new Date(fs.statSync(pathname).birthtime);
|
||||
break;
|
||||
case "modified":
|
||||
value = $tw.utils.stringifyDate(new Date(fs.statSync(pathname).mtime));
|
||||
value = new Date(fs.statSync(pathname).mtime);
|
||||
break;
|
||||
}
|
||||
if(fieldInfo.prefix) {
|
||||
@@ -2105,54 +2143,69 @@ Load the tiddlers from a plugin folder, and package them up into a proper JSON p
|
||||
*/
|
||||
$tw.loadPluginFolder = function(filepath,excludeRegExp) {
|
||||
excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp;
|
||||
var infoPath = filepath + path.sep + "plugin.info";
|
||||
if(fs.existsSync(filepath) && fs.statSync(filepath).isDirectory()) {
|
||||
// Read the plugin information
|
||||
if(!fs.existsSync(infoPath) || !fs.statSync(infoPath).isFile()) {
|
||||
console.log("Warning: missing plugin.info file in " + filepath);
|
||||
function readPluginFields(filepath) {
|
||||
if(!(fs.existsSync(filepath) && fs.statSync(filepath).isDirectory())) {
|
||||
return null;
|
||||
}
|
||||
var pluginInfo = $tw.utils.parseJSONSafe(fs.readFileSync(infoPath,"utf8"),function() {return null;});
|
||||
if(!pluginInfo) {
|
||||
console.log("warning: invalid JSON in plugin.info file at " + infoPath);
|
||||
pluginInfo = {};
|
||||
var infoPath = path.join(filepath,"plugin.info");
|
||||
// Read the plugin information file
|
||||
if(!fs.existsSync(infoPath) || !fs.statSync(infoPath).isFile()) {
|
||||
return null;
|
||||
}
|
||||
// Read the plugin files
|
||||
var pluginFiles = $tw.loadTiddlersFromPath(filepath,excludeRegExp);
|
||||
// Save the plugin tiddlers into the plugin info
|
||||
pluginInfo.tiddlers = pluginInfo.tiddlers || Object.create(null);
|
||||
var pluginFields = $tw.utils.parseJSONSafe(fs.readFileSync(infoPath,"utf8"),{});
|
||||
if(!(pluginFields.title && pluginFields.name)) {
|
||||
return null;
|
||||
}
|
||||
// Give the plugin the same version number as the core if it doesn't have one
|
||||
if(!("version" in pluginFields)) {
|
||||
pluginFields.version = $tw.packageInfo.version;
|
||||
}
|
||||
// Use "plugin" as the plugin-type if we don't have one
|
||||
if(!("plugin-type" in pluginFields)) {
|
||||
pluginFields["plugin-type"] = "plugin";
|
||||
}
|
||||
// Set the dependents and type
|
||||
pluginFields.dependents = pluginFields.dependents || [];
|
||||
pluginFields.type = "application/json";
|
||||
// Deserialise array fields (currently required for the dependents field)
|
||||
for(var field in pluginFields) {
|
||||
if($tw.utils.isArray(pluginFields[field])) {
|
||||
pluginFields[field] = $tw.utils.stringifyList(pluginFields[field]);
|
||||
}
|
||||
}
|
||||
return pluginFields;
|
||||
}
|
||||
function readPluginTiddlers(tiddlersPath) {
|
||||
var pluginFiles = $tw.loadTiddlersFromPath(tiddlersPath,excludeRegExp,true),
|
||||
pluginTiddlers = {};
|
||||
// Save the plugin tiddlers into the plugin payload
|
||||
for(var f=0; f<pluginFiles.length; f++) {
|
||||
var tiddlers = pluginFiles[f].tiddlers;
|
||||
if(!tiddlers) {
|
||||
console.log(`Gosh ${JSON.stringify(pluginFiles[f])}`)
|
||||
}
|
||||
for(var t=0; t<tiddlers.length; t++) {
|
||||
var tiddler= tiddlers[t];
|
||||
if(tiddler.title) {
|
||||
pluginInfo.tiddlers[tiddler.title] = tiddler;
|
||||
pluginTiddlers[tiddler.title] = tiddler;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Give the plugin the same version number as the core if it doesn't have one
|
||||
if(!("version" in pluginInfo)) {
|
||||
pluginInfo.version = $tw.packageInfo.version;
|
||||
}
|
||||
// Use "plugin" as the plugin-type if we don't have one
|
||||
if(!("plugin-type" in pluginInfo)) {
|
||||
pluginInfo["plugin-type"] = "plugin";
|
||||
}
|
||||
pluginInfo.dependents = pluginInfo.dependents || [];
|
||||
pluginInfo.type = "application/json";
|
||||
// Set plugin text
|
||||
pluginInfo.text = JSON.stringify({tiddlers: pluginInfo.tiddlers});
|
||||
delete pluginInfo.tiddlers;
|
||||
// Deserialise array fields (currently required for the dependents field)
|
||||
for(var field in pluginInfo) {
|
||||
if($tw.utils.isArray(pluginInfo[field])) {
|
||||
pluginInfo[field] = $tw.utils.stringifyList(pluginInfo[field]);
|
||||
}
|
||||
}
|
||||
return pluginInfo;
|
||||
} else {
|
||||
return null;
|
||||
return pluginTiddlers;
|
||||
}
|
||||
// Get the primary plugin fields
|
||||
var pluginFields = readPluginFields(filepath);
|
||||
if(!pluginFields) {
|
||||
console.log("Warning: missing or invalid plugin.info file in " + filepath);
|
||||
return null;
|
||||
}
|
||||
// The payload to be stored in the plugin text field in JSON
|
||||
var pluginPayload = {tiddlers: {}};
|
||||
// Get the constituent tiddlers of the plugin
|
||||
pluginPayload.tiddlers = readPluginTiddlers(filepath);
|
||||
// Set plugin text
|
||||
pluginFields.text = JSON.stringify(pluginPayload);
|
||||
return pluginFields;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -3,5 +3,8 @@ name: en-GB
|
||||
description: English (British)
|
||||
author: JeremyRuston
|
||||
core-version: >=5.0.0"
|
||||
plugin-type: language
|
||||
type: application/json
|
||||
hidden: yes
|
||||
|
||||
Stub pseudo-plugin for the default language
|
||||
{tidddlers:{}}
|
||||
@@ -4,12 +4,12 @@ _canonical_uri: The full URI of an external image tiddler
|
||||
author: Name of the author of a plugin
|
||||
bag: The name of the bag from which a tiddler came
|
||||
caption: The text to be displayed on a tab or button
|
||||
class: The CSS class applied to a tiddler when rendering it. Also used for Modals
|
||||
class: The CSS class applied to a tiddler when rendering it - see [[Custom styles by user-class]]. Also used for [[Modals]]
|
||||
code-body: The view template will display the tiddler as code if set to ''yes''
|
||||
color: The CSS color value associated with a tiddler
|
||||
component: The name of the component responsible for an alert tiddler
|
||||
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
|
||||
core-version: For a plugin, indicates what version of TiddlyWiki with which it is compatible
|
||||
current-tiddler: Used to cache the top tiddler in a history list
|
||||
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
|
||||
created: The date a tiddler was created
|
||||
creator: The name of the person who created a tiddler
|
||||
dependents: For a plugin, lists the dependent plugin titles
|
||||
|
||||
@@ -6,6 +6,7 @@ module-type: filteroperator
|
||||
Filter operator for returning all the backtranscludes from a tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -18,3 +19,5 @@ exports.backtranscludes = function(source,operator,options) {
|
||||
});
|
||||
return results.makeTiddlerIterator(options.wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
36
core/modules/filters/is/plugin.js
Normal file
36
core/modules/filters/is/plugin.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/is/plugin.js
|
||||
type: application/javascript
|
||||
module-type: isfilteroperator
|
||||
|
||||
Filter function for [is[plugin]]
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.plugin = function(source,prefix,options) {
|
||||
var results = [];
|
||||
if(prefix === "!") {
|
||||
source(function(tiddler,title) {
|
||||
if(!tiddler.isPlugin()) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler.isPlugin()) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -6,6 +6,7 @@ module-type: filteroperator
|
||||
Filter operator for returning all the transcludes from a tiddler
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -18,3 +19,5 @@ exports.transcludes = function(source,operator,options) {
|
||||
});
|
||||
return results.makeTiddlerIterator(options.wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/wikify.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator wikifying each string in the input list and returning the result as a list of strings
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.wikify = function(source,operator,options) {
|
||||
var output = operator.operands[0],
|
||||
mode = operator.operands[1],
|
||||
type = operator.operands[2],
|
||||
results = [];
|
||||
source(function(tiddler,title) {
|
||||
var wikifier = new $tw.utils.Wikifier({
|
||||
wiki: options.wiki,
|
||||
widget: options.widget,
|
||||
text: title,
|
||||
type: type,
|
||||
mode: mode,
|
||||
output: output
|
||||
});
|
||||
results.push(wikifier.getResult());
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -10,6 +10,7 @@ This is a <%if [{something}] %>Elephant<%elseif [{else}] %>Pelican<%else%>Crocod
|
||||
```
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
exports.name = "conditional";
|
||||
@@ -112,3 +113,5 @@ exports.parseIfClause = function(filterCondition) {
|
||||
// Return the parse tree node
|
||||
return [listWidget];
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -50,7 +50,7 @@ exports.parse = function() {
|
||||
var reEnd;
|
||||
if(this.match[5]) {
|
||||
// If so, it is a multiline definition and the end of the body is marked with \end
|
||||
reEnd = new RegExp("((:?^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?\\s*?(?:$|\\r?\\n))","mg");
|
||||
reEnd = new RegExp("((:?^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[2]) + ")?(?:$|\\r?\\n))","mg");
|
||||
} else {
|
||||
// Otherwise, the end of the definition is marked by the end of the line
|
||||
reEnd = /($|\r?\n)/mg;
|
||||
|
||||
@@ -55,7 +55,7 @@ exports.parse = function() {
|
||||
var reEnd;
|
||||
if(this.match[3]) {
|
||||
// If so, it is a multiline definition and the end of the body is marked with \end
|
||||
reEnd = new RegExp("((?:^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?\\s*?(?:$|\\r?\\n))","mg");
|
||||
reEnd = new RegExp("((?:^|\\r?\\n)[^\\S\\n\\r]*\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?(?:$|\\r?\\n))","mg");
|
||||
} else {
|
||||
// Otherwise, the end of the definition is marked by the end of the line
|
||||
reEnd = /($|\r?\n)/mg;
|
||||
|
||||
@@ -35,6 +35,7 @@ function PluginSwitcher(options) {
|
||||
}
|
||||
|
||||
PluginSwitcher.prototype.switchPlugins = function() {
|
||||
var self = this;
|
||||
// Get the name of the current theme
|
||||
var selectedPluginTitle = this.wiki.getTiddlerText(this.controllerTitle);
|
||||
// If it doesn't exist, then fallback to one of the default themes
|
||||
@@ -49,22 +50,51 @@ PluginSwitcher.prototype.switchPlugins = function() {
|
||||
var tiddler = self.wiki.getTiddler(title);
|
||||
if(tiddler && tiddler.isPlugin() && plugins.indexOf(title) === -1) {
|
||||
plugins.push(title);
|
||||
var pluginInfo = $tw.utils.parseJSONSafe(self.wiki.getTiddlerText(title)),
|
||||
dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
|
||||
var dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
|
||||
$tw.utils.each(dependents,function(title) {
|
||||
accumulatePlugin(title);
|
||||
});
|
||||
}
|
||||
};
|
||||
accumulatePlugin(selectedPluginTitle);
|
||||
var selectedPluginTiddler = this.wiki.getTiddler(selectedPluginTitle);
|
||||
// Accumulate any other plugins of the same type with the same name
|
||||
this.wiki.eachTiddlerPlusShadows(function(tiddler,title) {
|
||||
if(tiddler.isPlugin() && tiddler.fields["plugin-type"] === self.pluginType && tiddler.fields.name === selectedPluginTiddler.fields.name) {
|
||||
accumulatePlugin(title);
|
||||
}
|
||||
});
|
||||
// Read the plugin info for the incoming plugins
|
||||
var changes = $tw.wiki.readPluginInfo(plugins);
|
||||
// Unregister any existing theme tiddlers
|
||||
var unregisteredTiddlers = $tw.wiki.unregisterPluginTiddlers(this.pluginType);
|
||||
// Register any new theme tiddlers
|
||||
var registeredTiddlers = $tw.wiki.registerPluginTiddlers(this.pluginType,plugins);
|
||||
// Unpack the current theme tiddlers
|
||||
$tw.wiki.unpackPluginTiddlers();
|
||||
var changedPluginInfo = this.wiki.readPluginInfo(plugins);
|
||||
// Collect the shadow tiddlers of any deleted plugins
|
||||
var changedShadowTiddlers = {};
|
||||
$tw.utils.each(changedPluginInfo.deletedPlugins,function(pluginTitle) {
|
||||
var contents = changedPluginInfo.deletedPluginContents[pluginTitle];
|
||||
if(contents && contents.tiddlers) {
|
||||
$tw.utils.each(Object.keys(contents.tiddlers),function(title) {
|
||||
changedShadowTiddlers[title] = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
// Collect the shadow tiddlers of any modified plugins
|
||||
$tw.utils.each(changedPluginInfo.modifiedPlugins,function(pluginTitle) {
|
||||
var pluginInfo = self.wiki.getPluginInfo(pluginTitle);
|
||||
if(pluginInfo && pluginInfo.tiddlers) {
|
||||
$tw.utils.each(Object.keys(pluginInfo.tiddlers),function(title) {
|
||||
changedShadowTiddlers[title] = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
// Unregister any existing theme/language tiddlers
|
||||
var unregisteredTiddlers = this.wiki.unregisterPluginTiddlers(this.pluginType);
|
||||
// Register any new theme/language tiddlers
|
||||
var registeredTiddlers = this.wiki.registerPluginTiddlers(this.pluginType,plugins);
|
||||
// Unpack the current theme/language tiddlers
|
||||
this.wiki.unpackPluginTiddlers();
|
||||
// Queue change events for the changed shadow tiddlers
|
||||
$tw.utils.each(changedShadowTiddlers,function(status,title) {
|
||||
self.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true);
|
||||
});
|
||||
// Call the switch handler
|
||||
if(this.onSwitch) {
|
||||
this.onSwitch(plugins);
|
||||
|
||||
@@ -15,67 +15,7 @@ exports.after = ["load-modules"];
|
||||
exports.before = ["startup"];
|
||||
exports.synchronous = true;
|
||||
|
||||
var TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE = "$:/status/RequireReloadDueToPluginChange";
|
||||
|
||||
var PREFIX_CONFIG_REGISTER_PLUGIN_TYPE = "$:/config/RegisterPluginType/";
|
||||
|
||||
exports.startup = function() {
|
||||
$tw.wiki.addTiddler({title: TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE,text: "no"});
|
||||
$tw.wiki.addEventListener("change",function(changes) {
|
||||
// Work out which of the changed tiddlers are plugins that we need to reregister
|
||||
var changesToProcess = [],
|
||||
requireReloadDueToPluginChange = false;
|
||||
$tw.utils.each(Object.keys(changes),function(title) {
|
||||
var tiddler = $tw.wiki.getTiddler(title),
|
||||
requiresReload = $tw.wiki.doesPluginRequireReload(title);
|
||||
if(requiresReload) {
|
||||
requireReloadDueToPluginChange = true;
|
||||
} else if(tiddler) {
|
||||
var pluginType = tiddler.fields["plugin-type"];
|
||||
if($tw.wiki.getTiddlerText(PREFIX_CONFIG_REGISTER_PLUGIN_TYPE + (tiddler.fields["plugin-type"] || ""),"no") === "yes") {
|
||||
changesToProcess.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
// Issue warning if any of the tiddlers require a reload
|
||||
if(requireReloadDueToPluginChange) {
|
||||
$tw.wiki.addTiddler({title: TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE,text: "yes"});
|
||||
}
|
||||
// Read or delete the plugin info of the changed tiddlers
|
||||
if(changesToProcess.length > 0) {
|
||||
var changes = $tw.wiki.readPluginInfo(changesToProcess);
|
||||
if(changes.modifiedPlugins.length > 0 || changes.deletedPlugins.length > 0) {
|
||||
var changedShadowTiddlers = {};
|
||||
// Collect the shadow tiddlers of any deleted plugins
|
||||
$tw.utils.each(changes.deletedPlugins,function(pluginTitle) {
|
||||
var pluginInfo = $tw.wiki.getPluginInfo(pluginTitle);
|
||||
if(pluginInfo) {
|
||||
$tw.utils.each(Object.keys(pluginInfo.tiddlers),function(title) {
|
||||
changedShadowTiddlers[title] = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
// Collect the shadow tiddlers of any modified plugins
|
||||
$tw.utils.each(changes.modifiedPlugins,function(pluginTitle) {
|
||||
var pluginInfo = $tw.wiki.getPluginInfo(pluginTitle);
|
||||
if(pluginInfo && pluginInfo.tiddlers) {
|
||||
$tw.utils.each(Object.keys(pluginInfo.tiddlers),function(title) {
|
||||
changedShadowTiddlers[title] = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
// (Re-)register any modified plugins
|
||||
$tw.wiki.registerPluginTiddlers(null,changes.modifiedPlugins);
|
||||
// Unregister any deleted plugins
|
||||
$tw.wiki.unregisterPluginTiddlers(null,changes.deletedPlugins);
|
||||
// Unpack the shadow tiddlers
|
||||
$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.utils.installPluginChangeHandler($tw.wiki);
|
||||
};
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@ exports.hasTag = function(tag) {
|
||||
return this.fields.tags && this.fields.tags.indexOf(tag) !== -1;
|
||||
};
|
||||
|
||||
exports.isPlugin = function() {
|
||||
return this.fields.type === "application/json" && this.hasField("plugin-type");
|
||||
};
|
||||
|
||||
exports.isDraft = function() {
|
||||
return this.hasField("draft.of");
|
||||
};
|
||||
|
||||
@@ -6,6 +6,8 @@ module-type: utils
|
||||
Custom errors for TiddlyWiki.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
function TranscludeRecursionError() {
|
||||
Error.apply(this,arguments);
|
||||
this.signatures = Object.create(null);
|
||||
@@ -17,3 +19,5 @@ TranscludeRecursionError.MAX_WIDGET_TREE_DEPTH = 1000;
|
||||
TranscludeRecursionError.prototype = Object.create(Error);
|
||||
|
||||
exports.TranscludeRecursionError = TranscludeRecursionError;
|
||||
|
||||
})();
|
||||
|
||||
95
core/modules/utils/plugins.js
Normal file
95
core/modules/utils/plugins.js
Normal file
@@ -0,0 +1,95 @@
|
||||
/*\
|
||||
title: $:/core/modules/utils/plugins.js
|
||||
type: application/javascript
|
||||
module-type: utils
|
||||
|
||||
Plugin utilities
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE = "$:/status/RequireReloadDueToPluginChange";
|
||||
|
||||
var PREFIX_CONFIG_REGISTER_PLUGIN_TYPE = "$:/config/RegisterPluginType/";
|
||||
|
||||
exports.installPluginChangeHandler = function(wiki) {
|
||||
wiki.addTiddler({title: TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE,text: "no"});
|
||||
wiki.addEventListener("change",function(changes) {
|
||||
// Work out which of the changed tiddlers are plugins that we need to (re)register
|
||||
var changesToProcess = [];
|
||||
$tw.utils.each(Object.keys(changes),function(title) {
|
||||
var tiddler = wiki.getTiddler(title);
|
||||
if(tiddler) {
|
||||
// It is a plugin that has been added or modified and is of a type that we need to register
|
||||
if(tiddler.isPlugin() && wiki.getTiddlerText(PREFIX_CONFIG_REGISTER_PLUGIN_TYPE + (tiddler.fields["plugin-type"] || ""),"no") === "yes") {
|
||||
changesToProcess.push(title);
|
||||
}
|
||||
} else {
|
||||
if(wiki.isSubPlugin(title)) {
|
||||
// It is a sub-plugin
|
||||
changesToProcess.push(title);
|
||||
} else {
|
||||
// It is a plugin that has been deleted
|
||||
var pluginInfo = wiki.getPluginInfo(title)
|
||||
if(pluginInfo) {
|
||||
changesToProcess.push(title);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(changesToProcess.length > 0) {
|
||||
// Read the plugin info of the changed tiddlers
|
||||
var changedPluginInfo = wiki.readPluginInfo(changesToProcess);
|
||||
if(changedPluginInfo.modifiedPlugins.length > 0 || changedPluginInfo.deletedPlugins.length > 0) {
|
||||
var changedShadowTiddlers = {},
|
||||
requireReloadDueToPluginChange = false;
|
||||
// Collect the shadow tiddlers of any deleted plugins
|
||||
$tw.utils.each(changedPluginInfo.deletedPlugins,function(pluginTitle) {
|
||||
var contents = changedPluginInfo.deletedPluginContents[pluginTitle];
|
||||
if(contents && contents.tiddlers) {
|
||||
$tw.utils.each(Object.keys(contents.tiddlers),function(title) {
|
||||
changedShadowTiddlers[title] = true;
|
||||
if(contents.tiddlers[title].type === "application/javascript") {
|
||||
requireReloadDueToPluginChange = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// Collect the shadow tiddlers of any modified plugins
|
||||
$tw.utils.each(changedPluginInfo.modifiedPlugins,function(pluginTitle) {
|
||||
var pluginInfo = wiki.getPluginInfo(pluginTitle);
|
||||
if(pluginInfo && pluginInfo.tiddlers) {
|
||||
$tw.utils.each(Object.keys(pluginInfo.tiddlers),function(title) {
|
||||
changedShadowTiddlers[title] = false;
|
||||
if(pluginInfo.tiddlers[title].type === "application/javascript") {
|
||||
requireReloadDueToPluginChange = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// (Re-)register any modified plugins
|
||||
wiki.registerPluginTiddlers(null,changedPluginInfo.modifiedPlugins);
|
||||
// Unregister any deleted plugins
|
||||
wiki.unregisterPluginTiddlers(null,changedPluginInfo.deletedPlugins);
|
||||
// Unpack the shadow tiddlers
|
||||
wiki.unpackPluginTiddlers();
|
||||
// Queue change events for the changed shadow tiddlers
|
||||
$tw.utils.each(changedShadowTiddlers,function(status,title) {
|
||||
wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true);
|
||||
});
|
||||
// Issue warning if any of the tiddlers require a reload
|
||||
if(requireReloadDueToPluginChange) {
|
||||
wiki.addTiddler({title: TITLE_REQUIRE_RELOAD_DUE_TO_PLUGIN_CHANGE,text: "yes"});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
})();
|
||||
@@ -6,6 +6,7 @@ module-type: utils
|
||||
Utilities for working with the TiddlyWiki repository file structure
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
@@ -44,3 +45,5 @@ exports.getAllPlugins = function(options) {
|
||||
$tw.utils.each($tw.getLibraryItemSearchPaths($tw.config.languagesPath,options.ignoreEnvironmentVariables ? undefined : $tw.config.languagesEnvVar),collectPlugins);
|
||||
return tiddlers;
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/*\
|
||||
title: $:/core/modules/utils/wikifier.js
|
||||
type: application/javascript
|
||||
module-type: utils
|
||||
|
||||
A high level helper class for parsing and wikification
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*
|
||||
Options include:
|
||||
wiki: wiki to be used for wikification
|
||||
widget: optional widget to be used as parent of wikified text
|
||||
text: text to be parsed/wikified
|
||||
type: type of the text
|
||||
mode: inline or block
|
||||
output: text, formattedtext, html, parsetree or widgettree
|
||||
*/
|
||||
function Wikifier(options) {
|
||||
this.wiki = options.wiki || $tw.wiki;
|
||||
this.widget = options.widget || $tw.rootWidget;
|
||||
this.text = options.text || "";
|
||||
this.type = options.type || "";
|
||||
this.mode = options.mode || "block";
|
||||
this.output = options.output || "text";
|
||||
// Create the parse tree
|
||||
this.parser = this.wiki.parseText(this.type,this.text,{
|
||||
parseAsInline: this.mode === "inline"
|
||||
});
|
||||
// Create the widget tree
|
||||
this.widgetNode = this.wiki.makeWidget(this.parser,{
|
||||
document: $tw.fakeDocument,
|
||||
parentWidget: this.widget
|
||||
});
|
||||
// Render the widget tree to the container
|
||||
this.container = $tw.fakeDocument.createElement("div");
|
||||
this.widgetNode.render(this.container,null);
|
||||
};
|
||||
|
||||
Wikifier.prototype.refresh = function(changedTiddlers) {
|
||||
// Refresh the widget tree
|
||||
return this.widgetNode.refresh(changedTiddlers);
|
||||
};
|
||||
|
||||
/*
|
||||
Return the result string
|
||||
*/
|
||||
Wikifier.prototype.getResult = function() {
|
||||
var result;
|
||||
switch(this.output) {
|
||||
case "text":
|
||||
result = this.container.textContent;
|
||||
break;
|
||||
case "formattedtext":
|
||||
result = this.container.formattedTextContent;
|
||||
break;
|
||||
case "html":
|
||||
result = this.container.innerHTML;
|
||||
break;
|
||||
case "parsetree":
|
||||
result = JSON.stringify(this.parser.tree,0,$tw.config.preferences.jsonSpaces);
|
||||
break;
|
||||
case "widgettree":
|
||||
result = JSON.stringify(this.getWidgetTree(),0,$tw.config.preferences.jsonSpaces);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
Return a string of the widget tree
|
||||
*/
|
||||
Wikifier.prototype.getWidgetTree = function() {
|
||||
var copyNode = function(widgetNode,resultNode) {
|
||||
var type = widgetNode.parseTreeNode.type;
|
||||
resultNode.type = type;
|
||||
switch(type) {
|
||||
case "element":
|
||||
resultNode.tag = widgetNode.parseTreeNode.tag;
|
||||
break;
|
||||
case "text":
|
||||
resultNode.text = widgetNode.parseTreeNode.text;
|
||||
break;
|
||||
}
|
||||
if(Object.keys(widgetNode.attributes || {}).length > 0) {
|
||||
resultNode.attributes = {};
|
||||
$tw.utils.each(widgetNode.attributes,function(attr,attrName) {
|
||||
resultNode.attributes[attrName] = widgetNode.getAttribute(attrName);
|
||||
});
|
||||
}
|
||||
if(Object.keys(widgetNode.children || {}).length > 0) {
|
||||
resultNode.children = [];
|
||||
$tw.utils.each(widgetNode.children,function(widgetChildNode) {
|
||||
var node = {};
|
||||
resultNode.children.push(node);
|
||||
copyNode(widgetChildNode,node);
|
||||
});
|
||||
}
|
||||
},
|
||||
results = {};
|
||||
copyNode(this.widgetNode,results);
|
||||
return results;
|
||||
};
|
||||
|
||||
exports.Wikifier = Wikifier;
|
||||
|
||||
})();
|
||||
@@ -6,6 +6,7 @@ module-type: widget
|
||||
Widget to dynamically represent one or more tiddlers
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
@@ -186,3 +187,5 @@ function hasPayloadChanged(a,b) {
|
||||
}
|
||||
|
||||
exports.data = DataWidget;
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,6 +6,7 @@ module-type: widget
|
||||
Widget to display a test case
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
@@ -65,11 +66,24 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
});
|
||||
var jsonPayload = JSON.stringify(tiddlers);
|
||||
this.testcaseWiki.addTiddlers(tiddlers);
|
||||
// Suppress next tick dispatch for wiki change events
|
||||
this.testcaseWiki.setDispatchMode(true);
|
||||
// Unpack plugin tiddlers
|
||||
this.testcaseWiki.readPluginInfo();
|
||||
this.testcaseWiki.registerPluginTiddlers("plugin");
|
||||
this.testcaseWiki.unpackPluginTiddlers();
|
||||
this.testcaseWiki.addIndexersToWiki();
|
||||
// Install the plugin change event handler
|
||||
$tw.utils.installPluginChangeHandler(this.testcaseWiki);
|
||||
// Install the language switcher
|
||||
var languageSwitcher = new $tw.PluginSwitcher({
|
||||
wiki: this.testcaseWiki,
|
||||
pluginType: "language",
|
||||
controllerTitle: "$:/language",
|
||||
defaultPlugins: [
|
||||
"$:/languages/en-GB"
|
||||
]
|
||||
});
|
||||
// Generate a `transclusion` variable that depends on the values of the payload tiddlers so that the template can easily make unique state tiddlers
|
||||
this.setVariable("transclusion",$tw.utils.hashString(jsonPayload));
|
||||
// Generate a `payloadTiddlers` variable that contains the payload in JSON format
|
||||
@@ -91,13 +105,20 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
}
|
||||
});
|
||||
testcaseOutputWidget.render(testcaseOutputContainer);
|
||||
// Install the wiki change event handler
|
||||
this.testcaseWiki.addEventListener("change",function(changes) {
|
||||
testcaseOutputWidget.refresh(changes,testcaseOutputContainer);
|
||||
});
|
||||
}
|
||||
// Clear changes queue
|
||||
this.testcaseWiki.clearTiddlerEventQueue();
|
||||
// Run the actions if provided
|
||||
if(this.testcaseWiki.tiddlerExists(this.testcaseTestActions)) {
|
||||
testcaseOutputWidget.invokeActionString(this.testcaseWiki.getTiddlerText(this.testcaseTestActions));
|
||||
testcaseOutputWidget.refresh(this.testcaseWiki.changedTiddlers,testcaseOutputContainer);
|
||||
// Make sure all wiki events have been cleared
|
||||
while(this.testcaseWiki.eventsTriggered) {
|
||||
this.testcaseWiki.processOutstandingTiddlerEvents();
|
||||
}
|
||||
}
|
||||
// Set up the test result variables
|
||||
var testResult = "",
|
||||
@@ -127,6 +148,8 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) {
|
||||
parentWidget: this
|
||||
});
|
||||
rootWidget.render(domNode);
|
||||
// Re-enable next tick dispatch for wiki change events
|
||||
this.testcaseWiki.setDispatchMode(false);
|
||||
// Trap changes in the wiki and refresh the rendering
|
||||
this.testcaseWiki.addEventListener("change",function(changes) {
|
||||
rootWidget.refresh(changes,domNode);
|
||||
@@ -159,3 +182,5 @@ TestCaseWidget.prototype.refresh = function(changedTiddlers) {
|
||||
};
|
||||
|
||||
exports["testcase"] = TestCaseWidget;
|
||||
|
||||
})();
|
||||
|
||||
@@ -36,22 +36,89 @@ Compute the internal state of the widget
|
||||
WikifyWidget.prototype.execute = function() {
|
||||
// Get our parameters
|
||||
this.wikifyName = this.getAttribute("name");
|
||||
// Create the wikifier
|
||||
this.wikifier = new $tw.utils.Wikifier({
|
||||
wiki: this.wiki,
|
||||
widget: this,
|
||||
text: this.getAttribute("text"),
|
||||
type: this.getAttribute("type"),
|
||||
mode: this.getAttribute("mode","block"),
|
||||
output: this.getAttribute("output","text")
|
||||
});
|
||||
this.wikifyResult = this.wikifier.getResult();
|
||||
this.wikifyText = this.getAttribute("text");
|
||||
this.wikifyType = this.getAttribute("type");
|
||||
this.wikifyMode = this.getAttribute("mode","block");
|
||||
this.wikifyOutput = this.getAttribute("output","text");
|
||||
// Create the parse tree
|
||||
this.wikifyParser = this.wiki.parseText(this.wikifyType,this.wikifyText,{
|
||||
parseAsInline: this.wikifyMode === "inline"
|
||||
});
|
||||
// Create the widget tree
|
||||
this.wikifyWidgetNode = this.wiki.makeWidget(this.wikifyParser,{
|
||||
document: $tw.fakeDocument,
|
||||
parentWidget: this
|
||||
});
|
||||
// Render the widget tree to the container
|
||||
this.wikifyContainer = $tw.fakeDocument.createElement("div");
|
||||
this.wikifyWidgetNode.render(this.wikifyContainer,null);
|
||||
this.wikifyResult = this.getResult();
|
||||
// Set context variable
|
||||
this.setVariable(this.wikifyName,this.wikifyResult);
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
/*
|
||||
Return the result string
|
||||
*/
|
||||
WikifyWidget.prototype.getResult = function() {
|
||||
var result;
|
||||
switch(this.wikifyOutput) {
|
||||
case "text":
|
||||
result = this.wikifyContainer.textContent;
|
||||
break;
|
||||
case "formattedtext":
|
||||
result = this.wikifyContainer.formattedTextContent;
|
||||
break;
|
||||
case "html":
|
||||
result = this.wikifyContainer.innerHTML;
|
||||
break;
|
||||
case "parsetree":
|
||||
result = JSON.stringify(this.wikifyParser.tree,0,$tw.config.preferences.jsonSpaces);
|
||||
break;
|
||||
case "widgettree":
|
||||
result = JSON.stringify(this.getWidgetTree(),0,$tw.config.preferences.jsonSpaces);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
Return a string of the widget tree
|
||||
*/
|
||||
WikifyWidget.prototype.getWidgetTree = function() {
|
||||
var copyNode = function(widgetNode,resultNode) {
|
||||
var type = widgetNode.parseTreeNode.type;
|
||||
resultNode.type = type;
|
||||
switch(type) {
|
||||
case "element":
|
||||
resultNode.tag = widgetNode.parseTreeNode.tag;
|
||||
break;
|
||||
case "text":
|
||||
resultNode.text = widgetNode.parseTreeNode.text;
|
||||
break;
|
||||
}
|
||||
if(Object.keys(widgetNode.attributes || {}).length > 0) {
|
||||
resultNode.attributes = {};
|
||||
$tw.utils.each(widgetNode.attributes,function(attr,attrName) {
|
||||
resultNode.attributes[attrName] = widgetNode.getAttribute(attrName);
|
||||
});
|
||||
}
|
||||
if(Object.keys(widgetNode.children || {}).length > 0) {
|
||||
resultNode.children = [];
|
||||
$tw.utils.each(widgetNode.children,function(widgetChildNode) {
|
||||
var node = {};
|
||||
resultNode.children.push(node);
|
||||
copyNode(widgetChildNode,node);
|
||||
});
|
||||
}
|
||||
},
|
||||
results = {};
|
||||
copyNode(this.wikifyWidgetNode,results);
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
@@ -63,9 +130,9 @@ WikifyWidget.prototype.refresh = function(changedTiddlers) {
|
||||
return true;
|
||||
} else {
|
||||
// Refresh the widget tree
|
||||
if(this.wikifier.refresh(changedTiddlers)) {
|
||||
if(this.wikifyWidgetNode.refresh(changedTiddlers)) {
|
||||
// Check if there was any change
|
||||
var result = this.wikifier.getResult();
|
||||
var result = this.getResult();
|
||||
if(result !== this.wikifyResult) {
|
||||
// If so, save the change
|
||||
this.wikifyResult = result;
|
||||
|
||||
@@ -132,6 +132,14 @@ exports.dispatchEvent = function(type /*, args */) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
false (default) to dispatch event tick as usual
|
||||
true to suppress dispatching the event tick and allow outstanding events to be processed manually
|
||||
*/
|
||||
exports.setDispatchMode = function(mode) {
|
||||
this.dispatchMode = mode;
|
||||
}
|
||||
|
||||
/*
|
||||
Causes a tiddler to be marked as changed, incrementing the change count, and triggers event handlers.
|
||||
This method should be called after the changes it describes have been made to the wiki.tiddlers[] array.
|
||||
@@ -156,17 +164,18 @@ exports.enqueueTiddlerEvent = function(title,isDeleted,isShadow) {
|
||||
}
|
||||
// Trigger events
|
||||
this.eventListeners = this.eventListeners || {};
|
||||
if(!this.eventsTriggered) {
|
||||
var self = this;
|
||||
$tw.utils.nextTick(function() {
|
||||
var changes = self.changedTiddlers;
|
||||
self.changedTiddlers = Object.create(null);
|
||||
self.eventsTriggered = false;
|
||||
if($tw.utils.count(changes) > 0) {
|
||||
self.dispatchEvent("change",changes);
|
||||
}
|
||||
});
|
||||
this.eventsTriggered = true;
|
||||
if(!this.eventsTriggered && !this.dispatchMode) {
|
||||
$tw.utils.nextTick(this.processOutstandingTiddlerEvents.bind(this));
|
||||
}
|
||||
this.eventsTriggered = true;
|
||||
};
|
||||
|
||||
exports.processOutstandingTiddlerEvents = function() {
|
||||
var changes = this.changedTiddlers;
|
||||
this.changedTiddlers = Object.create(null);
|
||||
this.eventsTriggered = false;
|
||||
if($tw.utils.count(changes) > 0) {
|
||||
this.dispatchEvent("change",changes);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1740,7 +1749,7 @@ exports.invokeUpgraders = function(titles,tiddlers) {
|
||||
// Determine whether a plugin by title is dynamically loadable
|
||||
exports.doesPluginRequireReload = function(title) {
|
||||
var tiddler = this.getTiddler(title);
|
||||
if(tiddler && tiddler.fields.type === "application/json" && tiddler.fields["plugin-type"]) {
|
||||
if(tiddler && tiddler.isPlugin()) {
|
||||
if(tiddler.fields["plugin-type"] === "import") {
|
||||
// The import plugin never requires reloading
|
||||
return false;
|
||||
|
||||
@@ -37,7 +37,7 @@ caption: {{$:/language/Search/Standard/Caption}}
|
||||
inputCancelActions=<<cancel-search-actions>>
|
||||
inputAcceptActions=<<input-accept-actions>>
|
||||
inputAcceptVariantActions=<<input-accept-variant-actions>>
|
||||
configTiddlerFilter="[[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"
|
||||
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] :else[{$:/config/SearchResults/Default}]"
|
||||
filterMinLength={{$:/config/Search/MinLength}}/>
|
||||
</$keyboard>
|
||||
</$keyboard>
|
||||
|
||||
@@ -8,7 +8,7 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}}
|
||||
\whitespace trim
|
||||
<$set name="plugin-type" value="""$type$""">
|
||||
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
|
||||
<$list filter="[!has[draft.of]plugin-type[$type$]sort[name]]" emptyMessage=<<lingo "Empty/Hint">> template="$:/core/ui/Components/plugin-info"/>
|
||||
<$list filter="[all[tiddlers+shadows]!has[draft.of]plugin-type[$type$]!field:hidden[yes]sort[name]]" emptyMessage=<<lingo "Empty/Hint">> template="$:/core/ui/Components/plugin-info"/>
|
||||
</$set>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed/Languages
|
||||
tags: $:/tags/ControlPanel/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Languages/Caption}} (<$count filter="[!has[draft.of]plugin-type[language]]"/>)
|
||||
caption: {{$:/language/ControlPanel/Plugins/Languages/Caption}} (<$count filter="[all[tiddlers+shadows]is[plugin]!field:hidden[yes]plugin-type[language]]"/>)
|
||||
|
||||
<<plugin-table language>>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed/Plugins
|
||||
tags: $:/tags/ControlPanel/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Plugins/Caption}} (<$count filter="[!has[draft.of]plugin-type[plugin]]"/>)
|
||||
caption: {{$:/language/ControlPanel/Plugins/Plugins/Caption}} (<$count filter="[all[tiddlers+shadows]is[plugin]plugin-type[plugin]]"/>)
|
||||
|
||||
<<plugin-table plugin>>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title: $:/core/ui/ControlPanel/Plugins/Installed/Themes
|
||||
tags: $:/tags/ControlPanel/Plugins
|
||||
caption: {{$:/language/ControlPanel/Plugins/Themes/Caption}} (<$count filter="[!has[draft.of]plugin-type[theme]]"/>)
|
||||
caption: {{$:/language/ControlPanel/Plugins/Themes/Caption}} (<$count filter="[all[tiddlers+shadows]is[plugin]plugin-type[theme]]"/>)
|
||||
|
||||
<<plugin-table theme>>
|
||||
|
||||
@@ -12,7 +12,7 @@ Export the TiddlyWiki core JavaScript code for running with external JavaScript:
|
||||
tooltip="Export the TiddlyWiki core code for running with external JavaScript"
|
||||
aria-label="export TiddlyWiki core"
|
||||
class="tc-btn-big-green">
|
||||
<$action-sendmessage $message='tm-download-file' $param='$:/core/templates/tiddlywiki5.js' filename=<<jsFileName>> type="application/javascript"/>
|
||||
<$action-sendmessage $message='tm-download-file' $param='$:/core/templates/tiddlywiki5.js' filename=<<jsFileName>>/>
|
||||
{{$:/core/images/download-button}}
|
||||
<span class="tc-tiny-gap-left">
|
||||
Download TiddlyWiki core
|
||||
|
||||
@@ -12,7 +12,7 @@ element, and right-click its `src` URI. Save the link as ''$(jsFileName)$''</p>
|
||||
Export the ~TiddlyWiki core ~JavaScript code for running with external ~JavaScript:
|
||||
|
||||
<$button tooltip="Export the ~TiddlyWiki core code for running with external ~JavaScript" aria-label="export TiddlyWiki core" class="tc-btn-big-green">
|
||||
<$list filter="[[$:/boot/boot.js]is[missing]]" variable="ignore" emptyMessage="""<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/tiddlywiki5.js" filename=<<jsFileName>> type="application/javascript"/>""" >
|
||||
<$list filter="[[$:/boot/boot.js]is[missing]]" variable="ignore" emptyMessage="""<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/tiddlywiki5.js" filename=<<jsFileName>>/>""" >
|
||||
<$action-setfield $tiddler=<<qualify "$:/temp/alert">> text=<<noExportMsg>> subtitle="Export ~TiddllyWiki Core"/>
|
||||
<$action-sendmessage $message="tm-modal" $param=<<qualify "$:/temp/alert">>/>
|
||||
</$list>
|
||||
|
||||
@@ -103,7 +103,8 @@ code-body: yes
|
||||
-Description
|
||||
-Narrative
|
||||
-[[$:/temp/testcase/draft-title]]
|
||||
-[has[plugin-type]]
|
||||
-[[$:/status/RequireReloadDueToPluginChange]]
|
||||
-[[$:/core]]
|
||||
-[prefix<tf.state>]
|
||||
-[prefix[$:/state/popup/export]]
|
||||
-[prefix[$:/HistoryList]]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
title: $:/core/ui/testcases/actions/Export
|
||||
tags: $:/tags/TestCase/Actions
|
||||
|
||||
<$macrocall $name="exportButton" exportFilter="[all[tiddlers]sort[]] -[prefix[$:/state/]] -Description -Narrative -ExpectedResult -[has[plugin-type]]" lingoBase="$:/language/Buttons/ExportTiddlers/"/>
|
||||
<$macrocall $name="exportButton" exportFilter="[all[tiddlers]sort[]] -[prefix[$:/state/]] -Description -Narrative -ExpectedResult -[[$:/core]]" lingoBase="$:/language/Buttons/ExportTiddlers/"/>
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -11,9 +11,6 @@
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--rendertiddler","$:/core/save/all","classicparserdemo.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","classicparserdemo.html","text/plain"
|
||||
]
|
||||
"--rendertiddler","$:/core/save/all","classicparserdemo.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -22,9 +22,6 @@
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--rendertiddler","$:/core/save/all","codemirrordemo.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","codemirrordemo.html","text/plain"
|
||||
]
|
||||
"--rendertiddler","$:/core/save/all","codemirrordemo.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,5 @@ Note that JavaScript macros work on both the client and the server, and so do no
|
||||
|
||||
!! Macro Behaviour
|
||||
|
||||
Macros are just used to return a chunk of wikitext for further processing. They should not make modifications to tiddlers in the wiki store. The reason is that you cannot control when the macro is called; it may be called repeatedly as part of refresh processing. So it is important that macros do not have any other side effects beyond generating their text.
|
||||
Macros are just used to return a chunk of wikitext for further processing. They should not make modifications to tiddlers in the wiki store. The reason is that you cannott control when the macro is called; it may be called repeatedly as part of refresh processing. So it is important that macros do not have any other side effects beyond generating their text.
|
||||
|
||||
|
||||
@@ -34,11 +34,13 @@ Suppose we want to make a filter operator that returns every other tiddler from
|
||||
We make a new tiddler, set its `type` and `module-type` appropriately, and begin writing the code:
|
||||
|
||||
```
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
exports.everyother = function(source, operator, options) {
|
||||
// TODO
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
For the example filter syntax, our function will be called with
|
||||
@@ -52,6 +54,7 @@ As is usually the case, we don't care about `operator.operator` here (since that
|
||||
We could implement the operator by iterating over the input tiddlers and explicitly building a result array of titles:
|
||||
|
||||
```
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
exports.everyother = function(source, operator, options) {
|
||||
@@ -63,6 +66,7 @@ exports.everyother = function(source, operator, options) {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
That is, we supply a callback to `source` that negates `include` each time through (in order to grab every other result) and pushes the `title` of every other tiddler onto the result.
|
||||
@@ -70,6 +74,7 @@ That is, we supply a callback to `source` that negates `include` each time throu
|
||||
Alternatively, we can return our own iterator, by returning a function that accepts a similar callback and only calls it on every other tiddler:
|
||||
|
||||
```
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
exports.everyother = function(source, operator, options) {
|
||||
@@ -81,6 +86,7 @@ exports.everyother = function(source, operator, options) {
|
||||
});
|
||||
};
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
Either way, we could interpret the `!` flag on the filter, if present, to mean that we want the //other// half of the tiddlers, by using it to set the initial value of `include`: `var include = operator.prefix !== "!";`
|
||||
|
||||
@@ -40,7 +40,10 @@ module-type: startup
|
||||
YOUR DISCRCRIPTION COMES HERE!
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false, exports: true */
|
||||
"use strict";
|
||||
|
||||
// Export name and synchronous status
|
||||
@@ -60,4 +63,6 @@ exports.startup = function() {
|
||||
});
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
```
|
||||
@@ -11,7 +11,10 @@ The wikitext parser subclassing mechanism makes it possible for custom parsers t
|
||||
Here is an example of a subclass of the checkbox widget that adds logging to the event handler:
|
||||
|
||||
```js
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var WikiParser = require("$:/core/modules/parsers/wikiparser/wikiparser.js")["text/vnd.tiddlywiki"],
|
||||
@@ -35,4 +38,5 @@ var MyCustomWikiParser = function(type,text,options) {
|
||||
|
||||
exports["text/vnd.my-custom-type"] = MyCustomWikiParser;
|
||||
|
||||
})();
|
||||
```
|
||||
|
||||
@@ -26,7 +26,10 @@ module-type: widget-subclass
|
||||
Widget base class
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.baseClass = "checkbox"; // Extend the <$checkbox> widget
|
||||
@@ -47,4 +50,5 @@ exports.prototype.handleChangeEvent = function(event) {
|
||||
console.log("Checkbox status:",this.inputDomNode.checked);
|
||||
};
|
||||
|
||||
})();
|
||||
```
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -9,9 +9,6 @@
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","index.html","text/plain"
|
||||
]
|
||||
"--rendertiddler","$:/core/save/all","index.html","text/plain"]
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -15,9 +15,6 @@
|
||||
"build": {
|
||||
"index": [
|
||||
"--render","$:/core/save/all","index.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","index.html","text/plain"
|
||||
],
|
||||
"favicon": [],
|
||||
"static": [],
|
||||
"empty": [],
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -16,9 +16,6 @@
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","highlightdemo.html","text/plain"
|
||||
]
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -19,9 +19,6 @@
|
||||
"--screenshot",
|
||||
"[[$:/plugins/tiddlywiki/innerwiki/examples]]",
|
||||
"4"
|
||||
],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","index.html","text/plain"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -16,9 +16,6 @@
|
||||
"--render","$:/core/templates/static.template.html","static.html","text/plain",
|
||||
"--render","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
|
||||
"--render","[!is[system]]","[encodeuricomponent[]addprefix[static/]addsuffix[.html]]","text/plain","$:/core/templates/static.tiddler.html",
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","katexdemo.html","text/plain"
|
||||
]
|
||||
"--render","$:/core/templates/static.template.css","static/static.css","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -13,9 +13,6 @@
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--rendertiddler","$:/core/save/all","markdowndemo.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","markdowndemo.html","text/plain"
|
||||
]
|
||||
"--rendertiddler","$:/core/save/all","markdowndemo.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
title: Operators/Wikify/TextMode
|
||||
description: Simple wikify operator
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\parsermode inline
|
||||
<$text text={{{ [subfilter{Filter}] }}}/>
|
||||
+
|
||||
title: Filter
|
||||
|
||||
[{Text}wikify[html],[inline],[text/vnd.tiddlywiki]]
|
||||
+
|
||||
title: Text
|
||||
|
||||
This is ''the text'' that is __wikified__
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
This is <strong>the text</strong> that is <u>wikified</u>
|
||||
@@ -1,64 +0,0 @@
|
||||
title: Operators/Wikify/ParseTreeMode
|
||||
description: Simple wikify operator
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\parsermode inline
|
||||
<$text text={{{ [subfilter{Filter}] }}}/>
|
||||
+
|
||||
title: Filter
|
||||
|
||||
[{Text}wikify[parsetree],[inline],[text/vnd.tiddlywiki]]
|
||||
+
|
||||
title: Text
|
||||
|
||||
This is ''the text'' that is __wikified__
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
[
|
||||
{
|
||||
"type": "text",
|
||||
"text": "This is ",
|
||||
"start": 0,
|
||||
"end": 8
|
||||
},
|
||||
{
|
||||
"type": "element",
|
||||
"tag": "strong",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "the text",
|
||||
"start": 10,
|
||||
"end": 18
|
||||
}
|
||||
],
|
||||
"start": 8,
|
||||
"end": 20,
|
||||
"rule": "bold"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": " that is ",
|
||||
"start": 20,
|
||||
"end": 29
|
||||
},
|
||||
{
|
||||
"type": "element",
|
||||
"tag": "u",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "wikified",
|
||||
"start": 31,
|
||||
"end": 39
|
||||
}
|
||||
],
|
||||
"start": 29,
|
||||
"end": 41,
|
||||
"rule": "underscore"
|
||||
}
|
||||
]
|
||||
@@ -1,21 +0,0 @@
|
||||
title: Operators/Wikify/TextMode
|
||||
description: Simple wikify operator
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
\parsermode inline
|
||||
<$text text={{{ [subfilter{Filter}] }}}/>
|
||||
+
|
||||
title: Filter
|
||||
|
||||
[{Text}wikify[text],[inline],[text/vnd.tiddlywiki]]
|
||||
+
|
||||
title: Text
|
||||
|
||||
This is ''the text'' that is __wikified__
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
This is the text that is wikified
|
||||
@@ -0,0 +1,36 @@
|
||||
title: Plugins/DynamicJSPluginLoad
|
||||
description: Dynamic JS plugin loading
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{$:/status/RequireReloadDueToPluginChange}}
|
||||
+
|
||||
title: Actions
|
||||
|
||||
<$action-createtiddler $basetitle="$:/plugins/tiddlywiki/test-js-plugin" $template="$:/plugins/tiddlywiki/test-js-plugin/raw" type="application/json"/>
|
||||
+
|
||||
title: $:/plugins/tiddlywiki/test-js-plugin/raw
|
||||
list: readme
|
||||
name: bundled-subplugin-tests
|
||||
plugin-type: plugin
|
||||
type: text/plain
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"$:/plugins/tiddlywiki/test-js-plugin/readme": {
|
||||
"title": "$:/plugins/tiddlywiki/test-js-plugin/readme",
|
||||
"text": "Readme from $:/plugins/tiddlywiki/test-js-plugin\n\n"
|
||||
},
|
||||
"$:/plugins/tiddlywiki/test-js-plugin/js": {
|
||||
"title": "$:/plugins/tiddlywiki/test-js-plugin/js",
|
||||
"text": "2+2",
|
||||
"type": "application/javascript"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>yes</p>
|
||||
@@ -0,0 +1,47 @@
|
||||
title: Plugins/DynamicLoadLanguage
|
||||
description: Dynamically loading of language plugin
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{First}}
|
||||
+
|
||||
title: Actions
|
||||
|
||||
<$action-createtiddler $basetitle="$:/languages/fr-FR" $template="$:/languages/fr-FR/raw" type="application/json"/>
|
||||
<$action-setfield $tiddler="$:/languages/fr-FR" plugin-type="language"/>
|
||||
<$action-setfield $tiddler="$:/language" text="$:/languages/fr-FR"/>
|
||||
+
|
||||
title: $:/languages/en-GB
|
||||
list: readme
|
||||
name: en-GB
|
||||
plugin-type: language
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"First": {
|
||||
"title": "First",
|
||||
"text": "This is English"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: $:/languages/fr-FR/raw
|
||||
list: readme
|
||||
name: fr-FR
|
||||
type: plain/text
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"First": {
|
||||
"title": "First",
|
||||
"text": "This is French"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>This is French</p>
|
||||
46
editions/test/tiddlers/tests/data/plugins/Language.tid
Normal file
46
editions/test/tiddlers/tests/data/plugins/Language.tid
Normal file
@@ -0,0 +1,46 @@
|
||||
title: Plugins/Language
|
||||
description: Loading of correct language plugin at startup
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{First}}
|
||||
+
|
||||
title: $:/language
|
||||
|
||||
$:/languages/fr-FR
|
||||
+
|
||||
title: $:/languages/en-GB
|
||||
list: readme
|
||||
name: en-GB
|
||||
plugin-type: language
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"First": {
|
||||
"title": "First",
|
||||
"text": "This is English"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: $:/languages/fr-FR
|
||||
list: readme
|
||||
name: fr-FR
|
||||
plugin-type: language
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"First": {
|
||||
"title": "First",
|
||||
"text": "This is French"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>This is French</p>
|
||||
@@ -0,0 +1,57 @@
|
||||
title: Plugins/LanguageAddonSubPlugin
|
||||
description: Loading of correct language subplugin at startup
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{First}}
|
||||
|
||||
{{Second}}
|
||||
+
|
||||
title: $:/language
|
||||
|
||||
$:/languages/fr-FR-subplugin
|
||||
+
|
||||
title: $:/languages/fr-FR-container
|
||||
list: readme
|
||||
name: fr-FR
|
||||
plugin-type: plugin
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"$:/languages/fr-FR-container/readme": {
|
||||
"title": "$:/languages/fr-FR-container/readme",
|
||||
"text": "Readme from ~$:/languages/fr-FR-container\n\n"
|
||||
},
|
||||
"$:/languages/fr-FR-subplugin": {
|
||||
"title": "$:/languages/fr-FR-subplugin",
|
||||
"name": "fr-FR",
|
||||
"description": "fr-FR subplugin",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL",
|
||||
"version": "5.3.7-prerelease",
|
||||
"plugin-type": "language",
|
||||
"dependents": "",
|
||||
"type": "application/json",
|
||||
"text": "{\"tiddlers\":{\"First\":{\"title\":\"First\",\"text\":\"First from ~$:/languages/fr-FR-subplugin\"}}}"
|
||||
},
|
||||
"$:/languages/fr-FR-subplugin2": {
|
||||
"title": "$:/languages/fr-FR-subplugin2",
|
||||
"name": "fr-FR",
|
||||
"description": "fr-FR subplugin2",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL",
|
||||
"version": "5.3.7-prerelease",
|
||||
"plugin-type": "language",
|
||||
"dependents": "",
|
||||
"type": "application/json",
|
||||
"text": "{\"tiddlers\":{\"Second\":{\"title\":\"Second\",\"text\":\"Second from ~$:/languages/fr-FR-subplugin2\"}}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>First from $:/languages/fr-FR-subplugin</p><p>Second from $:/languages/fr-FR-subplugin2</p>
|
||||
@@ -0,0 +1,45 @@
|
||||
title: Plugins/LanguageSubPlugin
|
||||
description: Loading of correct language subplugin at startup
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{First}}
|
||||
|
||||
{{$:/languages/fr-FR-container/readme}}
|
||||
+
|
||||
title: $:/language
|
||||
|
||||
$:/languages/fr-FR-subplugin
|
||||
+
|
||||
title: $:/languages/fr-FR-container
|
||||
list: readme
|
||||
name: fr-FR
|
||||
plugin-type: plugin
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"$:/languages/fr-FR-container/readme": {
|
||||
"title": "$:/languages/fr-FR-container/readme",
|
||||
"text": "Readme from ~$:/languages/fr-FR-container\n\n"
|
||||
},
|
||||
"$:/languages/fr-FR-subplugin": {
|
||||
"title": "$:/languages/fr-FR-subplugin",
|
||||
"name": "fr-FR",
|
||||
"description": "fr-FR subplugin",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL",
|
||||
"version": "5.3.7-prerelease",
|
||||
"plugin-type": "language",
|
||||
"dependents": "",
|
||||
"type": "application/json",
|
||||
"text": "{\"tiddlers\":{\"First\":{\"title\":\"First\",\"text\":\"First from ~$:/languages/fr-FR-subplugin\"}}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>First from $:/languages/fr-FR-subplugin</p><p>Readme from $:/languages/fr-FR-container</p>
|
||||
@@ -0,0 +1,43 @@
|
||||
title: SubPlugins/DynamicSubPluginLoad
|
||||
description: Dynamic sub-plugin loading
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{$:/plugins/tiddlywiki/test-subplugin/readme}}
|
||||
+
|
||||
title: Actions
|
||||
|
||||
<$action-createtiddler $basetitle="$:/plugins/tiddlywiki/bundled-subplugin-tests" $template="$:/plugins/tiddlywiki/bundled-subplugin-tests/raw" type="application/json"/>
|
||||
+
|
||||
title: $:/plugins/tiddlywiki/bundled-subplugin-tests/raw
|
||||
list: readme
|
||||
name: bundled-subplugin-tests
|
||||
plugin-type: plugin
|
||||
type: text/plain
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"$:/plugins/tiddlywiki/bundled-subplugin-tests/readme": {
|
||||
"title": "$:/plugins/tiddlywiki/bundled-subplugin-tests/readme",
|
||||
"text": "Readme from $:/plugins/tiddlywiki/bundled-subplugin-tests\n\n"
|
||||
},
|
||||
"$:/plugins/tiddlywiki/test-subplugin": {
|
||||
"title": "$:/plugins/tiddlywiki/test-subplugin",
|
||||
"name": "test-subplugin",
|
||||
"description": "Test subplugin",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL",
|
||||
"version": "5.3.7-prerelease",
|
||||
"plugin-type": "plugin",
|
||||
"dependents": "",
|
||||
"type": "application/json",
|
||||
"text": "{\"tiddlers\":{\"$:/plugins/tiddlywiki/test-subplugin/readme\":{\"title\":\"$:/plugins/tiddlywiki/test-subplugin/readme\",\"text\":\"Readme from $:/plugins/tiddlywiki/test-subplugin\"},\"$:/plugins/tiddlywiki/test-subsubplugin\":{\"title\":\"$:/plugins/tiddlywiki/test-subsubplugin\",\"name\":\"test-subsubplugin\",\"description\":\"Test subsubplugin\",\"list\":\"readme readme2\",\"stability\":\"STABILITY_1_EXPERIMENTAL\",\"version\":\"5.3.7-prerelease\",\"plugin-type\":\"plugin\",\"dependents\":\"\",\"type\":\"application/json\",\"text\":\"{\\\"tiddlers\\\":{\\\"$:/plugins/tiddlywiki/test-subsubplugin/readme\\\":{\\\"title\\\":\\\"$:/plugins/tiddlywiki/test-subsubplugin/readme\\\",\\\"text\\\":\\\"Readme from $:/plugins/tiddlywiki/test-subsubplugin\\\"}}}\"}}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Readme from <a class="tc-tiddlylink tc-tiddlylink-shadow" href="#%24%3A%2Fplugins%2Ftiddlywiki%2Ftest-subplugin">$:/plugins/tiddlywiki/test-subplugin</a></p>
|
||||
@@ -0,0 +1,47 @@
|
||||
title: SubPlugins/DynamicSubPluginUnload
|
||||
description: Dynamic sub-plugin unloading
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
<$transclude $tiddler="$:/plugins/tiddlywiki/test-subplugin/readme">
|
||||
NO
|
||||
</$transclude>
|
||||
+
|
||||
title: Actions
|
||||
|
||||
<$action-deletetiddler $tiddler="$:/plugins/tiddlywiki/bundled-subplugin-tests"/>
|
||||
+
|
||||
title: $:/plugins/tiddlywiki/bundled-subplugin-tests
|
||||
list: readme
|
||||
name: bundled-subplugin-tests
|
||||
plugin-type: plugin
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": {
|
||||
"$:/plugins/tiddlywiki/bundled-subplugin-tests/readme": {
|
||||
"title": "$:/plugins/tiddlywiki/bundled-subplugin-tests/readme",
|
||||
"text": "Readme from $:/plugins/tiddlywiki/bundled-subplugin-tests\n\n"
|
||||
},
|
||||
"$:/plugins/tiddlywiki/test-subplugin": {
|
||||
"title": "$:/plugins/tiddlywiki/test-subplugin",
|
||||
"name": "test-subplugin",
|
||||
"description": "Test subplugin",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL",
|
||||
"version": "5.3.7-prerelease",
|
||||
"plugin-type": "plugin",
|
||||
"dependents": "",
|
||||
"type": "application/json",
|
||||
"text": "{\"tiddlers\":{\"$:/plugins/tiddlywiki/test-subplugin/readme\":{\"title\":\"$:/plugins/tiddlywiki/test-subplugin/readme\",\"text\":\"Readme from $:/plugins/tiddlywiki/test-subplugin\"},\"$:/plugins/tiddlywiki/test-subsubplugin\":{\"title\":\"$:/plugins/tiddlywiki/test-subsubplugin\",\"name\":\"test-subsubplugin\",\"description\":\"Test subsubplugin\",\"list\":\"readme readme2\",\"stability\":\"STABILITY_1_EXPERIMENTAL\",\"version\":\"5.3.7-prerelease\",\"plugin-type\":\"plugin\",\"dependents\":\"\",\"type\":\"application/json\",\"text\":\"{\\\"tiddlers\\\":{\\\"$:/plugins/tiddlywiki/test-subsubplugin/readme\\\":{\\\"title\\\":\\\"$:/plugins/tiddlywiki/test-subsubplugin/readme\\\",\\\"text\\\":\\\"Readme from $:/plugins/tiddlywiki/test-subsubplugin\\\"}}}\"}}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>
|
||||
NO
|
||||
</p>
|
||||
@@ -0,0 +1,21 @@
|
||||
title: SubPlugins/SimpleSubPlugin
|
||||
description: Simple sub-plugin
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
title: Output
|
||||
|
||||
{{$:/plugins/tiddlywiki/test-subplugin/readme}}
|
||||
|
||||
+
|
||||
title: $:/plugins/tiddlywiki/bundled-subplugin-tests
|
||||
list: readme
|
||||
name: bundled-subplugin-tests
|
||||
plugin-type: plugin
|
||||
type: application/json
|
||||
|
||||
{"tiddlers":{"$:/plugins/tiddlywiki/bundled-subplugin-tests/readme":{"title":"$:/plugins/tiddlywiki/bundled-subplugin-tests/readme","text":"Readme from $:/plugins/tiddlywiki/bundled-subplugin-tests\n\n"},"$:/plugins/tiddlywiki/test-subplugin":{"title":"$:/plugins/tiddlywiki/test-subplugin","name":"test-subplugin","description":"Test subplugin","list":"readme","stability":"STABILITY_1_EXPERIMENTAL","version":"5.3.7-prerelease","plugin-type":"plugin","dependents":"","type":"application/json","text":"{\"tiddlers\":{\"$:/plugins/tiddlywiki/test-subplugin/readme\":{\"title\":\"$:/plugins/tiddlywiki/test-subplugin/readme\",\"text\":\"Readme from $:/plugins/tiddlywiki/test-subplugin\"},\"$:/plugins/tiddlywiki/test-subsubplugin\":{\"title\":\"$:/plugins/tiddlywiki/test-subsubplugin\",\"name\":\"test-subsubplugin\",\"description\":\"Test subsubplugin\",\"list\":\"readme readme2\",\"stability\":\"STABILITY_1_EXPERIMENTAL\",\"version\":\"5.3.7-prerelease\",\"plugin-type\":\"plugin\",\"dependents\":\"\",\"type\":\"application/json\",\"text\":\"{\\\"tiddlers\\\":{\\\"$:/plugins/tiddlywiki/test-subsubplugin/readme\\\":{\\\"title\\\":\\\"$:/plugins/tiddlywiki/test-subsubplugin/readme\\\",\\\"text\\\":\\\"Readme from $:/plugins/tiddlywiki/test-subsubplugin\\\"}}}\"}}}"}}}
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p>Readme from <a class="tc-tiddlylink tc-tiddlylink-shadow" href="#%24%3A%2Fplugins%2Ftiddlywiki%2Ftest-subplugin">$:/plugins/tiddlywiki/test-subplugin</a></p>
|
||||
@@ -6,6 +6,12 @@ tags: [[$:/tags/test-spec]]
|
||||
Tests <$action-deletefield />.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/* jslint node: true, browser: true */
|
||||
/* eslint-env node, browser, jasmine */
|
||||
/* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
|
||||
/* global $tw, require */
|
||||
"use strict";
|
||||
|
||||
describe("<$action-deletefield /> tests", function() {
|
||||
@@ -166,3 +172,5 @@ it("should correctly delete fields", function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,6 +6,7 @@ tags: [[$:/tags/test-spec]]
|
||||
Tests the fakedom that Tiddlywiki occasionally uses.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
describe("fakedom tests", function() {
|
||||
@@ -19,3 +20,5 @@ describe("fakedom tests", function() {
|
||||
expect($tw.fakeDocument.createTextNode("text").TEXT_NODE).toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,6 +6,7 @@ tags: [[$:/tags/test-spec]]
|
||||
Tests for integrity of the core plugins, languages, themes and editions
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
if($tw.node) {
|
||||
@@ -46,3 +47,6 @@ if($tw.node) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})();
|
||||
|
||||
@@ -3,7 +3,10 @@ title: test-widget-event.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-spec]]
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
describe("Widget Event Listeners", function() {
|
||||
@@ -217,3 +220,5 @@ describe("Widget Event Listeners", function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -6,6 +6,7 @@ tags: [[$:/tags/test-spec]]
|
||||
Tests the wikitext rendering pipeline end-to-end. We also need tests that individually test parsers, rendertreenodes etc., but this gets us started.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
describe("Widget module", function() {
|
||||
@@ -88,3 +89,4 @@ describe("Widget module", function() {
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -116,22 +116,6 @@ describe("WikiText parser tests", function() {
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse macro definitions with end statements followed by spaces", function() {
|
||||
expect(parse("\\define myMacro()\nnothing\n\\end \n")).toEqual(
|
||||
|
||||
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"isMacroDefinition":true,"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"start":0,"end":33,"rule":"macrodef"}]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse macro definitions with named end statements followed by spaces", function() {
|
||||
expect(parse("\\define myMacro()\nnothing\n\\end myMacro \n")).toEqual(
|
||||
|
||||
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"isMacroDefinition":true,"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"start":0,"end":40,"rule":"macrodef"}]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse procedure definitions with no parameters", function() {
|
||||
expect(parse("\\procedure myMacro()\nnothing\n\\end\n")).toEqual(
|
||||
|
||||
@@ -148,22 +132,6 @@ describe("WikiText parser tests", function() {
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse procedure definitions with end statements followed by spaces", function() {
|
||||
expect(parse("\\procedure myMacro()\nnothing\n\\end \n")).toEqual(
|
||||
|
||||
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true,"start":0,"end":36,"rule":"fnprocdef"}]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse procedure definitions with named end statements followed by spaces", function() {
|
||||
expect(parse("\\procedure myMacro()\nnothing\n\\end myMacro \n")).toEqual(
|
||||
|
||||
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isProcedureDefinition":true,"start":0,"end":43,"rule":"fnprocdef"}]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse procedure definitions with parameters", function() {
|
||||
expect(parse("\\procedure myMacro(one,two,three,four:elephant)\nnothing\n\\end\n")).toEqual(
|
||||
|
||||
@@ -187,22 +155,6 @@ describe("WikiText parser tests", function() {
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse function definitions with end statements followed by spaces", function() {
|
||||
expect(parse("\\function myMacro()\nnothing\n\\end \n")).toEqual(
|
||||
|
||||
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true,"start":0,"end":35,"rule":"fnprocdef"}]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse function definitions with named end statements followed by spaces", function() {
|
||||
expect(parse("\\function myMacro()\nnothing\n\\end myMacro \n")).toEqual(
|
||||
|
||||
[{"type":"set","attributes":{"name":{"name":"name","type":"string","value":"myMacro"},"value":{"name":"value","type":"string","value":"nothing"}},"children":[],"params":[],"orderedAttributes":[{"name":"name","type":"string","value":"myMacro"},{"name":"value","type":"string","value":"nothing"}],"isFunctionDefinition":true,"start":0,"end":42,"rule":"fnprocdef"}]
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse single line function definitions with no parameters", function() {
|
||||
expect(parse("\\function myMacro() nothing\n")).toEqual(
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -13,9 +13,6 @@
|
||||
"build": {
|
||||
"index": [
|
||||
"--rendertiddler","$:/core/save/all","index.html","text/plain"
|
||||
],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","index.html","text/plain"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -10,9 +10,6 @@
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--render","$:/core/save/all","index.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","index.html","text/plain"
|
||||
]
|
||||
"--render","$:/core/save/all","index.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
created: 20250211092107689
|
||||
modified: 20250211092307574
|
||||
tags: Definitions
|
||||
title: HTML Tags
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<<
|
||||
In HTML, a tag is used for creating an element.
|
||||
|
||||
The name of an HTML element is the name that appears at the beginning of the element's start tag and at the end of the element's end tag (if the element has an end tag). For example, the p in the `<p>` start tag and `</p>` end tag is the name of the HTML paragraph element. Note that an element name in an end tag is preceded by a slash character: `</p>`, and that for void elements, the end tag is neither required nor allowed.
|
||||
<<< https://developer.mozilla.org/en-US/docs/Glossary/Tag
|
||||
@@ -1,13 +1,20 @@
|
||||
title: 中文社区 - Chinese Community
|
||||
tags: Community
|
||||
|
||||
* 大家可以一起编辑的中文社区教程项目:
|
||||
*# 主站:[ext[https://tw-cn.netlify.app/]]
|
||||
*# 加速访问:[ext[https://tw-cn.cpolar.top/]]
|
||||
*# 备用:[ext[https://tiddly-wiki-chinese-tutorial.vercel.app]]
|
||||
* 太微中文交流论坛:[ext[https://talk.tidgi.fun/topic/6]]
|
||||
* 太微官网汉化版:[ext[https://bramchen.github.io/tw5-docs/zh-Hans/]]
|
||||
* 最适合新手的中文入门教程:[ext[https://keatonlao.github.io/tiddlywiki-xp/]]
|
||||
* TiddlyWiki 爱好者 QQ 群: 946052860
|
||||
*# [ext[点击链接加入群聊【TiddlyWiki爱好者】|https://qm.qq.com/q/13SFxVArlu]]
|
||||
*# [ext[点击链接加入腾讯频道【太微TiddlyWiki】|https://pd.qq.com/s/474hgpll1]]
|
||||
# A Chinese community tutorial program that people can edit together:
|
||||
#* Main site: [ext[https://tw-cn.netlify.app/]]
|
||||
#* Accelerated access: [ext[https://tw-cn.cpolar.top/]]
|
||||
#* Alternate: [ext[https://tiddly-wiki-chinese-tutorial.vercel.app]]
|
||||
# Tiddlywiki Chinese Chat Forum: [ext[https://talk.tidgi.fun/topic/6]]
|
||||
# Chinese translation of Tiddlywiki official website [ext[https://bramchen.github.io/tw5-docs/zh-Hans/]]
|
||||
# The best Chinese introductory tutorial for newbies [ext[https://keatonlao.github.io/tiddlywiki-xp/]]
|
||||
|
||||
---
|
||||
|
||||
# 大家可以一起编辑的中文社区教程项目:
|
||||
#* 主站:[ext[https://tw-cn.netlify.app/]]
|
||||
#* 加速访问:[ext[https://tw-cn.cpolar.top/]]
|
||||
#* 备用:[ext[https://tiddly-wiki-chinese-tutorial.vercel.app]]
|
||||
# 太微中文交流论坛:[ext[https://talk.tidgi.fun/topic/6]]
|
||||
# 太微官网汉化版:[ext[https://bramchen.github.io/tw5-docs/zh-Hans/]]
|
||||
# 最适合新手的中文入门教程:[ext[https://keatonlao.github.io/tiddlywiki-xp/]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
breadcrumbs: [[Filter Step]]
|
||||
created: 20140410103123179
|
||||
modified: 20250302200615061
|
||||
modified: 20230410114132501
|
||||
tags: Filters
|
||||
title: Filter Operators
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -21,7 +21,7 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
A <<.def "filter operator">> is a predefined keyword attached to an individual step of a [[filter|Filters]]. It defines the particular action of that step.
|
||||
|
||||
<<.tip """In general, each first [[filter step|Filter Step]] of a [[filter run|Filter Run]] not given any input titles receives the output of <$link to="all Operator">''[all[tiddlers]]''</$link> as its input.""" title:"Important">>
|
||||
''Important:'' In general, each first [[filter step|Filter Step]] of a [[filter run|Filter Run]] not given any input titles receives the output of <$link to="all Operator">[all[tiddlers]]</$link> as its input.
|
||||
|
||||
|
||||
''Table legend:''
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20180111122953142
|
||||
modified: 20181113084151268
|
||||
tags: OfficialPlugins [[Plugin Editions]]
|
||||
tags: OfficialPlugins
|
||||
title: Dynaview Plugin
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
created: 20250302053159467
|
||||
modified: 20250302053316068
|
||||
tags: OfficialPlugins [[Plugin Editions]]
|
||||
title: Geospatial Plugin
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The Geospatial Plugin adds new primitives to the TiddlyWiki platform to enable non-developers to build sophisticated interactive geospatial applications.
|
||||
|
||||
It incorporates a number of third party libraries and online services:
|
||||
|
||||
* [[Leaflet.js|https://leafletjs.com/]], an open source library to display interactive maps
|
||||
* [[Turf.js|https://turfjs.org/]], an open source library to perform geospatial calculations with [[GeoJSON|https://en.wikipedia.org/wiki/GeoJSON]] objects
|
||||
* [[TravelTime|https://traveltime.com/]], a commercial API for [[geocoding|https://traveltime.com/features/geocoding]], [[routing|https://traveltime.com/features/multi-modal-routing]] and [[isochrones|https://traveltime.com/features/isochrones]]
|
||||
* [[Flickr|https://www.flickr.com/services/api/]], a free API for retrieving geotagged photographs
|
||||
* [[OpenLocationCode|https://github.com/google/open-location-code]], Google's open source library for converting to and from Open Location Codes (also known as [[PlusCodes|https://maps.google.com/pluscodes/]])
|
||||
|
||||
Try it out at https://tiddlywiki.com/plugins/tiddlywiki/geospatial/
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20190127104143725
|
||||
modified: 20190127104143725
|
||||
tags: OfficialPlugins [[Plugin Editions]]
|
||||
tags: OfficialPlugins
|
||||
title: Innerwiki Plugin
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
created: 20201228143125000
|
||||
modified: 20250302051857380
|
||||
tags: OfficialPlugins [[Plugin Editions]]
|
||||
modified: 20201228143125000
|
||||
tags: OfficialPlugins
|
||||
title: Share Plugin
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -10,5 +10,3 @@ This experimental plugin provides tools to share tiddlers via URLs, comprising:
|
||||
|
||||
* The ability to load a group of tiddlers from the browser location hash at startup
|
||||
* Wizard and templates to create URLs from group of tiddlers
|
||||
|
||||
See the demo at [ext[https://tiddlywiki.com/share|share]]
|
||||
@@ -1,9 +0,0 @@
|
||||
created: 20250302052635425
|
||||
modified: 20250302052905312
|
||||
tags: OfficialPlugins [[Plugin Editions]]
|
||||
title: Tour Plugin
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The tour plugin allows interactive learning tours to be created and presented in TiddlyWiki.
|
||||
|
||||
The demo TiddlyWiki interactive tour can be seen at https://tiddlywiki.com/tour
|
||||
@@ -48,6 +48,6 @@ $caption$
|
||||
<<special-button>>
|
||||
""">>
|
||||
|
||||
<<.warning """If macros are nested, textual substitution will only occur for the outermost macro. This is because by the time the inner macros are processed all the substitutions will have already occurred""">>
|
||||
<<.warning """If macros are nested, textual substitution will only occur for the outermost macro. Thi is because by the time the inner macros are processed all the substitutions will have already occurred""">>
|
||||
|
||||
A more formal [[presentation|Macro Definition Syntax]] of this syntax is also available.
|
||||
|
||||
@@ -14,8 +14,13 @@ Planned features include:
|
||||
* 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 does require basic knowledge of the command line and Node.js but is designed to be as simple as possible to setup and use. A few simple commands are all that is needed to complete the installation and start the server.
|
||||
MWS does require basic knowledge of the command line and Node.js but is designed to be as simple as possible to setup and use. Once downloaded, just two commands are needed to complete the installation and start the server:
|
||||
|
||||
MWS is currently under development at ~GitHub but it is already functional and usable:
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
https://github.com/TiddlyWiki/MultiWikiServer/
|
||||
MWS is currently [[under development at GitHub|https://github.com/TiddlyWiki/TiddlyWiki5/pull/7915]] but it is already functional and usable. Visit the MWS website for more information:
|
||||
|
||||
! https://mws.tiddlywiki.com/
|
||||
@@ -1,6 +1,6 @@
|
||||
caption: action-setfield
|
||||
created: 20141025120850184
|
||||
modified: 20250322010115457
|
||||
modified: 20150806171403798
|
||||
tags: Widgets ActionWidgets
|
||||
title: ActionSetFieldWidget
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -66,10 +66,3 @@ src='<$button>
|
||||
<$action-navigate $to="$:/ControlPanel"/>
|
||||
Go to Control Panel "Appearance" tab
|
||||
</$button>'/>
|
||||
|
||||
Here is an example of a button that will update the value of an existing field in a tiddler
|
||||
<$macrocall $name='wikitext-example-without-html'
|
||||
src='<$button>
|
||||
<$action-setfield $tiddler="Test" existing_field_name="new field value"/>
|
||||
Update Field existing_field_name in tiddler Test
|
||||
</$button>'/>
|
||||
@@ -1,7 +1,7 @@
|
||||
caption: reveal
|
||||
created: 20131024141900000
|
||||
jeremy: tiddlywiki
|
||||
modified: 20250211091937860
|
||||
modified: 20240721175716320
|
||||
tags: Widgets
|
||||
title: RevealWidget
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -28,7 +28,7 @@ The content of the `<$reveal>` widget is displayed according to the rules given
|
||||
|stateTitle |A title containing the state, ''without'' TextReference. Gets preferred over the <<.attr state>> attribute |
|
||||
|stateField |A ''field name'' which is used to look for the state, if the attribute <<.attr stateTitle>> is present |
|
||||
|stateIndex |An ''index'' which is used to look for the state, if the attribute <<.attr stateTitle>> is present |
|
||||
|tag |Overrides the default [[HTML Tags]] (`<div>` in block mode or `<span>` in inline mode) |
|
||||
|tag |Overrides the default HTML element tag (`<div>` in block mode or `<span>` in inline mode) |
|
||||
|type |The type of matching performed: ''match'', ''nomatch'', ''popup'', ''lt'', ''gt'', ''lteq'' or ''gteq'' |
|
||||
|text |The text to match when the type is ''match'', ''nomatch'', ''lt'', ''gt'', ''lteq'' or ''gteq'' |
|
||||
|class |An optional CSS class name to be assigned to the HTML element<br/>» Set to `tc-popup-keep` to make a popup "sticky", so it won't close when you click inside of it|
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
"description": "Documentation from https://tiddlywiki.com",
|
||||
"plugins": [
|
||||
"tiddlywiki/browser-sniff",
|
||||
"tiddlywiki/confetti",
|
||||
"tiddlywiki/dynannotate",
|
||||
"tiddlywiki/railroad",
|
||||
"tiddlywiki/internals",
|
||||
"tiddlywiki/menubar",
|
||||
"tiddlywiki/railroad",
|
||||
"tiddlywiki/tour"
|
||||
"tiddlywiki/confetti",
|
||||
"tiddlywiki/dynannotate",
|
||||
"tiddlywiki/tour",
|
||||
"tiddlywiki/codemirror",
|
||||
"tiddlywiki/bundled-subplugin-tests"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
@@ -21,6 +23,7 @@
|
||||
"tiddlywiki/readonly"
|
||||
],
|
||||
"languages": [
|
||||
"fr-FR"
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
title: $:/coreURL
|
||||
tags: $:/tags/Global
|
||||
|
||||
\function coreURL() [[../../tiddlywikicore-$(version)$.js]substitute[]]
|
||||
@@ -12,9 +12,6 @@
|
||||
],
|
||||
"build": {
|
||||
"index": [
|
||||
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
|
||||
"external": [
|
||||
"--render","$:/core/save/all-external-js","index.html","text/plain"
|
||||
]
|
||||
"--rendertiddler","$:/core/save/all","index.html","text/plain"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,9 +609,3 @@ J. Ryan Stinnett, @jryans, 2025/01/04
|
||||
Galen Huntington, @galenhuntington, 2025/01/19
|
||||
|
||||
@Rhys-T, 2025/01/23
|
||||
|
||||
@Rumman157, 2025/03/17
|
||||
|
||||
@bob.jansen@cultconv.com, 2025/03/22
|
||||
|
||||
Matthew Salmon, @matthewsalmon, 2025/04/24
|
||||
|
||||
7
plugins/tiddlywiki/bundled-subplugin-tests/plugin.info
Normal file
7
plugins/tiddlywiki/bundled-subplugin-tests/plugin.info
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"title": "$:/plugins/tiddlywiki/bundled-subplugin-tests",
|
||||
"name": "bundled-subplugin-tests",
|
||||
"description": "Bundled subplugin tests",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL"
|
||||
}
|
||||
4
plugins/tiddlywiki/bundled-subplugin-tests/readme.tid
Normal file
4
plugins/tiddlywiki/bundled-subplugin-tests/readme.tid
Normal file
@@ -0,0 +1,4 @@
|
||||
title: $:/plugins/tiddlywiki/bundled-subplugin-tests/readme
|
||||
|
||||
Readme from $:/plugins/tiddlywiki/bundled-subplugin-tests
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"title": "$:/plugins/tiddlywiki/test-subplugin",
|
||||
"name": "test-subplugin",
|
||||
"description": "Test subplugin",
|
||||
"list": "readme",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tiddlywiki/test-subplugin/readme
|
||||
|
||||
Readme from $:/plugins/tiddlywiki/test-subplugin
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"title": "$:/plugins/tiddlywiki/test-subsubplugin",
|
||||
"name": "test-subsubplugin",
|
||||
"description": "Test subsubplugin",
|
||||
"list": "readme readme2",
|
||||
"stability": "STABILITY_1_EXPERIMENTAL"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tiddlywiki/test-subsubplugin/readme
|
||||
|
||||
Readme from $:/plugins/tiddlywiki/test-subsubplugin
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user