<commit_before># Mini Transformer - [![Build Status](https://secure.travis-ci.org/jwang/mini_transformer.png)](http://travis-ci.org/jwang/mini_transformer)

# Description
Mini Transformer takes a pair of input files, JSON and XML, then converts it to HTML5 or JSON format. It also supports a mapping of the children elements to HTML elements via YAML mapping file.

# Installation
`gem install mini_transformer`

## Usage
`mini_transform transform [JSON, XML, OUTPUT=nil, FORMAT=html, MAPPING=nil]`

Requires the input.json and input.xml, if neither is provided or found, a File Not Found error will occur.

#### Options
* An output file name such as output.html. Defaults to UID tag or output if not available.
* 2 different output formats supported, html or json. Defaults to html.
* A YAML mapping configuration file for the entries tags to convert to HTML tags. Only available for html output format. Defaults to dt and dd tags.

#### Example Usage
`mini_transform transform input.json, input.xml`  
`mini_transform transform input.json, input.xml, out.json, json`  
`mini_transform transform input.json, input.xml, nil, json`  
`mini_transform transform input.json, input.xml, out.html, html, mapping.yml`  <commit_msg>Make the usage match the website version<commit_after># Mini Transformer - [![Build Status](https://secure.travis-ci.org/jwang/mini_transformer.png)](http://travis-ci.org/jwang/mini_transformer)

# Description
Mini Transformer takes a pair of input files, JSON and XML, then converts it to HTML5 or JSON format. It also supports a mapping of the children elements to HTML elements via YAML mapping file.

# Installation
`gem install mini_transformer`

## Usage
`mini_transform transform [JSON, XML, OUTPUT=nil, FORMAT=html, MAPPING=nil]`

Requires the json and xml file names, if neither is provided or found, a File Not Found error will occur.

#### Options
* An output file name such as output.html. Defaults to UID tag or output if not available.
* 2 different output formats supported, html or json. Defaults to html.
* A YAML mapping configuration file for the entries tags to convert to HTML tags. Only available for html output format. Defaults to dt and dd tags.

#### Example Usage
`mini_transform transform input.json, input.xml`  
`mini_transform transform input.json, input.xml, out.json, json`  
`mini_transform transform input.json, input.xml, nil, json`  
`mini_transform transform input.json, input.xml, out.html, html, mapping.yml`  
{'fraction_non_alphanumeric': 0.08488278092158448, 'fraction_numerical': 0.0016168148746968471, 'mean_word_length': 4.769230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1284625', 'n_tokens_mistral': 723, 'n_tokens_neox': 688, 'n_words': 308}