cebe/markdown-latex
Composer 安装命令:
composer require cebe/markdown-latex
包简介
A super fast, highly extensible markdown parser for PHP, that converts markdown files into latex
README 文档
README
A markdown parser for converting markdown to LaTeX written in PHP.
Implementation based on cebe/markdown.
Installation
PHP 5.4 or higher is required to use it.
Installation is recommended to be done via composer by adding the following to the require section in your composer.json:
"cebe/markdown-latex": "*"
Run composer update afterwards.
Usage
In your PHP project
To use the parser as is, you just create an instance of a provided flavor class and call the parse()-
or parseParagraph()-method:
// default markdown and parse full text $parser = new \cebe\markdown\latex\Markdown(); $parser->parse($markdown); // use github $parser = new \cebe\markdown\latex\GithubMarkdown(); $parser->parse($markdown); // parse only inline elements (useful for one-line descriptions) $parser = new \cebe\markdown\latex\GithubMarkdown(); $parser->parseParagraph($markdown);
The command line script
You can use it to render this readme:
bin/markdown-latex README.md > output.tex
Using github flavored markdown:
bin/markdown-latex --flavor=gfm README.md > output.tex
or convert the original markdown description to html using the unix pipe:
curl http://daringfireball.net/projects/markdown/syntax.text | bin/markdown-latex > output.tex
To create a latex document you have to include the generated latex source in a latex document main.tex:
\documentclass[a4paper, 12pt]{article} % english and utf8 \usepackage[british]{babel} \usepackage[utf8]{inputenc} % url support \usepackage{url} % make links clickable \usepackage{hyperref} % code listings \usepackage{listings} % include images \usepackage{graphicx} % better tables using tabularx \usepackage{tabularx} % support github markdown strikethrough % http://tex.stackexchange.com/questions/23711/strikethrough-text \usepackage{ulem} \begin{document} \include{output.tex} \end{document}
make a PDF with pdflatex main.tex.
cebe/markdown-latex 适用场景与选型建议
cebe/markdown-latex 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 778.76k 次下载、GitHub Stars 达 50, 最近一次更新时间为 2014 年 04 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「markdown」 「extensible」 「latex」 「fast」 「gfm」 「markdown-extra」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cebe/markdown-latex 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cebe/markdown-latex 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cebe/markdown-latex 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
LaTeX formula to PNG
PHP library for (La)TeX abstraction
An extensible DTO library that allows map incoming API data to any of your entities/models by using a simple filed mapping language with filters and functions.
Adds more BBCode
Extensible search for Elemental.
统计信息
- 总下载量: 778.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 51
- 点击次数: 18
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-04-28