drafty

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: GPL-3.0 Imports: 4 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 interface{}) (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 interface{}, length int) (string, error)

Preview shortens Drafty to the specified length (in runes), 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