git.iko.soy/rowtype-yoga/purescript-docs-search
on master help sign in
48 lines 1.9 kB history raw
1# purescript-docs-search
3[![Build status](https://github.com/purescript/purescript-docs-search/actions/workflows/build.yml/badge.svg)](https://github.com/purescript/purescript-docs-search/actions/workflows/build.yml)
5An app that adds search capabilities to generated documentation for PureScript code.
7It supports nearly-all functionality of [Pursuit](https://github.com/purescript/pursuit), including querying by type.
9## Installing
11When using [spago](https://github.com/spacchetti/spago), you don't need to install this app manually: run `spago docs` or `spago search`.
13Otherwise, use NPM (`npm install purescript-docs-search`) or [npx](https://github.com/npm/npx): `npx purescript-docs-search`.
15## Usage
17There are two usage scenarios:
19### Patching static documentation
21Use `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:
23![Preview](preview.png)
25The user interface of the app is optimised for keyboard-only use.
27**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.
29### Using the CLI
31Running `purescript-docs-search` within a project directory will open an interactive command-line session.
33Note that unlike in Pursuit, most relevant results will appear last.
35A quick demo:
37[![asciicast](https://asciinema.org/a/Hexie5JoWjlAqLqv2IgafIdb9.svg)](https://asciinema.org/a/Hexie5JoWjlAqLqv2IgafIdb9)
39You may notice that the CLI offers slightly better results than the web interface. This is a performance tradeoff.
41## Development
43```
44npm install
45npm run build # or build-dev to skip JS compression stage
46```
48Use `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.