定制 datomatic/nova-markdown-tui 二次开发

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

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

datomatic/nova-markdown-tui

Composer 安装命令:

composer require datomatic/nova-markdown-tui

包简介

A Laravel Nova field for markdown management via ToastUI editor.

README 文档

README

Latest Version on Packagist Software License Total Downloads

A markdown editor field for Laravel Nova based on Toast UI Editor with automatic theme switch.

Nova Markdown Toast UI Screenshot Light Nova Markdown Toast UI Screenshot Dark

Contents

Installation

You can install the package via composer:

composer require datomatic/nova-markdown-tui

The package will automatically register itself.

You can publish the config file with:

php artisan vendor:publish --provider="Datomatic\NovaMarkdownTui\FieldServiceProvider" --tag="config"

Usage

You can use the Datomatic\NovaMarkdownTui\ToastUiEditor field in your Nova resource:

<?php

namespace App\Nova;

use Datomatic\NovaMarkdownTui\MarkdownTui;
use Illuminate\Http\Request;

class BlogPost extends Resource
{
    // ...

    public function fields(Request $request)
    {
        return [
            // ...

            MarkdownTui::make('Content'),

            // ...
        ];
    }

}

Configuration

You may configure the underlying Toast UI Editor instance with the following field's methods. Checkout Toast UI - Vue Editor documentation.

You may also configure defaults in the config file.

initialEditType

initialEditType(\Datomatic\NovaMarkdownTui\Enums\EditorType::MARKDOWN)

options

minHeight(string $minHeight)

language(string $language)

useCommandShortcut(bool $useCommandShortcut = true)

hideModeSwitch(bool $hideModeSwitch = true)

toolbarItems(array $toolbarItems)

plugins

plugins(array $plugins)

Allowed values are:

  • chart
  • uml
  • colorSyntax
  • codeSyntaxHighlight
  • tableMergedCell

height

height(string $height)

previewStyle

previewStyleVertical()

previewStyleTab()

Allow iframe in markdown/html

allowIframe(bool $allowIframe = true)

Media upload

You can choose to enable upload of media directly from the editor. The blob of the file will be sent to and endpoint of your choice (eventually with some additional headers that you can choose, to increase security).

To achieve that, you have to set the configs in config/nova-markdown-tui.php accordingly:

'mediaUploadUrl' => '/api/nova-markdown-tui/upload', // put your endpoint, or null to disable upload
'mediaUploadHeaders' => [
    'X-Secret-Key' => 'super-secret-token', // if you prefer to protect the endpoint
],

In this way, you can store your file as you want: local storage, remote services, ....

The file will be sent as a POST request with Content-Type multipart/form-data, with the file in file field of the body. The endpoint should respond with status 200 and a JSON body with the following structure:

{
  "url": "https://datomatic.io/files/image.jpg",
  "alt": "Optional, alt text"
}

If alt is provided, it will overwrite the "Description" field typed by the user in the editor. Keep it empty if you want to use what the user prompted.

Changelog

Please see CHANGELOG for more information on recent changes.

Security

If you discover any security related issues, please email roberto@datomatic.io instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

datomatic/nova-markdown-tui 适用场景与选型建议

datomatic/nova-markdown-tui 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 49.19k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2022 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「markdown」 「nova」 「laravel」 「field」 「fields」 「toast-ui」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 4
  • 开发语言: JavaScript

其他信息

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