Skip to main content
Home
This release is a pre-release — the latest non-prerelease version of @fedify/botkit is 0.2.0. Jump to this version

@fedify/botkit@0.3.0-dev.98+52f74b3b
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
4 weeks ago (0.3.0-dev.98+52f74b3b)
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 | Object>

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.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

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";