editorial

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package editorial checks the words of an issue: subject, preheader, length, links, images, tone and the brief's own phrases. The server runs it on every issue before sending (a floor no newsletter goes below); a newsletter project runs it with its concept, so each issue is also held to its brief. Rules report, they never rewrite.

Index

Constants

View Source
const (
	DefaultMaxSubject = 60
	MaxPreheader      = 90 // characters a preview line shows (lfr:E126)
	HardMaxSubject    = 90
	DefaultMaxWords   = 3000
)

Defaults when there is no brief.

View Source
const (
	SubjectMissing     = "subject.missing"
	SubjectLength      = "subject.length"
	SubjectCaps        = "subject.caps"
	SubjectEmoji       = "subject.emoji"
	SubjectPunctuation = "subject.punctuation"
	SubjectDeceptive   = "subject.deceptive"
	PreheaderMissing   = "preheader.missing"
	PreheaderLength    = "preheader.length"
	PreheaderRepeat    = "preheader.repeat"
	LengthWords        = "length.words"
	LinksText          = "links.text"
	LinksCount         = "links.count"
	ImagesAlt          = "images.alt"
	ImagesOnly         = "images.only"
	Personalization    = "copy.tokens"
	CopyAvoid          = "copy.avoid"
	CopyUse            = "copy.use"
	CopySpammy         = "copy.spammy"
	CopyShouting       = "copy.shouting"
	ContentTeaser      = "content.teaser"
	StructureHeadings  = "structure.headings"
	StructureReply     = "structure.reply"
)

Rule IDs.

Variables

This section is empty.

Functions

func Check

func Check(w Issue, b Brief) []finding.Finding

Check runs every editorial rule on an issue.

func Rules

func Rules() []finding.Rule

Rules describes every editorial rule, the prose rules included.

Types

type Brief

type Brief struct {
	MaxSubject int
	MinWords   int
	MaxWords   int
	Use        []string
	Avoid      []string
}

Brief is what a concept says about each issue; zero values mean "no brief".

type Issue

type Issue struct {
	File      string // for findings; empty on the server
	Subject   string
	Preheader string
	Markdown  string
	Language  string
	Earlier   []prose.Earlier // issues already sent, for the repetition check
}

Issue is the text to check.

Jump to

Keyboard shortcuts

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