Skip to content

Commit

Permalink
Docs: Documentation of usage and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Oct 19, 2021
1 parent 2b7f4dd commit 6db08fa
Showing 1 changed file with 92 additions and 9 deletions.
101 changes: 92 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,66 @@ Provide configurable cookie consent banner with predefined LMC defaults. The UI

The package is a wrapper around [Cookie Consent] by [Orest Bida].

## Install
## Usage

1. Download (or use via [cdn](#download--cdn)) and include the script at the bottom of `body` tag.

```html
<script src="init.js"></script>
```

2. Run the plugin with your configuration parameters.
<br>
<details><summary><b>Show basic example</b></summary>

```html
<script defer src="init.js"></script>
<script>
window.addEventListener('load', function () {
initLmcCookieConsentManager({
currentLang: 'cs',
themeCss: './dist/LmcCookieConsentManager.css',
config: {
// override default config
},
});
});
</script>
```

</summary>
</details>
<br>

For more details check out original [cookie consent] library.

### Zero configuration setup

Download (or use via [cdn](#download--cdn)) and include the script at the bottom of `body` tag.

```html
<script src="<autoload.js>"></script>
```

Will display cookie consent with default configuration.

### Download & CDN

You can download the [latest version](https://github.com/lmc-eu/cookie-consent-manager/releases) or use it via cdn:

javascript :

```html
https://cdn.jsdelivr.net/npm/lmc-eu/cookie-consent-manager@v0.1.0/init.js
```

stylesheet :

```html
https://cdn.jsdelivr.net/npm/lmc-eu/cookie-consent-managert@v0.1.0/LmcCookieConsentManager.css
```

### npm

```shell
yarn add @lmc-eu/cookie-consent-manager
Expand All @@ -16,16 +75,40 @@ or
npm install --save @lmc-eu/cookie-consent-manager
```

TODO
```js
import LmcCookieConsentManager from '@lmc-eu/cookie-consent-manager';

## Usage
LmcCookieConsentManager({
currentLang: 'cs',
themeCss: './dist/LmcCookieConsentManager.css',
config: {
// override default config
},
});
```

```scss
@use '../node_modules/@lmc-eu/cookie-consent-manager/LmcCookieConsentManager';

:root {
// override default config
}
```

## Configuration

You can initialize cookie consent manager with following parameters:

TODO
| Option | Type | Default | Description |
| ------------- | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `currentLang` | string | 'cs' | Specify one of the languages you have defined (can also be dynamic): 'en', 'cs' ... |
| `themeCss` | string | '' | Specify path to the .css file |
| `config` | Object | {} | Override default config. For all parameters consult [original library](https://github.com/orestbida/cookieconsent/blob/master/Readme.md#all-available-options). |

## Changelog
## License

TODO
Distributed under the MIT License. See [LICENSE](https://github.com/lmc-eu/cookie-consent-manager/blob/main/LICENSE.md) for more information.

- [spirit design system]: https://github.com/lmc-eu/spirit-design-system
- [cookie consent]: https://github.com/orestbida/cookieconsent
- [orest bida]: https://github.com/orestbida
[spirit design system]: https://github.com/lmc-eu/spirit-design-system
[cookie consent]: https://github.com/orestbida/cookieconsent
[orest bida]: https://github.com/orestbida

0 comments on commit 6db08fa

Please sign in to comment.