FoPost.Content (FoPost v0.1.0)

Copy Markdown View Source

Builds the :content a post is created or updated with.

FoPost.Posts.create/2 accepts any of these shapes and normalises them for you, so reach for this module only when you want to build the blocks yourself:

FoPost.Content.text("One post")
FoPost.Content.thread(["First", "Second", "Third"])

A block is a map of text plus an optional list of media, each item a map of type ("image", "video", or "gif"), name, and url.

Summary

Functions

One block holding a single piece of text.

One block per entry, in order — a thread.

Functions

text(text)

@spec text(String.t()) :: [map()]

One block holding a single piece of text.

thread(entries)

@spec thread([String.t() | map() | FoPost.ContentBlock.t()]) :: [map()]

One block per entry, in order — a thread.