markdown

package
v0.0.0-...-83979ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package markdown 提供Markdown渲染工具 创建者:Done-0 创建时间:2025-08-13

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMarkdownRenderer

func NewMarkdownRenderer(config MarkdownConfig) goldmark.Markdown

NewMarkdownRenderer 创建一个新的 Markdown 渲染器 参数:

  • config: Markdown配置

返回值:

  • goldmark.Markdown: Markdown渲染器

func RenderMarkdown

func RenderMarkdown(content []byte) (string, error)

RenderMarkdown 将 Markdown 渲染为 HTML 参数:

  • content: Markdown内容

返回值:

  • string: 渲染后的 HTML
  • error: 渲染过程中的错误

Types

type MarkdownConfig

type MarkdownConfig struct {
	Extensions      []goldmark.Extender // Goldmark 扩展
	ParserOptions   []parser.Option     // 解析器选项
	RendererOptions []renderer.Option   // 渲染器选项
}

MarkdownConfig 用于配置 Goldmark 渲染器

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL