定制 nanoblocktech/markdown 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

nanoblocktech/markdown

最新稳定版本:1.6.3

Composer 安装命令:

composer require nanoblocktech/markdown

包简介

PHP parsedown plugin to allow video and table of content.

README 文档

README

PHP Markdown is an extension of Parsedown, to embed video and audio in markdown formatting. Additionally, it supports creating a table of contents and automatically inserts target="_blank" anchor if links don't match your hostname.

composer install nanoblocktech/markdown

Initialize markdown.

$markdown = new Markdown();

Audio Embedding

{Description}(audio)(/path/to/audio.opus)

Video Embedding

{Description}(video)(/path/to/video.mp4)

Configure markdown

// Enable table of contents
$markdown->tableOfContents(true);

// Enable responsive HTML table
$markdown->responsiveTable(true);

// Set heading to allow in the table of contents
$markdown->setHeadings(['h1', 'h2']);

// Set id prefix for table of contents 
$markdown->setIdPrefix('my-contents-');

// Add a base link to markdown
$markdown->setLink('https://example.com/assets/');

// Set media type
$markdown->setMediaType('audio', 'audio/ogg; codecs=opus');
$markdown->setMediaType('video', 'video/mp4');

// Get table of contents
$arry = $markdown->getTableOfContents();

Display your markdown text

$markdown->text('### Hello');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-09