Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
peterujah authored Apr 11, 2024
1 parent 4ff2efd commit 209886c
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,36 @@
composer install nanoblocktech/markdown
```

Initialize markdown.

```php
$markdown = new Markdown();
```

$markdown->text('### Hello');
$markdown->enableTableOfContents(true);
Configure markdown

```php
// Enable table of contents
$markdown->tableOfContents(true);

// Set heading to allow in the table of contents
$markdown->setHeadings(['h1', 'h2']);

// Set id prefix for table of contents
$markdown->setIdPrefix('my-contents-');

// Add a base link to markdown
$markdown->setLink('https://example.com/assets/');

// Set media type
$markdown->setMediaType('audio/ogg; codecs=opus');

// Get table of contents
$arry = $markdown->getTableOfContents();
```

Display your markdown text

```php
$markdown->text('### Hello');
```

0 comments on commit 209886c

Please sign in to comment.