sevenecks/markdown-terminal 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sevenecks/markdown-terminal

最新稳定版本:0.0.1

Composer 安装命令:

composer require sevenecks/markdown-terminal

包简介

convert markdown to terminal output in php

README 文档

README

This project is an extension of Markdown that adds the ability to convert markdown to terminal output instead of HTML.

This is just a little hobby project I wrote to support a terminal based markdown note taker in PHP. The conversion does it's best, but it's by no means complete or bug free. I'll improve it as my needs demand but use this at your own risk, and don't expect it to look super pretty at this point :)

You can use the setConfig function to set various config options for colorizing the output.

Installation

Via Composer

composer require sevenecks/markdown-terminal

Example Usage

<?php
// you must run this from the /example directory
//
require '../vendor/autoload.php';

$markdown = <<<EOT
# Headline 1
## Headline 2
### Headline 3
#### Headline 4
##### Headline 5
###### Headline 6

\```
protected function renderStrong($block)
{
    return \$this->colorize->bold(\$this->renderAbsy($block[1]));
}
\```

* One
* Two
* Five
    1. test
    2. test2

1. Four
2. Five
3. Six
    * Test
    * Test 2
    
* One
* Two
    * Four
        1. test
        2. test
            * test

> this is a test this is a test this is a test this is a test           this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test 
> test
> this is a test
> another test

>> test quote in quote, which doesn't currently work.

this is a **strong** text

this is some _emphasis_.

[I'm an inline-style link](https://www.github.com/sevenecks)

[I'm a relative reference to a repository file](../blob/master/LICENSE)

Inline-style: [Seven Ecks Git Hub Alt Text](http://www.github.com/sevenecks "Sevenecks GitHub Title")

[another example]: https://github.com/sevenecks "another example"

~~Strike Through~~

EOT;
$parser = new SevenEcks\Markdown\MarkdownTerminal;
echo $parser->parse($markdown);

Example Output

Known Issues

  1. quoted quotes do not work
  2. specifying a language after three backticks (`) does not work and will format weirdly.
  3. Every now and then wonkiness happens with list items
  4. strikethrough won't work on all terminal emulators

Change Log

Please see Change Log for more information.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 291
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-12