1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-29 00:33:15 +00:00
Commit Graph

108 Commits

Author SHA1 Message Date
yaisog
3605543078
Add docs and examples for the new operators (#7328)
* Create makepatches Operator.tid

* Improve wording

* Doc and examples for the new operators
2023-03-04 21:15:40 +00:00
Jeremy Ruston
35b9faaa89
JSON Filter Operators (Revised Attempt) (#6936)
* First commit

Cherry-picked from #6666

* Adjust release version number

Just in case we decide to make a release before we merge #6666
2022-09-02 18:15:45 +01:00
Robin Munn
18d8173dcc
New insertafter filter operator (#6771)
* Implement insertafter operator (like insertbefore)

Currently, the behavior of insertafter if the target is not found is to
append the inserted tiddler to the end of the list, like insertbefore
does. In the next commit, we'll add a suffix to customize what both
insertafter and insertbefore do when the target is not found.

* Add failing tests for insertafter suffixes

Also includes tests for insertbefore suffixes (start/end), since we'll
be implementing both of those at the same time.

* Add start/end suffixes for insertafter/before

The tests that exercise the start/end suffixes now pass.
2022-07-13 17:08:17 +01:00
jeremy@jermolene.com
8301fb8699 Merge branch 'tiddlywiki-com' 2022-03-22 21:59:12 +00:00
TW Videos
71df5162ba
Improve the docs for the sortan operator (#6495) 2022-03-02 17:40:23 +00:00
Ben Webber
2c38c8351b
Make butlast[0] consistent with rest (#6483)
butlast[0] now returns the input list unchanged.

Fixes: #5833
2022-02-26 09:42:24 +00:00
Ben Webber
a51191d334
Support specifying insertbefore position title as parameter (#6477)
* Support specifying insertbefore position title as parameter

Closes: #6133

* Update insertbefore calls with new variable parameter syntax

See-also: 96b52606a (Support specifying insertbefore position title as parameter, 2022-02-21)
2022-02-24 11:08:06 +00:00
Ben Webber
95bd694a65
Support case insensitive matching in prefix/suffix operators (#6468)
* Support case insensitive matching in prefix/suffix operators

Support `caseinsensitive`/`caseinsensitive` suffixes in the following
filter operators:

  * prefix
  * suffix
  * removeprefix
  * removesuffix

The suffixes have the same behaviour as in the match operator.

Closes: #6407

* Do not filter titles if suffix/removesuffix operand is empty

Issue: #6407
2022-02-22 16:38:40 +00:00
Mario Pietsch
6b4e5c74ad
Add "some" flag to search operator (#6293) 2022-02-21 15:05:34 +00:00
Joshua Fontany
1d0af90ba2
Extend lookup operator to work with fields and indexes (#5742)
* extend lookup op flexibility with 2 parameters

* bumped .from macro to .24

* aligned syntax

* lookup fixes

* bugfix

* docs

* messed up the tests somehow

* docs fix

* lookup bugfix

* docs

* docs

* call self.displayError

* Revert "call self.displayError"

This reverts commit 5d599aa979.

* storylist

* tests

* tests pass
2022-02-21 09:48:29 +00:00
jeremy@jermolene.com
05606f72ad Merge branch 'tiddlywiki-com' 2021-11-24 10:07:17 +00:00
Marxsal
f828a582c3
Adding tags for file paths (#6240) 2021-11-18 08:45:20 +00:00
jeremy@jermolene.com
2475e1b501 Merge branch 'tiddlywiki-com' 2021-11-04 20:34:01 +00:00
Saq Imtiaz
b6ce353a7d
Fix: resolved search-replace operator regexp encoding bug (#6162)
* fix: resolved search-replace operator bug with $ character in replacement strings, added test and more examples

* fix: reset regexp after each title
2021-11-01 13:24:30 +00:00
btheado
daa9a8ae45
Add subfilter operator examples and mention when it is a constructor (#6155) 2021-10-31 10:36:03 +00:00
btheado
d9eb5499a3
Ensure the operator examples have unique id (#6153)
The first parameter of the operator examples macro is used for
constructing unique state tiddler titles. The cycle, log, and
match operators had duplicates, causing examples to share state
with each other.
2021-10-30 15:54:57 +01:00
Saq Imtiaz
4f65953da9
Added zero based zth[] operator and documentation (#6150) 2021-10-30 09:52:38 +01:00
Telumire
2f133a08aa
Add documentation and examples for the trigonometric filter operators (#6131)
* Added missing trigonometrics filter operators

This PR adds support to trigonometry operators, allowing to create spider graphs and other geometric shapes with filters.

* Adds the missing trigonometric filter operators

This PR adds support to the missing trigonometric filter operators (cos, sin, tan, acos, asin, atan, atan2), allowing to create spider graphs, [pie charts, donut charts, polar charts](https://ffoodd.github.io/chaarts/pie-charts.html) and other geometric shapes with filters, which was previously not possible without add-ons.

Example :

`[[2]cos[]] = -0.4161468365471424`

See also this radar chart made in wikitext by @saqimtiaz using the new trigonometric operators :
https://saqimtiaz.github.io/sq-tw/temp/radar-chart-demo.html

* Add documentation for the Trigonometric Operators 

Accompanies code changes #6127

* Fix formatting of atan2 Operator.tid

Removed two empty lines at the end of the tiddler

* Add examples for the trigonometric operators 

Accompanies code changes Jermolene#6127

* Fix version in the doc for trigonometric operators

This PR fix the content of the documentation tiddlers regarding trigonometric operators (#6131). 

<<.from-version "5.1.20">> was changed to <<.from-version "5.1.21">>

* Fix formatting of atan2 Operator.tid

Removed two empty lines at the end of the tiddler
2021-10-22 11:35:47 +01:00
Saq Imtiaz
ef2aeac7de
Added modulesproperty filter operator and extended modules operator (#6055)
* Added modulesproperty filter operator and extended modules operator. Docs included

* Removed spurious new line
2021-09-20 08:25:53 +01:00
Simon Huber
c13f04d838
Add m flag for multiline matches to search-replace filter operator (#5968)
* add m flag to search-replace operator and add tests

* update documentation

* Update test-filters.js

* Update test-filters.js

* Update search-replace Operator (Examples).tid

* Fix "Hello There" title (HelloThere)
2021-08-29 17:44:34 +01:00
jeremy@jermolene.com
53c247b9a1 Merge branch 'tiddlywiki-com' 2021-07-27 19:30:44 +01:00
jeremy@jermolene.com
83ee363cb4 Add charcode operator to make it easier to generate strings containing control characters
Avoids some confusing hacks. @saqimtiaz I'm guessing you might have already done something like this?
2021-06-22 21:52:00 +01:00
jeremy@jermolene.com
082aeb92ac Revert "extend lookup op flexibility with 2 parameters (#5315)"
This reverts commit 81b5fe944a.

See https://github.com/Jermolene/TiddlyWiki5/pull/5315#issuecomment-848725198 for explanation
2021-05-26 13:25:19 +01:00
Saq Imtiaz
7a41283c6b
Format:titlelist operator (#5665) 2021-05-24 19:28:43 +01:00
Saq Imtiaz
10b20657cc
Deserializers[] filter operator (#5673) 2021-05-22 10:50:11 +01:00
Joshua Fontany
81b5fe944a
extend lookup op flexibility with 2 parameters (#5315) 2021-05-21 10:11:23 +01:00
Chris Nicoll
41200ab6d7
Fix #5310: docs for unique[] filter operator (#5651)
Co-authored-by: clutterstack <clutterstack@gmail.com>
2021-04-29 13:14:28 +01:00
Jeremy Ruston
bf773eb39a
Add "average" filter operator for arithmetic mean (#5612) 2021-04-27 10:09:13 +01:00
Robin Munn
f60d0ef109
reduce and :reduce handle empty input identically (#5255)
Fixes #5246. Now the reduce operator and :reduce filter run prefix will
both return empty output when their input is empty, so that both can be
chained together with the else operator or :else prefix.
2020-12-11 10:07:52 +00:00
Saq Imtiaz
8799911162
Reduce operator: second optional parameter instead of suffix (#5193)
* Tweak reduce operator to use an optional second parameter instead of a suffix

* Updated docs
2020-12-04 18:31:23 +00:00
Robin Munn
8ffe138942
Add rawunicode suffix to (json)stringify operators (#5191)
Default with no suffix is pre-5.1.23 behavior, escaping all Unicode
characters for maximum compatibility (avoids encoding issues). New
"rawunicode" suffix allows passing through Unicode characters U+0080
and up unchanged, for cases where you know your tools are handling
encoding correctly and you want less verbose escaping.
2020-12-04 13:19:59 +00:00
Robin Munn
fd3e77d38f
"dedupe" and "raw" suffixes for enlist-input operator (#5152)
Includes unit tests.
2020-11-30 17:52:46 +00:00
saqimtiaz
8fc6910c03
Added string operator pad[] along with tests and docs (#5146) 2020-11-30 17:43:50 +00:00
saqimtiaz
4f07539164
Cycle operator improvements plus docs (#5069)
* Tweak cycle operator to support step size parameter and add docs for toggle and cycle

* Mention that title list should have no duplicates
2020-11-20 18:37:23 +00:00
saqimtiaz
89541edcff
Added mathematics filter operators power and log (#5080) 2020-11-20 14:00:20 +00:00
saqimtiaz
1a8c6fdc4b
Docs: Added example of how to remove stop words (#5066)
* Added example of how to remove stop words

* Moved filter operator example tiddlers to correct folder
2020-11-18 15:56:38 +00:00
Robin Munn
e72d90c227
More examples for enlist-input operator (#4968)
The examples should also show what would happen without the operator, to
give a better feel for why it's useful.
2020-11-08 11:47:15 +00:00
saqimtiaz
70561bd481
Added docs for enlist-input filter operator (#4966) 2020-11-02 22:50:22 +00:00
Robin Munn
cae32d39a5
Improve documentation for reduce operator (#4936) 2020-10-29 13:00:49 +00:00
saqimtiaz
adf0c1a12a
Documentation for format filter operator (#4895)
* Documentation for format operator

* Examples for format operator
2020-10-23 16:25:05 +01:00
jeremy@jermolene.com
14a28b7779 Add "reduce" and "filter" operators 2020-10-06 19:20:03 +01:00
jeremy@jermolene.com
0027b990e4 Move tw5.com docs tiddlers to the correct folders 2020-10-04 17:36:08 +01:00
Robin Munn
5202441769
Add suffix and parameter to trim operator (#4811)
* Add suffix and parameter to trim operator

Fixes #4809

* Unit tests for new trim operator parameters

* Mention trim operator in 5.1.23 release notes

* Address review comments

* Move regex escaping into utils.js trim functions

This way the trimPrefix and trimSuffix functions from utils.js are safe
to call without regex-escaping their parameters, which should make them
easier to use from other parts of the Javascript code.
2020-08-29 12:27:58 +01:00
jeremy@jermolene.com
918e52b37b Merge branch 'tiddlywiki-com' 2020-08-28 15:25:47 +01:00
twMat
05de5b4c49
Update fixed Operator (examples).tid (#4763)
To clarify it zero pads.
2020-08-27 15:47:05 +01:00
jeremy@jermolene.com
619c0752bd Add new sortsub operator 2020-04-25 11:26:19 +01:00
Mario Pietsch
de5b0062b5
Add new parameters to fields-widget and fields-operator. (#4433)
* add a new-line before the log text to increase readability of the test output

* make eslint, jslint happy

* extend fields-widget with include/exclude/sort/reverse and fields-filter with include and exclude params plus DOCS

* remove new-line

* remove eslint settings

* restore old eslint settings

* remove typo
2020-04-15 12:36:48 +01:00
Joshua Fontany
69c8058b72
Add has:index (#4540)
* has:index

* has:index

* has:index docs

* has op examples

* has op examples

* operator macros typo missing </div>

* possible mistake
2020-04-14 16:52:56 +01:00
Jeremy Ruston
7b53f5724c Add new compare filter operator
Fixes #4554
2020-04-13 10:03:01 +01:00
TonyM
8145caa104 Add a new example that shows using all before to determine the nummeric position of a title in a list. (#4412)
See discussion https://groups.google.com/forum/?hl=en#!topic/tiddlywiki/wY6haW2cYMA
2020-01-14 16:55:53 +00:00