https://github.com/purescript/purescript-docs-search
Search frontend for the documentation generated by the PureScript compiler
https://github.com/purescript/purescript-docs-search
Last synced: 12 months ago
JSON representation
Search frontend for the documentation generated by the PureScript compiler
- Host: GitHub
- URL: https://github.com/purescript/purescript-docs-search
- Owner: purescript
- Created: 2019-07-13T08:47:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-16T18:37:45.000Z (over 1 year ago)
- Last Synced: 2024-10-29T21:05:41.010Z (over 1 year ago)
- Language: PureScript
- Homepage:
- Size: 461 KB
- Stars: 24
- Watchers: 9
- Forks: 8
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# purescript-docs-search
[](https://github.com/purescript/purescript-docs-search/actions/workflows/build.yml)
**This project has been merged into the [spago codebase](https://github.com/purescript/spago/tree/master/docs-search)!**
An app that adds search capabilities to generated documentation for PureScript code.
It supports nearly-all functionality of [Pursuit](https://github.com/purescript/pursuit), including querying by type.
## Installing
When using [spago](https://github.com/spacchetti/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](https://github.com/npm/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:
[](https://asciinema.org/a/Hexie5JoWjlAqLqv2IgafIdb9)
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.