Chunked XHTML with JS search #204
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
languagebeing "local"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)