Skip to content

API

A simple HTML to Gemtext converter.

Options

Bases: NamedTuple

Configuration options for the converter.

space_after_paragraphs class-attribute instance-attribute

space_after_paragraphs: bool = True

Whether to add an empty line after paragraphs.

html_to_gemtext

html_to_gemtext(
    html_content: str, options: Options | None = None
) -> str

Convert HTML content to Gemtext.

Parameters:

Name Type Description Default

html_content

str

The HTML content to convert.

required

options

Options | None

Optional conversion options.

None

Returns:

Type Description
str

The converted Gemtext content.