Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AllenJB
Copy link

@AllenJB AllenJB commented Oct 11, 2025

One of the reasons I've seen for people liking the CHM version of the manual is the search feature. So I thought "what if we can have a downloadable manual with search using the HTML version" - this way the CHM builds can be abandoned and the people who want an offline searchable manual can still have one.

I've implemented this as a new output - this was a simple way to avoid breaking the other output formats that extend off Chunked XHTML. There may be a better way to implement this with less duplication.

The header currently has a significant amount of duplication mainly because I was avoiding modifying Chunked XHTML code. This code could easily be refactored to allow inserting the search button without the duplication.

You'll note that the search indexes are being output to a .js file. This is to avoid CORS preventing fetch() / import of local files when on the file:// protocol (at least in Chrome).

The search.js file is the same as the version from web-php with the following changes:

  • Removed manipulation of data - unnecessary now search-combined has the data already in the right format
  • Changes to how the search indexes are loaded and some other behavior, based on the language being "local"
  • Null checks to avoid errors from DOM elements not present

These changes could easily be pushed back to the web-php version.

(web-php could also be modified to load the -combined search indexes, which avoids manipulation being done in both search.js and search-index.php, simplifying both. If the search-index and search-description files aren't being used by anything else (that can't be updated to use search-combined) they could be removed altogether)

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.

1 participant