-
Notifications
You must be signed in to change notification settings - Fork 762
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
Update "Create a plugin docs" to be a how to create a plugin end to end #1028
Comments
I'm not opposed to adding more details to that page @lifeiscontent, if you or anyone else would like to take a stab at improving it a PR would be welcome. However that that page is more about documenting the API between asdf and asdf plugins than it is a guide on how to create a plugin. It may be better for us to create a separate plugin guide page that goes from start to finish creating an example plugin, because I think the API documentation we current have is useful for reference. |
@Stratus3D Awesome, I agree, a new page might be better here. Would you have some to chat on discord or something? Again, I don't really understand all the ins and outs of asdf so it'd be nice to have some clarifications on aspects of what should be thought about when developing a plugin and what a good design of a plug-in might look like. |
@lifeiscontent I don't normally use discord, but I am on Slack most of the day. I am usually pretty busy so I don't have a lot of time to chat, but I'd be happy to answer any questions you have as I have time. |
@Stratus3D Thanks for the response, I guess as a starting point, are there docs you'd recommend I read up on for things in relation to: What are the lifecycles of a plug-in? Which commands I can hook into as a plug-in author, what are required and optional? Is there a particular signature that each hook follows? Within each hook, how do they interact from the CLI? I'm just trying to put a visual outline together of how the system as a whole works/should work within the context of a plug-in. |
@lifeiscontent so, in order of being most to least accurate and up to date:
asdf plugins must implement required callbacks, which are simply scripts in the plugin's asdf plugins can also define hooks, but all of them are optional. They are also implemented as callback scripts that only need to exist when needed. They allow plugins to run custom code before or after various asdf events. Most plugins should not need to implement hooks. All user interaction with plugins should take place through the asdf APIs. Either the CLI ( Hope this helps! Yeah, a visual of this would be good. I don't have the time to create graphviz diagram right now, so feel free to take a stab at it if you want. Thanks! |
@Stratus3D thanks for the write up! Next time I get some down time I'll take a stab at this, and thank you for writing asdf, its a very neat idea! :) |
The docs have now been updated with more explicit information about each script. The changes were optimized for isolating each script description with the caveat of repetition throughout the page. Here is a summary of the changes from #1445:
While improved, these changes are not a guide to implementing a plugin end to end, so I don't think we can fully close out this issue, but I hope it brings clarity. |
Is your feature request related to a problem? Please describe
https://github.com/asdf-vm/asdf/blob/master/docs/plugins/create.md has decent documentation, but I think it would be superior if it was written from the perspective of taking one of the most popular asdf plugins and creating it from scratch talking about things like:
if the docs were written in this way, I'd be more than happy to contribute, but I'm just not familiar enough with the goals of asdf or bash for that matter.
it would also help people build plugins consistently since there is possibility to have such a wide variety, I think documentation from this perspective would be incredibly useful for the community and the overall growth of asdf.
A good example of documentation written this way is: https://storybook.js.org/docs/react/writing-stories/introduction
they show code, and explain it fairly well, which to me is a much more approachable way to learn.
Describe the proposed solution
outlined above.
Describe similar
asdf
features and why they are not sufficientoutlined above.
Describe other workarounds you've considered
outlined above.
The text was updated successfully, but these errors were encountered: