Documentation
¶
Overview ¶
Package research reads a project's research files, checks their format and substance, and summarizes them. The format is the one the lfm-research skill writes; the skill's own examples are tested against this parser.
Structure lives only in lines that start with a heading marker, a field marker or a table pipe. Quotes are blockquotes: every line starts with ">", so verbatim text may contain anything, including "#", "·" and URLs.
Index ¶
- Constants
- Variables
- func Blockquote(text string) string
- func ParseCompetitors(text string) (Competitors, []Problem)
- func ParseVoices(text string) (Voices, []Problem)
- func Rules() []diagnostic.RuleInfo
- type Batch
- type Competitors
- type Count
- type GridRow
- type Import
- type Peer
- type Precision
- type Problem
- type Report
- type Summary
- type Voice
- type Voices
Constants ¶
const ( RuleFormat = "research.format" RuleSubstance = "research.substance" RuleBalance = "research.balance" )
Rule IDs reported by Check.
const ( VoicesFile = "human-voices.md" CompetitorsFile = "competitor-analysis.md" )
Files inside the project's research directory.
const ( MinVoices = 60 MinPlatforms = 5 MinPeers = 12 )
Minimums across all project research batches.
Variables ¶
var ( Authors = []string{"buyer", "adjacent", "creator", "brand", "expert"} Methods = []string{"connector", "fetch", "browser", "user"} // PeerFields are the facts recorded for every competitor, in order. PeerFields = []string{"Opening", "Palette", "Type", "Imagery", "Motion", "Mechanism", "Proof", "Price", "Tone", "Takeaway"} )
Fixed vocabularies.
Functions ¶
func Blockquote ¶
Blockquote formats verbatim text as quote lines that parse back to exactly the same text: every line gets "> ", empty lines a bare ">".
func ParseCompetitors ¶
func ParseCompetitors(text string) (Competitors, []Problem)
ParseCompetitors reads competitor-analysis.md.
func ParseVoices ¶
ParseVoices reads human-voices.md. It never stops at a problem, so every defect in a file is reported at once.
func Rules ¶
func Rules() []diagnostic.RuleInfo
Rules describes the research checks for the rule catalog.
Types ¶
type Batch ¶
type Batch struct {
Line int
Date time.Time
Trigger string // ongoing batches name what triggered them
Queries string
Unreachable string
Shortfall string // why minimums are not met, when they are not
}
Batch is one dated research session.
type Competitors ¶
type Competitors struct {
Title string
Batches []Batch
Entries []Peer
Grid []GridRow
GridLine int
Baseline string
Gaps []string
}
Competitors is competitor-analysis.md. Grid, Baseline and Gaps are those of the latest batch that has them.
type Import ¶ added in v0.1.9
Import records when an item was copied and identifies its original source record.
type Peer ¶
type Peer struct {
Imported Import
Line int
ID int
Name string
URL string
Fetched time.Time
Via string
Facts map[string]string
Batch int
}
Peer is one competitor page.
type Report ¶
type Report struct {
Diagnostics []diagnostic.Diagnostic
Summary Summary
Voices *Voices // nil when the file is absent
Competitors *Competitors // nil when the file is absent
}
Report is the result of checking a project's research.
type Summary ¶
type Summary struct {
Shortfalls []string `json:"shortfalls,omitempty"`
Voices int `json:"voices"`
Peers int `json:"peers"`
Batches int `json:"batches"`
Platforms []Count `json:"platforms,omitempty"` // by voice count, largest first
Dated int `json:"dated"` // voices with a posted date
Oldest time.Time `json:"oldest,omitzero"`
Newest time.Time `json:"newest,omitzero"`
Recent int `json:"recent"` // voices posted within a year of the latest fetch
Latest time.Time `json:"latestBatch,omitzero"`
}
Summary describes the research a page stands on.
type Voice ¶
type Voice struct {
Imported Import
Line int
ID int
Platform string
Place string
Author string
Posted time.Time // start of the posted period; zero when the source shows no date
Precision Precision
Fetched time.Time
Via string
Quote string
URL string
Observer string
Batch int // index into Voices.Batches
}
Voice is one verbatim quote.