-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
(feat) add jisho.org #1030
(feat) add jisho.org #1030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments here and there
searx/engines/jisho.py
Outdated
infobox_content += f"<li><i>{pos}</i>: {engdef}" | ||
if extra != '': | ||
infobox_content += f" ({extra})" | ||
infobox_content += '</li>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it always close an <i>
?
What about infobox_content += f" ({extra})"
and infobox_content += '</ul><small>Wikipedia, CC BY-SA 3.0.</small><ul>'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean <li>
What about
infobox_content += f" ({extra})"
There always exist engdef
. Plus <li>
is always appended since I have both an if and an else
and
infobox_content += '</ul><small>Wikipedia, CC BY-SA 3.0.</small><ul>'
At the very top I exclude any entries whose first entry is Wikipedia. My understanding is that the dictionary entries are always before Wikipedia entries.
searx/engines/jisho.py
Outdated
<small><a href="https://www.edrdg.org/wiki/index.php/JMdict-EDICT_Dictionary_Project">JMdict</a> | ||
and <a href="https://www.edrdg.org/enamdict/enamdict_doc.html">JMnedict</a> | ||
by <a href="https://www.edrdg.org/edrdg/licence.html">EDRDG</a>, CC BY-SA 3.0.</small><ul> | ||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the topic of another issue and PR : the infobox template is missing a field about the license:
https://github.com/searxng/searxng/blob/master/searx/templates/simple/infobox.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be documented imo
Sorry I haven't had time to test in deep yet, but a first try results in a IndexError:
Should it be
|
yes and no.
@austinhuang0131 > I have refactored the code in dalf@0e2754e . Can you have a look? |
That's good, you can use it as-is. |
Merged. Thank you! |
Wow, that's what I'd call a very prompt response. Thank you all for the effort! |
What does this PR do?
Add https://jisho.org as an engine. Note that this only supports searching words (either English or Japanese input).
A longer infobox:
Why is this change important?
¯\_(ツ)_/¯
How to test this PR locally?
make run test
Author's checklist
Related issues
Closes #1016