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

Add example for the function operator #8793

Conversation

DesignThinkerer
Copy link
Contributor

@DesignThinkerer DesignThinkerer commented Dec 2, 2024

This PR add an example showing how to use the function operator to examine changes made on shadow tiddlers.

image


Submitted using https://saqimtiaz.github.io/tw5-docs-pr-maker/.

Copy link

github-actions bot commented Dec 2, 2024

@DesignThinkerer It appears that this is your first contribution to the project, welcome.

With apologies for the bureaucracy, please could you prepare a separate PR to the 'tiddlywiki-com' branch with your signature for the Contributor License Agreement (see contributing.md).

Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 2468776
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/674f6e174650b60008bc3e77
😎 Deploy Preview https://deploy-preview-8793--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pmario
Copy link
Member

pmario commented Dec 2, 2024

Filter operators have a system to link to examples. IMO we should keep that mechanism, for consistency reasons. See eg: https://deploy-preview-8793--tiddlywiki-previews.netlify.app/#all%20Operator

@DesignThinkerer
Copy link
Contributor Author

DesignThinkerer commented Dec 2, 2024

Filter operators have a system to link to examples. IMO we should keep that mechanism, for consistency reasons.

I'm aware, however I was not able to find a way to elegantly display the predefined functions as seen in this tiddler:

https://deploy-preview-8793--tiddlywiki-previews.netlify.app/#filter%20Operator%20(Examples)

I used the same setup as usual, but with the new test case widget to allow the user to clearly see the functions that are being set. Here's an attempt anyway:

image

Which one do you prefer, with testcase or without testcase ?

@pmario
Copy link
Member

pmario commented Dec 2, 2024

Which one do you prefer, with testcase or without testcase ?

For consistency I personally prefer the "usual setup" as in the screenshot.

@Jermolene -- What do you think?

@kookma
Copy link
Contributor

kookma commented Dec 3, 2024

Thank you for examples.
I may propose simpler examples, I mean for pedagogical purposes, it is better to choose example have less or no other concept except the one you discuss here function.
The above examples have several advanced concepts: shadow tiddlers, startup, ...

One simple example is to list first five tiddlers tagged Learning. The number of results can be sent as an input attribute.

… introductory function to gradually increase complexity
@DesignThinkerer
Copy link
Contributor Author

DesignThinkerer commented Dec 3, 2024

Thank you for examples. I may propose simpler examples, I mean for pedagogical purposes, it is better to choose example have less or no other concept except the one you discuss here function

Ok, I added a function with the sole purpose of getting the value for a field, this way the complexity increase more gradually. I also used the format recommanded by @pmario.

I added an example at the end showing how these functions can be used together.

image

What do you think?

https://deploy-preview-8793--tiddlywiki-previews.netlify.app/#function%20Operator%20(Examples)

@kookma
Copy link
Contributor

kookma commented Dec 3, 2024

What do you think?

Much better, thank you!

Copy link

github-actions bot commented Dec 5, 2024

DesignThinkerer has signed the Contributor License Agreement (see contributing.md)

@Jermolene
Copy link
Member

Thanks @DesignThinkerer

@Jermolene Jermolene merged commit 4954a6a into TiddlyWiki:tiddlywiki-com Dec 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants