Skip to content

Commit fb1a67c

Browse files
committed
update readme
1 parent 6495399 commit fb1a67c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.MD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Package for generating table of contents for the text.
33

44
For example, you have next text:
5-
```
5+
```html
66
<h1>Header first level</h1>
77
Some text here
88
<h2>Header second level</h2>
@@ -42,20 +42,20 @@ composer require alutskevich/table-contents
4242
],
4343
```
4444
Then add the facade to your aliases array:
45-
```
45+
```php
4646
'aliases' => [
4747
...
4848
'TableContents' => Lutskevich\TOC\TableContentsServiceProvider::class,
4949
],
5050
```
5151
### Usage
52-
```
52+
```php
5353
//return string table contents
5454
TableContents::arrayTableContents($text);
5555
```
5656

5757
Table of contents have next structure:
58-
```
58+
```php
5959
"0": {
6060
"title": "Title",
6161
"link": "link"
@@ -94,7 +94,7 @@ Table of contents have next structure:
9494
* **link** - anchor link. If text have few same headers links of them will be
9595
`<link>-<number>` (for example: link-1, link-2, link-3).
9696

97-
```
97+
```php
9898
//Add ID attribute to the headers. Need for anchors.
9999
TableContents::setHeaderLinks($text)
100100
```

0 commit comments

Comments
 (0)