samwilson / commonmark-latex
CommonMark的LaTeX渲染器。
0.4.2
2024-01-11 08:46 UTC
Requires
- league/commonmark: ^2.2
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/process: ^5.0
- symfony/var-dumper: ^5.4
- unleashedtech/php-coding-standard: ^3.1
README
这是一个扩展League/CommonMark的Markdown到LaTeX渲染的插件。
安装
使用Composer安装
$ composer require samwilson/commonmark-latex
用法
<?php $environment = new \League\CommonMark\Environment\Environment(); // Add the core extension. $environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension\CommonMarkCoreExtension()); // Add the LaTeX extension. $environment->addExtension(new \Samwilson\CommonMarkLatex\LatexRendererExtension()); $converter = new \League\CommonMark\MarkdownConverter($environment); $latex = $converter->convert('*Markdown* content goes here!')->getContent());
许可证
版权 © 2022 Sam Wilson https://samwilson.id.au/
本程序是免费软件:您可以重新分发和/或修改它,具体请参阅由自由软件基金会发布的GNU通用公共许可证的条款,无论是许可证的第3版,还是(根据您的选择)任何后续版本。
本程序分发时希望它能对您有所帮助,但没有任何保证;甚至没有关于其商业性或适用于特定目的的隐含保证。有关详细信息,请参阅GNU通用公共许可证。
您应已收到与该程序一起提供的GNU通用公共许可证副本。如果没有,请参阅https://gnu.ac.cn/licenses/
致谢
- 感谢League/CommonMark包(当然!)。
- Simple_shapes_example.png 由用户Scarce提供的测试图像属于公有领域。
- cebe/markdown-latex 提供了灵感和一些测试文件。