mdimport

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mdimport 为 converter 注册 Markdown→OFD 导入器(输入格式 "markdown")。

该包依赖 internal/layout 与 goldmark,单独成包是为了让只做 OFD→X 的使用方 不必链接这些依赖;需要 Markdown→OFD 时按空白导入启用:

import _ "github.com/zc310/ofd/pkg/converter/mdimport"

之后即可使用 converter.Convert("md", "ofd", ...)。出于安全和确定性考虑, 远程图片不会被下载,只在日志中给出警告。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(input any, output io.Writer) error

Convert 将 Markdown 输入转换为 OFD,input 支持文件路径、[]byte 或 io.Reader。 传入文件路径时会以该文件所在目录解析相对图片路径。

func ConvertFile

func ConvertFile(mdPath, ofdPath string) error

ConvertFile 是 Convert 的按路径便捷形式。

Types

This section is empty.

Jump to

Keyboard shortcuts

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