mdfence

package
v0.285.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mdfence lists the fenced code blocks of a Markdown message, in order: what the chief's session_context names a message's blocks by (docs/design/chief-in-agent-view.md, 4.1), so a kickoff written as one block (the handoff skill's) can be named {ref, block: k} instead of being copied.

It follows CommonMark's fenced code blocks where it matters for naming:

  • an opening fence is three or more backticks or tildes, indented at most three spaces, followed by an optional info string whose first word is the block's language (a backtick fence's info string has no backtick);
  • the block ends at a line of the SAME character, at least as long, with nothing else on it but spaces (indented at most three spaces);
  • a block never closed runs to the end of the message.

Everything else of Markdown — lists, quotes, indented code — is not parsed: a fence inside a list item indented four or more spaces is not a block here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Lang string
	Body string
	Line int
}

Block is one fenced code block: its language (the info string's first word, "" for none), its body without the fence lines, and where it starts (the opening fence's line, from 0).

func Blocks

func Blocks(text string) []Block

Blocks is text's fenced code blocks, in order.

Jump to

Keyboard shortcuts

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