cable8mm/toc
最新稳定版本:v1.3.0
Composer 安装命令:
composer require cable8mm/toc
包简介
The TOC is an opinionated table of contents generator.
README 文档
README
The TOC is a library for the project document2.
Features
- Laravel toc
- Samsung Tizen toc
- Naver clova ai toc
- Rhymix toc
Installation
composer require cable8mm/toc
Usage
namespace Cable8mm\Toc; $markdown = ' - ## Prologue - [Release Notes](/docs/{{version}}/releases) - [Upgrade Guide](/docs/{{version}}/upgrade) - [Contribution Guide](/docs/{{version}}/contributions) - ## Getting Started - [Installation](/docs/{{version}}/installation) - [Configuration](/docs/{{version}}/configuration) '; $lines = Toc::of($markdown)->getLines(); foreach ($lines as $line) { // example "- ## Prologue" // example " - [Release Notes](/docs/{{version}}/releases)" print $line->getTitle().PHP_EOL; //=> "Prologue" //=> "Release Notes" print $line->getLink().PHP_EOL; //=> null //=> "/docs/{{version}}/releases" print $line->getType().PHP_EOL; //=> ItemEnum::section //=> ItemEnum::page print $line->getDepth().PHP_EOL; //=> 1 //=> 2 }
Testing
composer test
Formatting
composer lint # Modify all files to comply with the PSR-12. composer inspect # Inspect all files to ensure compliance with PSR-12.
License
The Document2 project is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-26