Skip to content
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

[docs] reorder blog articles #97

Merged
merged 21 commits into from
Jun 8, 2021
Merged

Conversation

return42
Copy link
Member

@return42 return42 commented May 25, 2021

For details read along the commit messages

Hint: there a two patches with a fix in this PR:

@return42 return42 force-pushed the drop-searx-admin branch 2 times, most recently from fa8123a to 1b22774 Compare June 3, 2021 21:04
@return42 return42 changed the title [docs] remove blog article about searx-admin [docs] reorder blog articles Jun 3, 2021
@return42 return42 force-pushed the drop-searx-admin branch 2 times, most recently from de6fc1e to adc28dd Compare June 4, 2021 08:41
- https://github.com/kvch/searx-admin last maintained 4 years ago
- searx-admin does not support 'use_default_settings' [1] (b4b81a5)

[1] https://searxng.github.io/searxng/admin/settings.html#use-default-settings

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The article "Command line engines" should be in admin's engine
documentation (like the recoll engine).

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The article "SQL engines" should be in admin's engine documentation (like the
recoll engine).

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This article is obsolete since a long time: Python 2 support has been dropped
and these days, virtualenv is managed by ``make pyenv.install``.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The article "Offline engines" should be in developer's documentation next to
chapter "Engine overview".

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This engine just exists for documentation purpose.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a a complete revision of the article "Offline engines", which also
merges the content from the searx-wiki [1] into this article.

[1] https://github.com/searx/searx/wiki/Offline-engines

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
- Split chapter "Engines" and rename it into "Engines & Settings"
- Move docs/admin/engines.rst -> docs/admin/engines/engine_settings.rst

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This engine just exists for documentation purpose.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch revision of the article "Engine Overview":

- add links & anchors
- improve formating of the tables

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a marginal revision of the article "settings.yml", most changes
are from normalizing the YAML syntax.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The blog article 'Query your local search engines' has been renamed 'Local
Search Engines', revised and moved into admin's chapter 'Engine & Settings'.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Move article 'Developing in Linux Containers' from blog section do developer
section.  Since there are no more articles in the blog section, remove the
section completely.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@return42
Copy link
Member Author

return42 commented Jun 4, 2021

FYI: online HTML representation of this PR is available from https://return42.github.io/searxng/


"""
global _my_online_engine # pylint: disable=global-statement
_my_online_engine = engine_settings.get('name')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand it makes a demo of the init function, but the parameter is not used.

Out of topic for this PR, engine_settings values are copied as attributes into the module. So engine_settings.get('name') could be name (with global _my_online_engine, name above).

And engine_settings can be:

{
    k: getattr(engine, k) 
    for k in dir(engine)
    if not k.startswith('__') and not callable(getattr(engine, k))
}

instead of get_engine_from_settings

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I guess I have a problem to understand why we have this argument engine_settings .. does it make sense to drop this argument? .. for me it was a bit confusing that we update module's name space with the values from YAML (engine_data):

def update_engine_attributes(engine, engine_data):
# set engine attributes from engine_data
for param_name, param_value in engine_data.items():
if param_name == 'categories':
if isinstance(param_value, str):
param_value = list(map(str.strip, param_value.split(',')))
engine.categories = param_value
elif param_name != 'engine':
setattr(engine, param_name, param_value)

and later, when the processor is initialized ...

def initialize(self):
try:
self.engine.init(get_engine_from_settings(self.engine_name))

we call a function that gather engine_data from the YAML settings.

In sense of single point of definition I guess it is better to say, that everything is in the namespace of engine's modul and this can be configured by (is updated from) the YAML file.

But may be I'm totally wrong, since I do not have a complete overview.

The naming of overrides is arbitrary. But the recommended overrides are the
following:
Global names with a leading underline are *private to the engine* and will
not be overwritten.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, names starting with _ can be overwritten but they can be None.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops .. I forgot to reflect your hint into the documentation. What Do you think, is it better to fix the documentation or is it better to fix the code that overrides private members?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to fix the documentation.

@dalf dalf self-requested a review June 8, 2021 10:53
Copy link
Member

@dalf dalf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@return42 return42 merged commit 5c5db71 into searxng:master Jun 8, 2021
@return42 return42 deleted the drop-searx-admin branch June 8, 2021 10:56
return42 added a commit to return42/searxng that referenced this pull request Jun 9, 2021
[1] searxng#97 (comment)

Suggested-by: @dalf [1]
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants