Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getIndex filter #1452

Merged
merged 5 commits into from
Feb 7, 2015
Merged

getIndex filter #1452

merged 5 commits into from
Feb 7, 2015

Conversation

tobibeer
Copy link
Contributor

@tobibeer tobibeer commented Feb 3, 2015

As discussed at #1375, respectively #1375 (comment), for a data tiddler, returns the value at the index specified in the operand.

<$list filter="[[SomeData]getindex[someIndex]]"/>

demo: http://tbdemo.tiddlyspot.com/#Index%20Filter

Is `wiki.parseTextReference()` the appropriate way?
@@ -0,0 +1,32 @@
/*\
title: $:/core/modules/filters/getIndex.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's inconsistent to use "getIndex"; all the other two word filters just concatenate lower case words (eg, "removeprefix", "moduletypes"). The filename needs changing too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, changed

* renamed to all lowercase
* added documentation
* added examples
@Jermolene
Copy link
Member

Looks good - @aelocson are the docs changes OK?

@tobibeer
Copy link
Contributor Author

tobibeer commented Feb 4, 2015

code, docs and demo updated as suggested

@Jermolene
Copy link
Member

Thanks @tobibeer

Jermolene added a commit that referenced this pull request Feb 7, 2015
@Jermolene Jermolene merged commit 68930f3 into TiddlyWiki:master Feb 7, 2015
@tobibeer tobibeer deleted the getIndex-filter branch February 7, 2015 11:58
@BramChen
Copy link
Contributor

BramChen commented Feb 8, 2015

exports.getIndex = function(source,operator,options) {
...
};

It should be getindex.

@tobibeer
Copy link
Contributor Author

tobibeer commented Feb 8, 2015

@BramChen, thanks for being watchful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants