Documentation
¶
Overview ¶
Package concept reads concept.md, the handover from the design phase to implementation, and checks it against the research it must stand on.
The file has fixed sections in a fixed order and free content inside them: the headings guarantee every decision is made, the words are the author's. Decisions cite research by ID (V012 for a voice, P003 for a peer), so every claim can be traced back to what real people wrote or what pages show.
Index ¶
- Constants
- Variables
- func Citations(text string) []string
- func Parse(text string) (Document, []Problem)
- func ParseFormat(text, title, placeholder string, sections []SectionSpec) (Document, []Problem)
- func Rules() []diagnostic.RuleInfo
- func StripCitations(text string) string
- type Document
- type Line
- type Problem
- type Report
- type Row
- type Section
- type SectionSpec
- type Summary
Constants ¶
const ( MinVoiceNotes = 8 MinPathSteps = 3 MinRejected = 2 MinFacts = 10 MinAxes = 5 MinSparks = 3 MaxSparks = 5 MinDirections = 8 MinSpine = 3 MinColors = 3 MinCopy = 3 )
Minimums each section must meet. The design skill prints the same numbers.
const ( RuleFormat = "concept.format" RuleEvidence = "concept.evidence" RuleDefaults = "concept.defaults" RuleGround = "concept.ground" RuleOpen = "concept.open" )
Rule IDs reported by Check.
const File = "concept.md"
File is concept.md in the project root.
Variables ¶
var Sections = []SectionSpec{ {"Diagnosis", true}, {"Voices", false}, {"Buyer", false}, {"Decision path", false}, {"Mechanism", false}, {"Offer", false}, {"Facts", false}, {"Axes", false}, {"Sparks", false}, {"Directions", false}, {"Concept", false}, {"Spine", false}, {"Palette", false}, {"Type", false}, {"Form", false}, {"Imagery", false}, {"Motion", false}, {"Copy", false}, {"Qualities", true}, {"Changelog", true}, }
Sections are the sections of concept.md in their required order.
Functions ¶
func ParseFormat ¶ added in v0.0.3
func ParseFormat(text, title, placeholder string, sections []SectionSpec) (Document, []Problem)
ParseFormat splits a concept-style file into the given sections. The first line must be title followed by a name; placeholder names it in messages.
func Rules ¶
func Rules() []diagnostic.RuleInfo
Rules describes the concept checks for the rule catalog.
func StripCitations ¶
StripCitations removes research IDs and the spaces they leave.
Types ¶
type Report ¶
type Report struct {
Diagnostics []diagnostic.Diagnostic
Summary Summary
}
Report is the result of checking concept.md.
func Check ¶
Check parses concept.md and checks it against the parsed research, which may be nil when the files are absent.
func CheckProject ¶ added in v0.1.9
func CheckProject(text string, voices *research.Voices, competitors *research.Competitors, p project.Project) Report
CheckProject also validates relative fact links against the confined project sources.
type Section ¶
Section is the content under one "## " heading.
func (*Section) Head ¶
Head returns the first line of the item starting at line n, without its list marker and continuation lines.
func (*Section) Items ¶
Items returns the list items of a section: lines starting with "- " or "1. ", with continuation lines joined. Other lines are ignored.
type SectionSpec ¶ added in v0.0.3
SectionSpec names one section of a format and whether it may be omitted.
type Summary ¶
type Summary struct {
Present bool `json:"present"`
Chosen string `json:"chosen,omitempty"` // the chosen direction
Voices int `json:"voices"` // distinct IDs cited
Peers int `json:"peers"`
Platforms int `json:"platforms"` // distinct platforms among cited voices
Colors int `json:"colors"`
Faces int `json:"typefaces"`
DeclaredColors []color.Color `json:"-"`
Families []string `json:"families,omitempty"`
Intensity string `json:"intensity,omitempty"`
Imagery int `json:"plannedImages"`
Open int `json:"openQuestions"`
Use []string `json:"use,omitempty"` // exact phrases the Copy section requires or forbids
Avoid []string `json:"avoid,omitempty"`
}
Summary describes a concept for the compile report.