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

@fedify/botkit@0.2.0-dev.77+d1f283de
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.2.0-dev.77+d1f283de)
function text
text<TContextData>(
strings: TemplateStringsArray,
...values: unknown[],
): Text<"block", TContextData>

A template string tag that creates a Text tree.

Basically, it only interpolates values into the template string and escapes HTML characters, except for line breaks and paragraphs. For example, the below code:

text`Hello, <${em("World")}>!\n\nGoodbye!`

will be rendered as:

<p>Hello, &lt;<em>World</em>&gt;!</p>
<p>Goodbye!</p>

Type Parameters

TContextData

The type of the context data.

Parameters

strings: TemplateStringsArray

The template strings.

...values: unknown[]

Return Type

Text<"block", TContextData>

A Text tree.

Add Package

deno add jsr:@fedify/botkit

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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