ai_post_content_update

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlocksToMarkdown

func BlocksToMarkdown(blocks []Block) string

BlocksToMarkdown converts a sequence of blocks back to markdown.

func MarkdownToRecordPost

func MarkdownToRecordPost(markdown, fallbackTitle string) blogai.RecordPost

MarkdownToRecordPost converts markdown content into a blogai.RecordPost structure that mirrors the block-based editor expectations (introduction, sections, conclusion). fallbackTitle is used when the markdown content does not contain a level-1 heading.

func RecordPostToMarkdown

func RecordPostToMarkdown(record blogai.RecordPost) string

RecordPostToMarkdown converts a RecordPost back to markdown text.

Types

type Block

type Block struct {
	ID   string
	Type BlockType
	Text string
}

func MarkdownToBlocks

func MarkdownToBlocks(markdown string) []Block

MarkdownToBlocks converts markdown into a flat list of sequential blocks. It preserves order and does not attempt to infer introduction/conclusion.

type BlockType

type BlockType string
const (
	BlockHeader1   BlockType = "h1"
	BlockHeader2   BlockType = "h2"
	BlockParagraph BlockType = "p"
	BlockCode      BlockType = "code"
)

type UiInterface

type UiInterface interface {
	shared.UiInterface
	AiPostContentUpdate(w http.ResponseWriter, r *http.Request)
}

UiInterface defines the ai post content update controller's UI interface

func UI

func UI(config shared.UiConfig) UiInterface

UI creates a new ai post content update controller UI from the given config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL