Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xianyunyh/parse-hexo
解析hexo的post的markdown文件
https://github.com/xianyunyh/parse-hexo
Last synced: 8 days ago
JSON representation
解析hexo的post的markdown文件
- Host: GitHub
- URL: https://github.com/xianyunyh/parse-hexo
- Owner: xianyunyh
- Created: 2017-11-19T13:43:39.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-27T05:24:26.000Z (almost 7 years ago)
- Last Synced: 2024-10-11T20:14:46.867Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
## 解析hexo的post的markdown文件。
依赖**erusev/parsedown** 和 **yaml**
```shell
composer install
```测试实例
```php
$file = "./crontab.md";
$parse = new \XianYun\ParseHexo($file);
$header = $parse->getHeader();//markdown header中yaml数据
$content = $parse->getContent();//正文内容
$Parsedown = new \Parsedown();// 利用parsemarkdown 解析正文
$content = $Parsedown->text($content);
```