mdto

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 1 Imported by: 0

README

mdto

Go Reference

Go

A simple markdown converter that parses markdown into an AST and renders it into HTML. It supports basic markdown syntax, including headings, lists, links, images, code blocks, and more.

Installation

go get github.com/hsm-gustavo/mdto

Usage

package main

import (
	"log"
	"os"

	"github.com/hsm-gustavo/mdto/renderer"
)

func main() {
	markdownContent := "# Hello, World!\n\nThis is a simple markdown file."

	r := renderer.NewHTMLRenderer()

	html := r.RenderMarkdown(markdownContent)

	os.WriteFile("./examples/EXAMPLE.html", []byte(html), 0644)
	log.Println("HTML gerado com sucesso em ./examples/EXAMPLE.html")
}

or using the high-level function:

package main

import (
    "log"
    "os"

    "github.com/hsm-gustavo/mdto"
)

func main() {
    markdownContent := "# Hello, World!\n\nThis is a simple markdown file."

    html := mdto.HTML(markdownContent)

    os.WriteFile("./examples/EXAMPLE.html", []byte(html), 0644)
    log.Println("HTML gerado com sucesso em ./examples/EXAMPLE.html")
}

TODO

  • Add support for tables and other advanced markdown features.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTML

func HTML(markdownContent string) string

Converte o conteúdo Markdown em HTML usando a pipeline completa: tokenização, parsing e renderização.

Types

This section is empty.

Directories

Path Synopsis
cmd
mdconv command

Jump to

Keyboard shortcuts

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