Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 source pure

Package mdtable provides a simple way to create Markdown tables.

Readme View source

gno.land/p/moul/mdtable/v0

Build Markdown tables.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.

Overview

Package mdtable provides a simple way to create Markdown tables.

Example usage:

Example
 1import "gno.land/p/moul/mdtable/v0"
 2
 3func Render(path string) string {
 4    table := mdtable.Table{
 5        Headers: []string{"ID", "Title", "Status", "Date"},
 6    }
 7    table.Append([]string{"#1", "Add a new validator", "succeed", "2024-01-01"})
 8    table.Append([]string{"#2", "Change parameter", "timed out", "2024-01-02"})
 9    return table.String()
10}

Output:

Example
1| ID | Title | Status | Date |
2| --- | --- | --- | --- |
3| #1 | Add a new validator | succeed | 2024-01-01 |
4| #2 | Change parameter | timed out | 2024-01-02 |

Types 1

type Table

struct
1type Table struct {
2	Headers []string
3	Rows    [][]string
4}
source

Methods on Table

func Append

method on Table
1func (t *Table) Append(row []string)
source

func String

method on Table
1func (t Table) String() string
source

Dependencies

Imports 1

/p/g1magld5ptgzaktqcexxq0pgq5lmdf0kz6re8hlv/mdtable/v0

Imported by indexer

Source Files 4