{"id":47922815,"url":"https://github.com/indaco/herald-md","last_synced_at":"2026-04-04T06:19:01.911Z","repository":{"id":347971161,"uuid":"1193065553","full_name":"indaco/herald-md","owner":"indaco","description":"Render Markdown to the terminal with herald's full theming and composability.","archived":false,"fork":false,"pushed_at":"2026-03-30T08:04:30.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T10:08:29.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/indaco/herald","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indaco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T20:53:50.000Z","updated_at":"2026-03-30T08:04:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/indaco/herald-md","commit_stats":null,"previous_names":["indaco/herald-md"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/indaco/herald-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fherald-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fherald-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fherald-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fherald-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indaco","download_url":"https://codeload.github.com/indaco/herald-md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fherald-md/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31389691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T06:19:01.221Z","updated_at":"2026-04-04T06:19:01.897Z","avatar_url":"https://github.com/indaco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  herald-md\n\u003c/h1\u003e\n\n\u003ch2 align=\"center\" style=\"font-size: 1.5rem;\"\u003e\n    Render Markdown to the terminal with herald's full theming and composability.\n\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/indaco/herald-md/actions/workflows/ci.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/indaco/herald-md/actions/workflows/ci.yml/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/indaco/herald-md\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/indaco/herald-md/branch/main/graph/badge.svg\" alt=\"Code coverage\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/indaco/herald-md\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://goreportcard.com/badge/github.com/indaco/herald-md\" alt=\"Go Report Card\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/indaco/herald-md/actions/workflows/security.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/indaco/herald-md/actions/workflows/security.yml/badge.svg\" alt=\"Security Scan\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/indaco/herald-md/releases\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/tag/indaco/herald-md?label=version\u0026sort=semver\u0026color=4c1\" alt=\"version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/indaco/herald-md\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/indaco/herald-md.svg\" alt=\"Go Reference\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"LICENSE\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-mit-blue?style=flat-square\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\u003ca href=\"#when-to-use-herald-md\"\u003eWhen to use\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#supported-elements\"\u003eElements\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#theming\"\u003eTheming\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#custom-goldmark-extensions\"\u003eExtensions\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#composing-with-herald\"\u003eComposing\u003c/a\u003e\u003c/b\u003e |\n  \u003cb\u003e\u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n\nherald-md parses Markdown with [goldmark](https://github.com/yuin/goldmark) (CommonMark + GFM) and renders it to the terminal through [herald](https://github.com/indaco/herald)'s typography system - themed headings, styled code blocks, tables, alerts, and more, all controlled by a single `Typography` instance.\n\n## When to use herald-md\n\n[glamour](https://github.com/charmbracelet/glamour) is an excellent library for rendering Markdown in the terminal.\n\nherald-md takes a different approach. Paired with [herald](https://github.com/indaco/herald), it gives you a full typography layer where Markdown is one input format among many. Use it when:\n\n- You want **one theme for your entire CLI or TUI** - pick a built-in theme (Dracula, Catppuccin, Base16, Charm) or define your own, and both Markdown and programmatic output use it automatically - no separate style configuration needed.\n- You need **fine-grained customization** - functional options and `ColorPalette` give you full control over every element.\n- You are **mixing Markdown with programmatic elements** - `Render` returns a plain string you can pass directly to herald's [`Compose`](https://github.com/indaco/herald#composing-elements) alongside other herald calls.\n\n## Installation\n\nRequires Go 1.25+.\n\n```sh\ngo get github.com/indaco/herald-md@latest\n```\n\n## Quick Start\n\n\u003e [!NOTE]\n\u003e The Go module path is `github.com/indaco/herald-md` but the package name is `heraldmd`. Use an import alias: `heraldmd \"github.com/indaco/herald-md\"`.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    \"github.com/indaco/herald\"\n    heraldmd \"github.com/indaco/herald-md\"\n)\n\nfunc main() {\n    source, _ := os.ReadFile(\"doc.md\")\n    ty := herald.New()\n    fmt.Println(heraldmd.Render(ty, source))\n}\n```\n\n## Supported elements\n\n| Element             | Markdown syntax       | Herald method                                     |\n| ------------------- | --------------------- | ------------------------------------------------- |\n| Headings H1–H6      | `# H1` … `###### H6`  | `H1()` – `H6()`                                   |\n| Paragraph           | plain text            | `P()`                                             |\n| Blockquote          | `\u003e text`              | `Blockquote()`                                    |\n| Fenced code block   | ` ```lang `           | `CodeBlock(code, lang)`                           |\n| Indented code block | 4-space indent        | `CodeBlock(code)`                                 |\n| Horizontal rule     | `---`                 | `HR()`                                            |\n| Unordered list      | `- item`              | `UL()` / `NestUL()`                               |\n| Ordered list        | `1. item`             | `OL()` / `NestOL()`                               |\n| Bold                | `**text**`            | `Bold()`                                          |\n| Italic              | `*text*`              | `Italic()`                                        |\n| Strikethrough       | `~~text~~`            | `Strikethrough()`                                 |\n| Inline code         | `` `code` ``          | `Code()`                                          |\n| Link                | `[label](url)`        | `Link(label, url)`                                |\n| Autolink            | `\u003chttps://...\u003e`       | `Link(url)`                                       |\n| Image               | `![alt](url)`         | `Link(alt, url)` (terminals cannot render images) |\n| GFM table           | pipe table syntax     | `Table()` / `TableWithOpts()`                     |\n| GitHub alert        | `\u003e [!NOTE]` etc.      | `Alert()` / `Note()` / `Tip()` etc.               |\n| Definition list \\*  | `Term` + `:  desc`    | `DL()`                                            |\n| Footnote ref \\*     | `[^1]`                | `FootnoteRef()`                                   |\n| Footnote section \\* | `[^1]: text`          | `FootnoteSection()`                               |\n| Inline quotation    | `\u003cq\u003etext\u003c/q\u003e`         | `Q()`                                             |\n| Citation            | `\u003ccite\u003etext\u003c/cite\u003e`   | `Cite()`                                          |\n| Sample output       | `\u003csamp\u003etext\u003c/samp\u003e`   | `Samp()`                                          |\n| Variable            | `\u003cvar\u003etext\u003c/var\u003e`     | `Var()`                                           |\n| Keyboard key        | `\u003ckbd\u003etext\u003c/kbd\u003e`     | `Kbd()`                                           |\n| Highlight           | `\u003cmark\u003etext\u003c/mark\u003e`   | `Mark()`                                          |\n| Inserted text       | `\u003cins\u003etext\u003c/ins\u003e`     | `Ins()`                                           |\n| Deleted text        | `\u003cdel\u003etext\u003c/del\u003e`     | `Del()`                                           |\n| Subscript           | `\u003csub\u003etext\u003c/sub\u003e`     | `Sub()`                                           |\n| Superscript         | `\u003csup\u003etext\u003c/sup\u003e`     | `Sup()`                                           |\n| Abbreviation        | `\u003cabbr\u003etext\u003c/abbr\u003e`   | `Abbr()`                                          |\n| Underline           | `\u003cu\u003etext\u003c/u\u003e`         | `Underline()`                                     |\n| Small text          | `\u003csmall\u003etext\u003c/small\u003e` | `Small()`                                         |\n\nElements marked with **\\*** require enabling the corresponding goldmark extension via `NewRenderer`. All other elements work out of the box with the default GFM configuration.\n\n- Inline HTML tags (`\u003cq\u003e`, `\u003ccite\u003e`, `\u003csamp\u003e`, `\u003cvar\u003e`, `\u003ckbd\u003e`, `\u003cmark\u003e`, `\u003cins\u003e`, `\u003cdel\u003e`, `\u003csub\u003e`, `\u003csup\u003e`, `\u003cabbr\u003e`, `\u003cu\u003e`, `\u003csmall\u003e`, `\u003cb\u003e`, `\u003ci\u003e`, `\u003cs\u003e`, `\u003cem\u003e`, `\u003cstrong\u003e`, `\u003ccode\u003e`) are mapped to the corresponding herald method. Unknown HTML tags pass through as raw text.\n- Nested lists are automatically rendered with `NestUL`/`NestOL` when sub-lists are detected, falling back to flat `UL`/`OL` for simple lists.\n- Column alignment specified in GFM tables (`:-`, `:-:`, `-:`) is preserved via `WithColumnAlign`.\n\n## Theming\n\nPass any herald theme to `herald.New()` and all Markdown output will use it:\n\n```go\nty := herald.New(herald.WithTheme(herald.DraculaTheme()))\nfmt.Println(heraldmd.Render(ty, source))\n```\n\nCustom `ColorPalette` values and individual `With*` options work the same way - configure the `Typography` instance once and `Render` inherits everything.\n\n## Custom goldmark extensions\n\nUse `NewRenderer` to add goldmark extensions beyond the default GFM set:\n\n```go\nr := heraldmd.NewRenderer(\n    goldmark.WithExtensions(extension.Footnote),\n)\nfmt.Println(r.Render(ty, source))\n```\n\nThe package-level `Render` function uses a default renderer with GFM enabled.\n\n## Composing with herald\n\nBecause `Render` returns a string, it composes directly with other herald output via `ty.Compose`:\n\n```go\nty := herald.New()\n\npage := ty.Compose(\n    ty.H1(\"My App\"),\n    heraldmd.Render(ty, readmeBytes), // readmeBytes loaded via os.ReadFile(...)\n    ty.HR(),\n    ty.KVGroup([][2]string{\n        {\"Version\", \"1.0.0\"},\n        {\"License\", \"MIT\"},\n    }),\n)\n\nfmt.Println(page)\n```\n\n## Examples\n\nRunnable examples are in the [`examples/`](examples/) directory:\n\n### Core (`0xx`)\n\n| Example                                      | Description                                                                  | Run                                  |\n| -------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------ |\n| [000_render-file](examples/000_render-file/) | Render a Markdown file with the default theme; accepts any `.md` as argument | `go run ./examples/000_render-file/` |\n\n### Extensions (`1xx`)\n\nExamples in this range are separate Go modules with their own `go.mod` to keep extra dependencies out of herald-md's core. Run them with `cd` into the example directory first.\n\n| Example                                              | Description                                                         | Run                                           |\n| ---------------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------- |\n| [100_definition-list](examples/100_definition-list/) | Custom goldmark extension: definition lists rendered as herald `DL` | `cd examples/100_definition-list \u0026\u0026 go run .` |\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findaco%2Fherald-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findaco%2Fherald-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findaco%2Fherald-md/lists"}