<commit_before># stylegen

**stylegen** should be an easy to use styleguide generator for arbitrary projects. There is no assumption about programming languages and only a few ones about your projects code structure.

What **stylegen** ships is an executable that parses your project for **stylegen** specific configuration files, and builds a ready to deploy static styleguide.

## Usage

install the tool, with `npm install -g stylegen`

- add a styleguide.yaml or .json file to your project
- add component.yaml or .json files to your components
- run `stylegen` inside the project


### Styleguide-Config (styleguide.yaml / styleguide.json)

This file must be located in the project root and declares the project settings. It may be either written in yaml format (styleguide.yaml) or as plain json (styleguide.json). We prefer yaml format for configurations, but  you are free to choose json as well.

#### Base Properties

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| project                   |                             | project name
| namespace                 | "app"                       | a namespace, that e.g your helpers are prefixed with
| componentPaths            | ["components"]              | relative directory paths, in that your component configurations are located
| target                    | "styleguide"                | the compile target for the resulting styleguide
| dependencies              | {}                          | see "Dependencies" below
| assets                    | []                          | static asset files, that should be copied to the styleguide directory, head for "Assets" for further information
| content                   | []                          | list of page configurations, take a look at "Content"

#### Dependencies

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| styles                    |                             | styles that should be linked in the head section of your page
| js                        |                             | js that is loaded at the end of your body tag

#### Assets

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| src                       |                             | file or directory, that should be copied to the styleguide
| js                        |                             | target path for that file or directory

#### Content

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| label                     |                             | the label of a page is used for the link text for example
| type                      |                             | either one of "md" or "tags", to define a page to be a plain markdown document or a list of components grouped by tags
| content                   |                             | in case type is "md", content must be a relative path to that document, otherwise a list of tags is expected<commit_msg>USXP-674 added partials property to readme<commit_after># stylegen

**stylegen** should be an easy to use styleguide generator for arbitrary projects. There is no assumption about programming languages and only a few ones about your projects code structure.

What **stylegen** ships is an executable that parses your project for **stylegen** specific configuration files, and builds a ready to deploy static styleguide.

## Usage

install the tool, with `npm install -g stylegen`

- add a styleguide.yaml or .json file to your project
- add component.yaml or .json files to your components
- run `stylegen` inside the project


### Styleguide-Config (styleguide.yaml / styleguide.json)

This file must be located in the project root and declares the project settings. It may be either written in yaml format (styleguide.yaml) or as plain json (styleguide.json). We prefer yaml format for configurations, but  you are free to choose json as well.

#### Base Properties

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| project                   |                             | project name
| namespace                 | "app"                       | a namespace, that e.g your helpers are prefixed with
| componentPaths            | ["components"]              | relative directory paths, in that your component configurations are located
| target                    | "styleguide"                | the compile target for the resulting styleguide
| dependencies              | {}                          | see "Dependencies" below
| partials                  | []                          | list of partial libs to be included
| assets                    | []                          | static asset files, that should be copied to the styleguide directory, head for "Assets" for further information
| content                   | []                          | list of page configurations, take a look at "Content"

#### Dependencies

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| styles                    |                             | styles that should be linked in the head section of your page
| js                        |                             | js that is loaded at the end of your body tag

#### Assets

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| src                       |                             | file or directory, that should be copied to the styleguide
| js                        |                             | target path for that file or directory

#### Content

| Property                  | Default                     | Description     
|---------------------------|-----------------------------|--------------------
| label                     |                             | the label of a page is used for the link text for example
| type                      |                             | either one of "md" or "tags", to define a page to be a plain markdown document or a list of components grouped by tags
| content                   |                             | in case type is "md", content must be a relative path to that document, otherwise a list of tags is expected
{'fraction_non_alphanumeric': 0.14119380987472366, 'fraction_numerical': 0.0004421518054532056, 'mean_word_length': 1.2039623254303344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '581911', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1282, 'n_words': 652}