# ContentCompiler

Utilclass for compiling

## Constructor

#### new ContentCompiler($, logger)

##### Parameters:

`$` ( cheerio )
`logger` ( Logger )

Source:
  - lib/ContentCompiler.js, line 31

### Members

#### (static, constant) ALIGNMENT :string

##### Properties:

Name | Type | Description
--- | --- | ---
`LEFT` | string | .float-left
`CENTER` | string | .mx-auto
`RIGHT` | string | .float-right

Source:
  - lib/ContentCompiler.js, line 9

#### (private) _$ :cheerio

Source:
  - lib/ContentCompiler.js, line 37

#### (private) _logger :Logger

Source:
  - lib/ContentCompiler.js, line 43

### Methods

#### (private) ._createTable() → {Object}

Creates a table with all required childs

Source:
  - lib/ContentCompiler.js, line 390

#### (private) ._generateGrid(rowSrc, columns, isLG) → {cheerio}

Generates markup for a grid

##### Parameters:

`rowSrc` ()
`columns` ()
`isLG` ()

Source:
  - lib/ContentCompiler.js, line 305

#### (private) .align(direction)

Handles floats and centered elements

##### Parameters:

`direction` ( ALIGNMENT )

Source:
  - lib/ContentCompiler.js, line 157

#### .body()

Wraps body-content

Source:
  - lib/ContentCompiler.js, line 264

#### .component(selector, addonsopt)

Ensures that all components with given selector (class in most cases) are tables

##### Parameters:

`selector` ( string )
`addons` ( object ) <optional>

ElementHelper.wrap

Source:
  - lib/ContentCompiler.js, line 283

#### .container(widthopt)

Wraps and replaces container

##### Parameters:

`width` ( number ) <optional>

Source:
  - lib/ContentCompiler.js, line 243

#### (private) .div()

Replaces all divs with tables

Source:
  - lib/ContentCompiler.js, line 55

#### (private) .grid(columns)

Replaces rows and columns to tables and set according separators

##### Parameters:

`columns` ( number )

Amount of allowed columns in a row

Source:
  - lib/ContentCompiler.js, line 225

#### .hr()

Replaces all hr tags with the according hr-template

Source:
  - lib/ContentCompiler.js, line 271

#### (private) .margin()

Replaces all margin classes to equivalent spacer elements

Source:
  - lib/ContentCompiler.js, line 83

#### (private) .padding()

Handles all padding classes. If padding-element is not a table, wrap a table around

Source:
  - lib/ContentCompiler.js, line 115

#### (private) .preview()

Replaces preview tag with hidden div and extend content to 100 characters

Source:
  - lib/ContentCompiler.js, line 208

#### (private) .table()

Adds border, cellspacing and cellpadding attributes to all table elements

Source:
  - lib/ContentCompiler.js, line 193