Skip to main content
This release is 1 version behind 0.1.1 — the latest version of @fedify/botkit. Jump to latest

@fedify/botkit@0.1.0-dev.71+2449c2d9
Built and signed on GitHub Actions

A framework for creating ActivityPub bots

This package works with Deno
This package works with Deno
JSR Score
88%
Published
2 weeks ago (0.1.0-dev.71+2449c2d9)
interface Text

A tree structure representing a text with formatting. It does not only render the text but also extract tags (e.g., mentions) from it.

Type Parameters

TType extends "block" | "inline"
TContextData

The type of the context data.

Properties

readonly
type: TType

The type of the text. It can be either "block" or "inline".

Methods

getHtml(session: Session<TContextData>): AsyncIterable<string>

Render a text tree as HTML.

getTags(session: Session<TContextData>): AsyncIterable<Link>

Extract tags (e.g., mentions) from a text tree.

Gets cached objects. The result of this method depends on whether getHtml or getTags has been called before. It's used for optimizing the post rendering process, e.g., reusing once fetched remote objects.

Add Package

deno add jsr:@fedify/botkit

Import symbol

import { type Text } from "@fedify/botkit/text";

---- OR ----

Import directly with a jsr specifier

import { type Text } from "jsr:@fedify/botkit/text";