mavo.io icon indicating copy to clipboard operation
mavo.io copied to clipboard

Searched for hooks for docs/plugins list

Open joyously opened this issue 8 years ago • 4 comments

I ran a search for hooks for the list mentioned at the bottom of mavo.io/docs/plugins/index.tpl.html I wanted to make it a Mavo app, but didn't really know how...

Searching for: Mavo.hooks.run collection.js(32): Mavo.hooks.run("collection-init-end", this); collection.js(72): Mavo.hooks.run("node-getdata-end", env); collection.js(154): Mavo.hooks.run("collection-add-end", env); collection.js(400): Mavo.hooks.run("collection-add-end", env); domexpression.js(22): Mavo.hooks.run("domexpression-init-start", this); domexpression.js(73): Mavo.hooks.run("domexpression-init-treebuilt", this); domexpression.js(76): Mavo.hooks.run("domexpression-init-end", this); domexpression.js(91): Mavo.hooks.run("domexpression-update-start", env); domexpression.js(100): Mavo.hooks.run("domexpression-update-beforeeval", env); domexpression.js(104): Mavo.hooks.run("domexpression-update-aftereval", env); domexpression.js(128): Mavo.hooks.run("domexpression-update-end", env); expression.js(13): Mavo.hooks.run("expression-eval-beforeeval", this); expression.js(27): Mavo.hooks.run("expression-eval-error", {context: this, exception}); group.js(11): Mavo.hooks.run("group-init-start", this); group.js(52): Mavo.hooks.run("group-init-end", this); group.js(118): Mavo.hooks.run("node-getdata-end", env); mavo.js(49): Mavo.hooks.run("init-start", this); mavo.js(68): Mavo.hooks.run("init-tree-before", this); mavo.js(73): Mavo.hooks.run("init-tree-after", this); mavo.js(268): Mavo.hooks.run("init-end", this); node.js(45): Mavo.hooks.run("node-init-start", env); node.js(68): Mavo.hooks.run("node-init-end", env); node.js(119): Mavo.hooks.run("unit-isdatanull", env); node.js(176): Mavo.hooks.run("node-edit-end", this); node.js(190): Mavo.hooks.run("node-done-end", this); node.js(236): Mavo.hooks.run("node-render-start", env); node.js(265): Mavo.hooks.run("node-render-end", env); primitive.js(24): Mavo.hooks.run("primitive-init-start", this); primitive.js(146): Mavo.hooks.run("primitive-init-end", this); primitive.js(215): Mavo.hooks.run("node-getdata-end", env); Found 30 occurrence(s) in 7 file(s)

joyously avatar Jul 15 '17 22:07 joyously

Yeah, unfortunately the documentation for plugin developers is seriously lacking at the moment, due to limited resources (Mavo development and documentation for authors take priority). :( It's coming though!

However, especially for hooks, one would need to understand the code to use them anyway. There are higher level extension points for common things like e.g. building a storage backend, or a format, or registering a new element type.

I wanted to make it a Mavo app, but didn't really know how...

You mean you wanted to make a Mavo app that lists the available hooks?

LeaVerou avatar Jul 16 '17 12:07 LeaVerou

You mean you wanted to make a Mavo app that lists the available hooks?

Yes, I thought it could be kept up to date easily if there were an app that searched the code for the hooks. Maybe just a link in to browse the code would be enough, a link to GitHub search is fairly useful, but didn't seem to list them all.

joyously avatar Jul 16 '17 15:07 joyously

That’s a great idea! Especially with links to the code. I don't think it can be done entirely in Mavo, with no coding, but hopefully it should be possible with relatively minor coding. I'd need to look into Github's API for search results.

In the meantime, a link to the search results would definitely be a good idea.

LeaVerou avatar Jul 16 '17 15:07 LeaVerou

Sadly, it looks like the Github API has the same restrictions: https://developer.github.com/v3/search/#search-repositories https://help.github.com/articles/searching-code/#search-within-a-users-or-organizations-repositories

LeaVerou avatar Dec 07 '17 01:12 LeaVerou