htmltext

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package htmltext turns an HTML document into markdown that reads like the page does: headings, paragraphs, nested lists, tables with their merged cells, code blocks, quotations, links and the description of pictures, without the scripts, styles, navigation and hidden elements around them.

It is for HTML as a document someone attached or a knowledge base ingests (a saved article, an exported report, a documentation page). It is not the way to read HTML as source code, where the tags are the point.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Markdown string
	Title    string // the <title>, also written as the first heading when the page has none of its own
}

Result is a converted document.

func Convert

func Convert(data []byte) (Result, error)

Convert reads an HTML document in any encoding it declares (or UTF-8) and returns its markdown.

Jump to

Keyboard shortcuts

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