Writing extensions¶
You can write your own repocribro extension. It’s very simple,
all you need is extend the Extension
class from repocribro.extending
,
make function returning instance of this class and direct entrypoint
in the group [repocribro.ext]
on that function. Extending is done
via implementing actions on Hooks for extension which can return something.
While writing new plugin use please the same model, so even your extension
is also easily extensible. Big part of core repocribro is extension itself
see the module repocribro.ext_core
.
my_ext.py¶
1 2 3 4 5 6 7 8 9 10 | from repocribro.extending import Extension
class MyNewExtension(Extension):
...
def make_my_new_extension():
...
return MyNewExtension()
|
setup.py¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | from setuptools import setup
...
setup(
...
entry_points={
'repocribro.ext': [
'repocribro-my_ext = my_ext:make_my_new_extension'
]
},
...
)
...
|