rias/statamic-markdown-highlight 问题修复 & 功能扩展

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

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

rias/statamic-markdown-highlight

最新稳定版本:v2.2.0

Composer 安装命令:

composer require rias/statamic-markdown-highlight

包简介

This Addon provides pre-rendered syntax highlighting based on highlight.js

README 文档

README

Warning

This package has been abandoned, use Statamic's markdown customization instead

Icon

Latest Version

Markdown Highlight

Markdown Syntax Highlighting for Statamic 3.

This Addon provides pre-rendered syntax highlighting based on Shiki, so no need for any extra JavaScript to get some color in your code samples!

Screenshot

Installation

Require it using Composer.

composer require rias/statamic-markdown-highlight

In your project, you should have the JavaScript package shiki installed. You can install it via npm

npm install shiki

or Yarn

yarn add shiki

Using Markdown Highlight

Fieldtype

Add the fieldtype to your fieldset.

sections:
  main:
    display: Main
    fields:
      -
        handle: code
        field:
          type: markdown_highlight
          display: Code

For other options, this fieldtype extends the default Statamic Markdown fieldtype.

Highlighting lines and other functionalities

Under the hood this package uses spatie/commonmark-shiki-highlighter, you can read those docs to see what else is possible.

Change default shiki theme

You need to publish the config file.

php artisan vendor:publish --tag=statamic-markdown-highlight-config --force

Go to config/statamic/markdown-highlight.php.

'theme' => 'github-light', // change this 

Check supported themes shiki themes.

Brought to you by Rias

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-13