<commit_before>Markdown Builder
================

[![Build Status](https://travis-ci.org/DavidBadura/markdown-builder.svg)](https://travis-ci.org/DavidBadura/markdown-builder)

A simple helper class to create markdown.

Installation
------------

```bash
composer require 'davidbadura/markdown-builder@dev'
```

Usage
-----

```php
$builder = new MarkdownBuilder();

$builder
    ->h1('Markdown Builder')
    ->p('A simple helper class to create markdown.')
    ->h2('Install ' . $builder->inlineBold('this') . ' powerfull library')
    ->code("composer require 'davidbadura/markdown-builder@dev'", 'bash')
    ->h2('Todos')
    ->bulletedList([
        'write tests',
        $builder
            ->markdown()
            ->numberedList(['A', 'B', 'C'])
        ,
        'add more markdown features'
    ]);
    
echo $builder->getMarkdown();
```

```markdown
Markdown Builder
================

A simple helper class to create markdown.

Install **this** powerfull library
----------------------------------

    ```bash
    composer require 'davidbadura/markdown-builder@dev'
    ```

Todos
-----
* write tests
* 1. A
  2. B
  3. C
* add more markdown features
```

API
---

The markdown builder have two kinds of elements, block and inline elements.
Block elements will be buffered and you can get the markdown if you call the method `getMarkdown()`.
All inline Elements are prefixed with `inline*` and you get instantly the markdown output.

### Block Elements

#### h1

PHP-Code:

```php
echo (new MarkdownBuilder())->h1('Hello World')->getMarkdown();
```

Markdown:

```markdown
Hello World
===========
```

#### h2

PHP-Code:

```php
echo (new MarkdownBuilder())->h2('Hello second world')->getMarkdown();
```

Markdown:

```markdown
Hello second world
------------------
```

#### h3

PHP-Code:

```php
echo (new MarkdownBuilder())->h3('My name is...')->getMarkdown();
```

Markdown:

```markdown
### My name is...
```

#### p

PHP-Code:

```php
echo (new MarkdownBuilder())->p('paragraph')->getMarkdown();
```

Markdown:

```markdown
paragraph
```

#### blockqoute

PHP-Code:

```php
echo (new MarkdownBuilder())->blockqoute("Foo\nBar\nBaz")->getMarkdown();
```

Markdown:

```markdown
> Foo
> Bar
> Baz
```

#### bulleted list

PHP-Code:

```php
echo (new MarkdownBuilder())->bulletedList(['Foo', 'Bar', 'Baz'])->getMarkdown();
```

Markdown:

```markdown
* Foo
* Bar
* Baz
```

#### numbered list

PHP-Code:

```php
echo (new MarkdownBuilder())->numberedList(['Foo', 'Bar', 'Baz'])->getMarkdown();
```

Markdown:

```markdown
1. Foo
2. Bar
3. Baz
```

#### hr

PHP-Code:

```php
echo (new MarkdownBuilder())->hr()->getMarkdown();
```

Markdown:

```markdown
------------------------
```

#### code

PHP-Code:

```php
echo (new MarkdownBuilder())->code('$var = "test";', 'php')->getMarkdown();
```

Markdown:

```markdown
    ```php
    $var = "test";
    ```
```

### Inline Blocks

#### bold

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineBold('Hey!')->getMarkdown();
```

Markdown:

```markdown
**Hey!**
```

#### italic

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineCode('huhu')->getMarkdown();
```

Markdown:

```markdown
*huhu*
```


#### code

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineCode('$var = "test";')->getMarkdown();
```

Markdown:

```markdown
`$var = "test";`
```

#### link

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineLink('http://google.de', 'Google')->getMarkdown();
```

Markdown:

```markdown
[Google](http://google.de)
```

#### img

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineImg('cat.jpg', 'Cat')->getMarkdown();
```

Markdown:

```markdown
![Cat](cat.jpg)
```<commit_msg>update documentation<commit_after>Markdown Builder
================

[![Build Status](https://travis-ci.org/DavidBadura/markdown-builder.svg)](https://travis-ci.org/DavidBadura/markdown-builder)

A simple helper class to create markdown.

Installation
------------

```bash
composer require 'davidbadura/markdown-builder@dev'
```

Usage
-----

```php
$builder = new MarkdownBuilder();

$builder
    ->h1('Markdown Builder')
    ->p('A simple helper class to create markdown.')
    ->h2('Install ' . $builder->inlineBold('this') . ' powerfull library')
    ->code("composer require 'davidbadura/markdown-builder@dev'", 'bash')
    ->h2('Todos')
    ->bulletedList([
        'write tests',
        $builder
            ->markdown()
            ->numberedList(['A', 'B', 'C'])
        ,
        'add more markdown features'
    ]);
    
echo $builder->getMarkdown();
```

```markdown
Markdown Builder
================

A simple helper class to create markdown.

Install **this** powerfull library
----------------------------------

    ```bash
    composer require 'davidbadura/markdown-builder@dev'
    ```

Todos
-----
* write tests
* 1. A
  2. B
  3. C
* add more markdown features
```

API
---

The markdown builder have two kinds of elements, block and inline elements.
Block elements will be buffered and you can get the markdown if you call the method `getMarkdown()`.
All inline Elements are prefixed with `inline*` and you get instantly the markdown output.

### Block Elements

#### h1

PHP-Code:

```php
echo (new MarkdownBuilder())->h1('Hello World')->getMarkdown();
```

Markdown:

```markdown
Hello World
===========
```

#### h2

PHP-Code:

```php
echo (new MarkdownBuilder())->h2('Hello second world')->getMarkdown();
```

Markdown:

```markdown
Hello second world
------------------
```

#### h3

PHP-Code:

```php
echo (new MarkdownBuilder())->h3('My name is...')->getMarkdown();
```

Markdown:

```markdown
### My name is...
```

#### p

PHP-Code:

```php
echo (new MarkdownBuilder())->p('paragraph')->getMarkdown();
```

Markdown:

```markdown
paragraph
```

#### blockqoute

PHP-Code:

```php
echo (new MarkdownBuilder())->blockqoute("Foo\nBar\nBaz")->getMarkdown();
```

Markdown:

```markdown
> Foo
> Bar
> Baz
```

#### bulleted list

PHP-Code:

```php
echo (new MarkdownBuilder())->bulletedList(['Foo', 'Bar', 'Baz'])->getMarkdown();
```

Markdown:

```markdown
* Foo
* Bar
* Baz
```

#### numbered list

PHP-Code:

```php
echo (new MarkdownBuilder())->numberedList(['Foo', 'Bar', 'Baz'])->getMarkdown();
```

Markdown:

```markdown
1. Foo
2. Bar
3. Baz
```

#### hr

PHP-Code:

```php
echo (new MarkdownBuilder())->hr()->getMarkdown();
```

Markdown:

```markdown
------------------------
```

#### code

PHP-Code:

```php
echo (new MarkdownBuilder())->code('$var = "test";', 'php')->getMarkdown();
```

Markdown:

```markdown
    ```php
    $var = "test";
    ```
```

### Inline Blocks

#### bold

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineBold('Hey!');
```

Markdown:

```markdown
**Hey!**
```

#### italic

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineCode('huhu');
```

Markdown:

```markdown
*huhu*
```


#### code

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineCode('$var = "test";');
```

Markdown:

```markdown
`$var = "test";`
```

#### link

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineLink('http://google.de', 'Google');
```

Markdown:

```markdown
[Google](http://google.de)
```

#### img

PHP-Code:

```php
echo (new MarkdownBuilder())->inlineImg('cat.jpg', 'Cat');
```

Markdown:

```markdown
![Cat](cat.jpg)
```
{'fraction_non_alphanumeric': 0.24668874172185432, 'fraction_numerical': 0.0041390728476821195, 'mean_word_length': 3.6677398583386993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 80, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1934024', 'n_tokens_mistral': 2656, 'n_tokens_neox': 2457, 'n_words': 583}