<commit_before># SITe

[![Circle CI](https://circleci.com/gh/ePages-de/site.svg?style=svg)](https://circleci.com/gh/ePages-de/site)

## Installation

```sh
npm install
```

## Usage

Starting the test server:

```sh
NODE_ENV=development npm start
```

Building the JavaScript (Development):

```
NODE_ENV=development gulp build
```

Building the JavaScript (Production):

```
NODE_ENV=production gulp build
```

Watch for changes and build for development:

```
NODE_ENV=development gulp watch
```

## Testing

Tests are run against a caching proxy for the API. When adding new tests you
have to record new responses with `REPLAY=record npm test` and then modify the
new files in ./fixtures/ by deleting the "accept-language" and
"accept-encoding" headers from requests to workaround different chrome version
on your machine and CircleCI

```sh
NODE_ENV=development npm test # or npm run watch to keep running
```<commit_msg>adds webmaster documentation<commit_after># SITe

SITe is javascript widget that allows webmasters to embed an epages shop into
their website.

## For webmasters

### Getting started

1. Embed the javascript tag right before the closing ```</html>``` in your
   webpage:
    ```html
    <script src="https://TODO/site.js" async="true" id="epages-widget" data-shopid="YOUR_SHOP_ID"></script>
    ```

2. Insert the widget ```div``` into your page. This is where the products will be shown.
    ```html
    <div class="epages-shop-widget"></div>
    ```

### Widget options

The widget supports multiple options that can be combined:

* **data-category-list** (default: disabled):  
  To display a drop down with all of your categories, add `data-category-list` to the widget ```div```:

    ```html
    <div class="epages-shop-widget" data-category-list></div>
    ```

* **data-search-form** (default: enabled):  
  To hide the search form, add `data-search-form="false"` to the widget ```div```:

    ```html
    <div class="epages-shop-widget" data-search-form="false"></div>
    ```

* **data-sort** (default: enabled):  
  To hide the sorting options, add  `data-sort="false"` to the widget ```div```:

    ```html
    <div class="epages-shop-widget" data-search-form="false"></div>
    ```

* **data-product-ids** (default: empty):  
  To only show preselected products, add their comma-separated IDs to the `data-product-ids` attribute:

    ```html
    <div class="epages-shop-widget" data-product-ids="559CE8CA-40A4-01E2-5957-D5809AB3FEA7,559CE8CB-05B5-5A70-1349-D5809AB3FEA1"></div>
    ```

* **data-category-id** (default: empty):  
  To only show one preselected category, add the ```data-category-id``` attribute:

    ```html
    <div class="epages-shop-widget" data-category-id="559CE8D5-181B-4F27-37BC-D5809AB3FE11"></div>
    ```
  This disables the category drop-down.

## For developers

[![Circle CI](https://circleci.com/gh/ePages-de/site.svg?style=svg)](https://circleci.com/gh/ePages-de/site)

### Installation

```sh
npm install
```

### Usage

Starting the test server:

```sh
NODE_ENV=development npm start
```

Building the JavaScript (Development):

```
NODE_ENV=development gulp build
```

Building the JavaScript (Production):

```
NODE_ENV=production gulp build
```

Watch for changes and build for development:

```
NODE_ENV=development gulp watch
```

### Testing

Tests are run against a caching proxy for the API. When adding new tests you
have to record new responses with `REPLAY=record npm test` and then modify the
new files in ./fixtures/ by deleting the "accept-language" and
"accept-encoding" headers from requests to workaround different chrome version
on your machine and CircleCI

```sh
NODE_ENV=development npm test # or npm run watch to keep running
```
{'fraction_non_alphanumeric': 0.1374496644295302, 'fraction_numerical': 0.01664429530201342, 'mean_word_length': 4.353448275862069, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3557908', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1150, 'n_words': 381}