Skip to content

Commit

Permalink
feat: don't use prototype anymore, add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lebleu committed Mar 22, 2024
1 parent e7cd353 commit 8eb86d9
Show file tree
Hide file tree
Showing 16 changed files with 1,528 additions and 54 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
coverage
dist
node_modules
node_modules
test
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kømpletr - Vanilla JS auto-completion library
# Kømpletr - Vanilla JS autocompletion library

![Github action workflow status](https://github.com/steve-lebleu/kompletr/actions/workflows/build.yml/badge.svg?branch=master)
[![CodeFactor](https://www.codefactor.io/repository/github/steve-lebleu/kompletr/badge)](https://www.codefactor.io/repository/github/steve-lebleu/kompletr)
Expand All @@ -9,7 +9,7 @@

## > Demo

Demo: https://fabrik.konfer.be/kompletr/
Demo: https://kompletr.konfer.be/demo/

## Installation

Expand All @@ -19,21 +19,15 @@ Demo: https://fabrik.konfer.be/kompletr/
$ npm i kompletr --save
```

### CDN

```html
<script src="kompletr.min.js"></script>
```

### Direct download

```html
$ npm i kompletr --save
```
1. Download latest release archive
2. Get JS files from ./dist/js/.js*
3. Get CSS files from ./dist/css/.css*

## Getting started

Insert Kømpletr styles in the head section of your page:
Load Kømpletr styles:

``` html
<head>
Expand All @@ -43,7 +37,7 @@ Insert Kømpletr styles in the head section of your page:
</head>
```

Load kompletr.js:
Load kompletr script:

``` html
<script src="kompletr.min.js"></script>
Expand All @@ -59,7 +53,8 @@ Invoke Kømpletr:

``` javascript
const input = document.getElementById('autocomplete');
input.kompletr({
kompletr({
input,
data: [],
onSelect: (selected) => {
console.log('There is the selected value', selected);
Expand Down
2 changes: 1 addition & 1 deletion demo/js/kompletr.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/kompletr.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 8eb86d9

Please sign in to comment.