Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWS-256: Update documentation #1163

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ View the respective directory and their READMEs for more information.
* `lxljs` - Utility library
* `lxl-web` - New Libris search
* `packages/supersearch` - Supersearch component library
* `packages/codemirror-lang-lxlquery` - CodeMirror language support package for Libris XL queries

42 changes: 25 additions & 17 deletions packages/supersearch/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
# create-svelte
# supersearch

Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
A [Svelte](https://svelte.dev) search component powered by [CodeMirror](https://codemirror.net/).

Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
## Installation

## Creating a project
```bash
npm install supersearch
```

If you're seeing this, you've probably already done this step. Congrats!
## Usage

```bash
# create a new project in the current directory
npx sv create
To use `supersearch` in a Svelte project ...

# create a new project in my-app
npx sv create my-app
```
To use `supersearch` in a non-Svelte project ...

## Properties

| Property | Type | Description | Default value |
| ------------- | ----------------- | ----------------------------------------------------------------- | ------------- |
| `name` | `string` | A string specifying a name for the form control. | `undefined` |
| `value` | `string` | The value that will be displayed and edited inside the component. | `""` |
| `form` | `string` | A string matching the `id` of a `<form>` element. | `undefined` |
| `language` | `LanguageSupport` | The language extension that will parse and highlight the value. | `undefined` |
| `placeholder` | `string` | A brief hint which is shown when value is empty. | `""` |

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
Install dependencies with `npm install` and start a development server:

```bash
npm run dev
Expand All @@ -27,17 +35,17 @@ npm run dev
npm run dev -- --open
```

Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
Everything inside `src/lib` is part of the library, everything inside `src/routes` can be used as a showcase or preview app.

## Building

To build your library:
To build the library:

```bash
npm run package
```

To create a production version of your showcase app:
To create a production version of the showcase app:

```bash
npm run build
Expand All @@ -49,9 +57,9 @@ You can preview the production build with `npm run preview`.

## Publishing

Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
Consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).

To publish your library to [npm](https://www.npmjs.com):
To publish the library to [npm](https://www.npmjs.com):

```bash
npm publish
Expand Down
Loading