搜尋套件、儲存庫與 APP 分類

套件詳情v0.6.0

marker

markdown 庫的渲染器(印表機)。將解析的 AST 重新渲染成 markdown。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
4萬
喜歡數
5
Pub 分數
150

安裝套件

flutter pub add marker

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Marker 是一個 Flutter/Dart 套件,透過將解析的抽象語法樹(AST)轉換回 Markdown 文字來呈現 Markdown。它作為 markdown 庫的列印器,可準確重新輸出結構化 Markdown 內容。專為處理 Markdown 解析與轉換的開發者設計,確保從其 AST 表示重建 Markdown 時的完整性。該套件支援多個平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,適用於跨平台應用。

適用情境

  • 從解析的 AST 重建 Markdown
  • 在 Markdown 轉換過程中保留格式
  • 使用往返編輯構建 Markdown 編輯器
  • 從結構化數據生成 Markdown
  • 實現 Markdown 預覽功能

主要特色

  • 將 Markdown 解析反轉以產生原始文字
  • 維持原始格式和結構
  • 跨平台相容性
  • 輕量級且專注於渲染
  • 與 markdown 包整合

適合對象

  • Markdown 處理工具
  • 支援 Markdown 的程式碼編輯器
  • 文件生成器
  • 內容管理系統
  • 需要雙向 Markdown 處理的應用程式

使用建議

  • 需要 markdown 包用於 AST 輸入
  • 僅限渲染;不適用於解析
  • 不適用於HTML輸出
  • 最佳搭配其他 Markdown 工具使用
  • 無內建語法強調

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

marker

Marker is a Markdown renderer (printer) for Dart. It takes a list of Node objects produced by the parser and renders it back to a string.

Supported markdown flavors:

The renderer supports both inline and reference links and images.

Example
import 'dart:io';

import 'package:markdown/markdown.dart';
import 'package:marker/marker.dart';

/// Renders CHANGELOG.md with all links inline
void main() {
  final file = File('CHANGELOG.md');
  /// Contains parsed tree
  final nodes = Document().parseLines(file.readAsLinesSync());
  /// Contains markdown text
  final markdown = render(nodes);
  print(markdown);
}

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。