An open API service indexing awesome lists of open source software.

https://github.com/jbzoo/markdown

Rendering markdown from PHP code
https://github.com/jbzoo/markdown

jbzoo markdown php readme rendering text

Last synced: about 1 year ago
JSON representation

Rendering markdown from PHP code

Awesome Lists containing this project

README

          

# JBZoo / Markdown

[![CI](https://github.com/JBZoo/Markdown/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Markdown/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Markdown/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Markdown?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Markdown/coverage.svg)](https://shepherd.dev/github/JBZoo/Markdown) [![Psalm Level](https://shepherd.dev/github/JBZoo/Markdown/level.svg)](https://shepherd.dev/github/JBZoo/Markdown) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/markdown/badge)](https://www.codefactor.io/repository/github/jbzoo/markdown/issues)
[![Stable Version](https://poser.pugx.org/jbzoo/markdown/version)](https://packagist.org/packages/jbzoo/markdown/) [![Total Downloads](https://poser.pugx.org/jbzoo/markdown/downloads)](https://packagist.org/packages/jbzoo/markdown/stats) [![Dependents](https://poser.pugx.org/jbzoo/markdown/dependents)](https://packagist.org/packages/jbzoo/markdown/dependents?order_by=downloads) [![GitHub License](https://img.shields.io/github/license/jbzoo/markdown)](https://github.com/JBZoo/Markdown/blob/master/LICENSE)

### Installing

```sh
composer require jbzoo/markdown
```

### Usage

#### Rendering Table

```php
addAutoIndex('Index', 999)
->setHeaders(['Header #1', 'Header #2'])
->setAlignments([Table::ALIGN_CENTER, Table::ALIGN_RIGHT])
->appendRow(['123', '456'])
->appendRows([
['789_1', '9871'],
['789_2', '']
])
->render();
```

Result

```
| Index | Header #1 | Header #2 |
|------:|:---------:|----------:|
| 999 | 123 | 456 |
| 1000 | 789_1 | 9871 |
| 1001 | 789_2 | |
```

See Live Example

| Index | Header #1 | Header #2 |
|------:|:---------:|----------:|
| 999 | 123 | 456 |
| 1000 | 789_1 | 9871 |
| 1001 | 789_2 | |

#### Rendering other tags
```php
Quote LIne 1
// > Quote LIne 2
// > Quote LIne 3
Markdown::blockquote(["Quote LIne 1\nQuote LIne 2\nQuote LIne 3"]);
Markdown::blockquote(['Quote LIne 1', 'Quote LIne 2', 'Quote LIne 3'])

//
// Quote Text
//
// Some hidden text
//
//
Markdown::spoiler('Quote Text', 'Some hidden text');

// ```php
//