pdoc icon indicating copy to clipboard operation
pdoc copied to clipboard

Cannot get search to work

Open aflugge opened this issue 1 year ago • 1 comments

Expected Behavior

After running in the project directory pdoc3 --html --force -c lunr_search=True . I expect to be able to have a working search box in my HTML documenation files.

Actual Behavior

I get the following error message:

Traceback (most recent call last):
  File "projectfolder/.venv/bin/pdoc3", line 8, in <module>
    sys.exit(main())
  File "projectfolder/.venv/lib/python3.10/site-packages/pdoc/cli.py", line 609, in main
    modules, lunr_config.get("index_docstrings", True), template_config)
AttributeError: 'bool' object has no attribute 'get'

The HTML files have a search box, but if I try to search something, I get the following error message in my browser:

File not found

Firefox can’t find the file at projectfolder/html/doc-search.html#searchWord.

    Check the file name for capitalisation or other typing errors.
    Check to see if the file was moved, renamed or deleted.

There is no doc-search.html in the html folder.

If I run the pdoc3 command without -c lunr_search=True it runs without error, it creates the documentation, but it doesn't put a search box in the documentation.

Additional info

  • pdoc version: pdoc3 0.11.1

aflugge avatar Jul 01 '24 10:07 aflugge

Nevermind. Switched to pdoc, that seems to work.

aflugge avatar Jul 01 '24 11:07 aflugge

lunr_search= param is expected to be a dict, not bool: https://github.com/pdoc3/pdoc/blob/2a66eb2c882cabd195a61f44a921bfdc39eddf2e/pdoc/templates/config.mako#L51-L56

kernc avatar Jul 05 '24 12:07 kernc