Generated from Go source

Go API reference

Exported declarations for github.com/tzfqh/gmdtable. This page is generated with the Go parser and documentation packages; internal site tooling is intentionally excluded.

import gmdtable "github.com/tzfqh/gmdtable"

Package gmdtable converts ordered column headers and map-backed row data into Markdown tables. Convert uses the header slice as both the table schema and the column order. Cell values are formatted with fmt's default representation, then structural Markdown table characters are escaped. The package performs no I/O and has no runtime dependencies outside the Go standard library.

Exported declarations

Follow a declaration link or browse the complete reference below. Signatures and prose come from the current public package source.

Function

Convert

func Convert(headers []string, data []map[string]interface{}) (string, error)

Convert returns a Markdown table containing headers and data. The order of headers determines the column order. Each row is read by header key, and values use fmt's default formatting. Pipes, backslashes, and line breaks are escaped so they remain within their cells. Columns are padded to their widest cell. Convert returns an error when headers or data is empty.

Need a runnable starting point? Read the source-derived examples or open the basic Go example on GitHub.