diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2016-07-10 08:28:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-10 08:28:00 +0200 |
| commit | 7bd30fd21bbc23c485ac9fd77795314edb5dc665 (patch) | |
| tree | 997b66dc3f1ab2ffb1bfbfaf551a00e8777a2306 /docs/dev/plugins.rst | |
| parent | 3e351e3b9f819d5383fd1ebafd906fdbe0c3d086 (diff) | |
| parent | 521f398709ea481fdf55f1e4c111f063f91fa8c0 (diff) | |
Merge pull request #614 from kvch/gh-pages
documentation updates
Diffstat (limited to 'docs/dev/plugins.rst')
| -rw-r--r-- | docs/dev/plugins.rst | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/docs/dev/plugins.rst b/docs/dev/plugins.rst index c51fdf0eb..0f52af0d8 100644 --- a/docs/dev/plugins.rst +++ b/docs/dev/plugins.rst @@ -1,11 +1,11 @@ Plugins ------- -Plugins can extend/replace functionality of various components inside +Plugins can extend or replace functionality of various components of searx. -example\_plugin.py -~~~~~~~~~~~~~~~~~~ +Example plugin +~~~~~~~~~~~~~~ .. code:: python @@ -24,22 +24,22 @@ example\_plugin.py ctx['search'].suggestions.add('example') return True -Currently implemented plugin entry points (a.k.a hooks) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Plugin entry points +~~~~~~~~~~~~~~~~~~~ -- Pre search hook (``pre_search``) -- Post search hook (``post_search``) -- Result hook (``on_result``) (is called if a new result is added (see - https\_rewrite plugin)) +Entry points (hooks) define when a plugin runs. Right now only three hooks are implemented. So feel free to implement a hook if it fits the behaviour of your plugin. -Feel free to add more hooks to the code if it is required by a plugin. +Pre search hook +``````````````` -TODO -~~~~ +Runs BEFORE the search request. Function to implement: ``pre_search`` -- Better documentation -- More hooks -- search hook (is called while searx is requesting results (for - example: things like math-solver), the different hooks are running - parallel) +Post search hook +```````````````` +Runs AFTER the search request. Function to implement: ``post_search`` + +Result hook +``````````` + +Runs when a new result is added to the result list. Function to implement: ``on_result`` |