57ff86d84c
Co-authored-by: Fabrizio Ferrai <fabrizio.ferrai@gmail.com> |
||
---|---|---|
.github/workflows | ||
src/Docs/Search | ||
test | ||
.gitignore | ||
CHANGELOG.md | ||
ci-npmrc.txt | ||
package-lock.json | ||
package.json | ||
packages.dhall | ||
preview.png | ||
README.md | ||
release.sh | ||
spago.dhall |
purescript-docs-search
An app that adds search capabilities to generated documentation for PureScript code.
It supports nearly-all functionality of Pursuit, including querying by type.
Installing
When using spago, you don't need to install this app manually: run spago docs
or spago search
.
Otherwise, use NPM (npm install purescript-docs-search
) or npx: npx purescript-docs-search
.
Usage
There are two usage scenarios:
Patching static documentation
Use purescript-docs-search build-index
command to patch HTML files located in generated-docs/html
. You then will be able to search for declarations or types:
The user interface of the app is optimised for keyboard-only use.
S hotkey can be used to focus on the search field, Escape can be used to leave it. Pressing Escape twice will close the search results listing.
Using the CLI
Running purescript-docs-search
within a project directory will open an interactive command-line session.
Note that unlike in Pursuit, most relevant results will appear last.
A quick demo:
You may notice that the CLI offers slightly better results than the web interface. This is a performance tradeoff.
Development
npm install
npm run build # or build-dev to skip JS compression stage
Use spago docs --no-search && ./dist/purescript-docs-search.cjs build-index
to generate the docs and patch them using the local version of the app.