anki-code / xontrib-rc-awesome

👓 🐚 Make your xonsh RC file installable with awesome snippets of code.
82 stars 14 forks source link

Document how `xontrib` modules are registered and loaded through `setuptools` #4

Open goodboy opened 1 year ago

goodboy commented 1 year ago

I think it would be super helpful to have some comments inside your example setup.py script which (briefly) explain how xontrib module registration works in terms of what xonsh will do to load such registered modules.

So for example here you could document what and (ideally how) modules under xontrib/ are processed and made available in some env to xontrib load <module_name>

anki-code commented 1 year ago

setup.py is python setup script and it will be replaced by pyproject soon.

xontrib is just python package. When you install a xonrtib you just add a package files to python package xontrib/ and the command xontrib load some_xontrib is similar with just import xontrib.some_xontrib.

goodboy commented 1 year ago

@anki-code another thing that might be nice is documenting when you should add _load_xcontrib() to a .xsh file