methorz/markme
最新稳定版本:1.0.0
Composer 安装命令:
composer require methorz/markme
包简介
MethorZ - Markdown Parser
关键字:
README 文档
README
MethorZ MarkMe is a powerful and flexible Markdown parser library for PHP. It allows you to convert Markdown text into HTML with ease.
Features
- Markdown Parsing: Convert Markdown text to HTML.
- Custom Renderers: Extend and customize the rendering of Markdown elements.
- PHP 8.3: Fully compatible with PHP 8.3.
Installation
You can install the package via Composer:
composer require methorz/markme
Usage Here's a basic example of how to use the MarkMe library:
<?php require 'vendor/autoload.php'; use MethorZ\MarkMe\Markdown; use MethorZ\MarkMe\Renderer\ParagraphRenderer; use MethorZ\MarkMe\Element\Paragraph; use MethorZ\MarkMe\Element\Inline\Text; $markdown = new Markdown(); // Optional: Set a custom renderer for the Paragraph element. $markdown->setRenderer(Paragraph::class, new ParagraphRenderer()); $text = new Text('This is a paragraph.'); $paragraph = new Paragraph($text); echo $markdown->render($paragraph);
Custom Renderers You can create custom renderers for different Markdown elements. Here's an example of a custom renderer for a horizontal rule:
<?php namespace MethorZ\MarkMe\Renderer; use MethorZ\MarkMe\Element\HorizontalRule; class HorizontalRuleRenderer { public function render(HorizontalRule $element): string { return '<hr />'; } }
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.
License
This project is licensed under the proprietary license. See the LICENSE file for more details.
Contact
For any inquiries, please contact MethorZ at methorz@spammerz.de.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2024-08-13