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

Suggested edits to data #95

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

parulsingh23
Copy link
Contributor

Hello there! I used Mavo to suggest the following edits:
I added sentences to "Function calls" to describe calling js functions
Preview my changes here: https://mavo.io/docs/expressions?storage=https%3A%2F%2Fraw.githubusercontent.com%2Fparulsingh23%2Fmavo.io%2Fmaster%2Fdocs%2Fdocs.json&docs-storage=https%3A%2F%2Fgithub.com%2Fmavoweb%2Fmavo.io%2Fdocs%2Fdocs.json

Copy link
Member

@LeaVerou LeaVerou left a comment

Choose a reason for hiding this comment

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

The part about when parameters are other Mavo properties is very confusing without an example or suggested course of action. I would just skip that for now, and focus on how they can add functions, both as globals and on Mavo.Functions. I would add it as a small section in the end, with a title like "Custom functions"

@LeaVerou
Copy link
Member

LeaVerou commented Dec 2, 2020

@DmitrySharabin This is not urgent at all, but why can't I preview Parul's changes via the link above? Does it have to do with the PR plugin?

@DmitrySharabin
Copy link
Member

@DmitrySharabin This is not urgent at all, but why can't I preview Parul's changes via the link above? Does it have to do with the PR plugin?

I also noticed that. Will take a look.

@parulsingh23
Copy link
Contributor Author

Good point @LeaVerou, I updated the docs with the 'Custom Functions' section right after "Function Calls". Let me know if I should make any changes.

Copy link
Member

@LeaVerou LeaVerou left a comment

Choose a reason for hiding this comment

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

Hi there,
There is still no example of either of these things. Keep in mind that the target audience may not even know what a global is, they need to see it. Similarly, they may not know what adding them on Mavo.Functions means. In general, "show, don't tell" is a good rule of thumb for technical writing.

@DmitrySharabin
Copy link
Member

Hi there 👋🏻

@LeaVerou, I gave it a closer look and sent two PRs (to mavo and plugins). I also noticed one interesting thing: the docs app on the docs page has both the storage and the source. And because of the source, we can't see the switch to fork dialog. If I'm not mistaken, this line is exactly about that:
https://github.com/mavoweb/mavo/blob/27c4c0b1b74828ac017b6eb4d528e54690776cd9/src/backend.github.js#L199.

Do we need the source in this app?

@parulsingh23
Copy link
Contributor Author

@LeaVerou you can review this change (updated to include example of adding js function to Mavoscript: Mavoscript.Functions.increment = function(param) {return param+1}).

@LeaVerou
Copy link
Member

LeaVerou commented Dec 9, 2020

@DmitrySharabin We don't really need the source, it was just to avoid the API request when loading the data. But it looks like that check needs to change, since it's introducing bugs.

Also, I shouldn't be seeing this dialog when visiting someone else's data:
image

Copy link
Member

@LeaVerou LeaVerou left a comment

Choose a reason for hiding this comment

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

  • "JS" should be uppercase, as it's an acronym.
  • Please show an example of defining them as globals. Many novices don't know what that means.
  • It would be nice to have a somewhat more useful example than an increment function. What are some cases where we have needed custom functions that are simple enough for an introductory example?

@DmitrySharabin
Copy link
Member

DmitrySharabin commented Dec 9, 2020

@DmitrySharabin We don't really need the source, it was just to avoid the API request when loading the data. But it looks like that check needs to change, since it's introducing bugs.

Also, I shouldn't be seeing this dialog when visiting someone else's data:

I'll do my best to fix it.

@parulsingh23
Copy link
Contributor Author

@LeaVerou I updated the function to be a logical xor custom JS function, so you can look over the changes and let me know, thanks!

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.

None yet

3 participants