drafty

package
v0.0.0-...-b289748 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package drafty contains utilities for conversion from Drafty to plain text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PlainText

func PlainText(content any) (string, error)

PlainText converts drafty document to plain text with some basic markdown-like formatting. Deprecated: use Preview for new development.

func Preview

func Preview(content any, length int) (string, error)

Preview shortens Drafty to the specified length (in graphemes), removes quoted text, leading line breaks, and large content from entities making them suitable for a one-line preview, for example for showing in push notifications. The return value is a Drafty document encoded as JSON string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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