Lunr search with --http mode
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
When I tried to use offline search functionality I get such error in pop-up window:
Error importing module doc-search:
Traceback (most recent call last):
File "/home/al-pa/localPython/py380/lib/python3.8/site-packages/pdoc/__init__.py", line 225, in import_module
module = importlib.import_module(module_path)
File "/home/al-pa/localPython/py380/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'doc-search'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/al-pa/localPython/py380/lib/python3.8/site-packages/pdoc/cli.py", line 234, in do_GET
out = self.html()
File "/home/al-pa/localPython/py380/lib/python3.8/site-packages/pdoc/cli.py", line 263, in html
return pdoc.html(self.import_path_from_req_url,
File "/home/al-pa/localPython/py380/lib/python3.8/site-packages/pdoc/__init__.py", line 176, in html
mod = Module(import_module(module_name, reload=reload),
File "/home/al-pa/localPython/py380/lib/python3.8/site-packages/pdoc/__init__.py", line 227, in import_module
raise ImportError('Error importing {!r}: {}: {}'
ImportError: Error importing 'doc-search': ModuleNotFoundError: No module named 'doc-search'
pip install doc-search tells me that
ERROR: Could not find a version that satisfies the requirement doc-search
ERROR: No matching distribution found for doc-search
Could you please help me to understand what I am missing?
P.S.
$ python --version
Python 3.8.0
$ pdoc --version
pdoc 0.9.2
$ pip --version
pip 20.3.3 from /home/al-pa/localPython/py380/lib/python3.8/site-packages/pip (python 3.8)
P.P.S. running pdoc with such command:
pdoc3 --html --http localhost:1234 -c lunr_search=True <module_name>
Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported pdoc3 --html --http localhost:1234 -c lunr_search=True <module_name> command with Python 3.8 and pdoc 0.9.2, then trace why the HTTP request attempts to import doc-search. Done means offline Lunr search works in HTTP mode without the reported import error, with the relevant behavior covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100