承接 hyn/eloquent-markdown 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

hyn/eloquent-markdown

Composer 安装命令:

composer require hyn/eloquent-markdown

包简介

Mix markdown, frontmatter and eloquent models to easily handle markdown files with meta information by treating them as objects.

README 文档

README

GitHub license Latest Stable Version Build Status Total Downloads Donate

Ever felt like your markdown files could use meta information.. And once you've added frontmatter logic, whether it would be amazing to handle those files more humanely..

So let's combine markdown files, frontmatter and eloquent!

That something like the below:

{
  "title": "Some elaborate .."
}
And of course your regular markdown nonsense.

Mutates into an object:

echo $page->title; // Some elaborate ..
echo $page->getRenderedMarkdown(); // <p>And of course your regular markdown nonsense.</p>
echo $page->getMarkdown(); // And of course your regular markdown nonsense.
$page->setMarkdown('Foojaa'); // Yes update
$page->markdown = 'Foobar'; // Or on the assigned property
$page->save(); // Write the file to disk, YES!

Installation

composer require hyn/eloquent-markdown

Now create a model you want to use for markdown files:

class Page extends \Hyn\Eloquent\Markdown\Model
{}

And setup the filesystem and markdown parser resolution, add in AppServiceProvider or somewhere:

use Hyn\Eloquent\Markdown\Model;
use Hyn\Frontmatter\Parser;
use cebe\markdown\Markdown;

// ..

public function register() {
            Model::setMarkdownParser(new Parser(new Markdown));
            Model::setFilesystem($this->app->make('filesystem')->disk('content'));
}

Set content to the disk you configured to load the markdown files from. Or instantiate your own filesystem instance.

Usage

So if you have a file some/foo.md, use Page::find('some/foo.md'); to create a Page object, where any frontmatter meta information is stored as properties, the markdown contents are stored in the original state as the markdown property and the generated html is assigned to the contents attribute.

Other stuff that works:

  • save()
  • delete()
  • update the markdown property to renew the rendered content property automatically

hyn/eloquent-markdown 适用场景与选型建议

hyn/eloquent-markdown 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 143 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 hyn/eloquent-markdown 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hyn/eloquent-markdown 我们能提供哪些服务?
定制开发 / 二次开发

基于 hyn/eloquent-markdown 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 143
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-14