Documentation
¶
Index ¶
- Constants
- Variables
- func AgeQualifier(age int) string
- func AgeWhenWhere(ev model.IndividualTimelineEvent, enc render.PageMarkdownEncoder) string
- func ChooseFrom(n int, alternatives ...string) string
- func CleanTags(ss []string) []string
- func CopyFile(dst, src string) error
- func CreateFile(fname string) (*os.File, error)
- func DeathWhat(ev model.IndividualTimelineEvent, mode model.ModeOfDeath) string
- func EncodePeopleListInline(ps []*model.Person, formatter func(*model.Person) string, ...) string
- func EncodeRawLink(u string, enc render.InlineMarkdownEncoder) string
- func EncodeText(t model.Text, enc render.MarkupBuilder) string
- func EventNarrativeDetail(ev model.TimelineEvent, enc render.MarkupBuilder) string
- func EventWhatWhenWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
- func EventWhatWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
- func EventWhenWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
- func FollowingWhatWhenWhere(what string, dt *model.Date, pl *model.Place, preceding model.TimelineEvent, ...) string
- func GenerateOlb(p *model.Person) error
- func IncludeInTimeline(ev model.TimelineEvent) bool
- func InferredWhat(w model.Whater, ev model.TimelineEvent) string
- func PersonBirthSummary(p *model.Person, enc render.PageMarkdownEncoder, name string, ...) string
- func PersonDeathSummary(p *model.Person, enc render.PageMarkdownEncoder, name string, ...) string
- func PersonMarriageSummary(p *model.Person, enc render.PageMarkdownEncoder, name string, ...) string
- func PersonParentage(p *model.Person, enc render.InlineMarkdownEncoder) string
- func PersonSummary(p *model.Person, enc render.PageMarkdownEncoder, name string, ...) string
- func PositionInFamily(p *model.Person) string
- func RenderCitationPage(s *Site, c *model.GeneralCitation) (render.Page, error)
- func RenderFacts(facts []model.Fact, pov *model.POV, enc render.MarkupBuilder) error
- func RenderNames(names []*model.Name, enc render.MarkupBuilder) error
- func RenderPersonPage(s *Site, p *model.Person) (render.Page, error)
- func RenderPlacePage(s *Site, p *model.Place) (render.Page, error)
- func RenderSourcePage(s *Site, so *model.Source) (render.Page, error)
- func RenderText(t model.Text, enc render.Page) error
- func RenderTimeline(t *model.Timeline, pov *model.POV, enc render.MarkupBuilder) error
- func RenderWikiTreePage(s *Site, p *model.Person) (render.Page, error)
- func ScanGeneralCitationForAnomalies(cit *model.GeneralCitation) []*model.Anomaly
- func ScanTimelineEventForAnomalies(ev model.TimelineEvent) []*model.Anomaly
- func Tagify(s string) string
- func WhatWhenWhere(what string, dt *model.Date, pl *model.Place, enc render.PageMarkdownEncoder) string
- func WhatWhere(what string, pl *model.Place, enc render.PageMarkdownEncoder) string
- func WhenWhere(dt *model.Date, pl *model.Place, enc render.PageMarkdownEncoder) string
- func WhoDoing(p *model.Person, dt *model.Date, enc render.PageMarkdownEncoder) string
- func WhoFormalDoing(p *model.Person, dt *model.Date, enc render.PageMarkdownEncoder) string
- func WhoWhatWhenWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
- type Calendar
- type CensusStatement
- type CitationSkippingEncoder
- func (e *CitationSkippingEncoder) EncodeCitationDetail(c *model.GeneralCitation) string
- func (e *CitationSkippingEncoder) EncodeModelLinkDedupe(firstText string, subsequentText string, m any) string
- func (e *CitationSkippingEncoder) EncodeWithCitations(s string, citations []*model.GeneralCitation) string
- type DeathStatement
- type FamilyEndStatement
- func (s *FamilyEndStatement) End() *model.Date
- func (s *FamilyEndStatement) NarrativeSequence() int
- func (s *FamilyEndStatement) Priority() int
- func (s *FamilyEndStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
- func (s *FamilyEndStatement) Start() *model.Date
- type FamilyStatement
- type GrammarHints
- type IntroGenerator
- func (n *IntroGenerator) Default(seq int, dt *model.Date) string
- func (n *IntroGenerator) IntroducePerson(seq int, p *model.Person, dt *model.Date, suppressSameSurname bool, ...) string
- func (n *IntroGenerator) Pronoun(seq int, dt *model.Date) string
- func (n *IntroGenerator) RelativeTime(seq int, dt *model.Date, includeFullDate bool) string
- type IntroStatement
- type Narrative
- type NarrativeStatement
- func (s *NarrativeStatement) End() *model.Date
- func (s *NarrativeStatement) NarrativeSequence() int
- func (s *NarrativeStatement) Priority() int
- func (s *NarrativeStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
- func (s *NarrativeStatement) Start() *model.Date
- type NoteDoc
- type PageLayout
- type Paginator
- type PaginatorEntry
- type PersonWithGreatestNumberHeap
- type PersonWithLeastNumberHeap
- type PersonWithNumber
- type PublishSet
- func (ps *PublishSet) AncestorSurnameDistribution() map[string]int
- func (ps *PublishSet) AncestorSurnameGroupList() []string
- func (ps *PublishSet) Ancestors(p *model.Person, generations int) []*model.Person
- func (ps *PublishSet) EarliestBorn(limit int) []*model.Person
- func (ps *PublishSet) GreatestChildren(limit int) []*model.Person
- func (ps *PublishSet) Includes(v any) bool
- func (t *PublishSet) NumberOfPeople() int
- func (ps *PublishSet) OldestPeople(limit int) []*model.Person
- func (ps *PublishSet) TreeSurnameDistribution() map[string]int
- type Site
- func (s *Site) AssignTags(p *model.Person) error
- func (s *Site) BuildCalendar() error
- func (s *Site) BuildPublishSet(m model.PersonMatcher) error
- func (s *Site) Generate() error
- func (s *Site) LinkFor(v any) string
- func (s *Site) LinkForFormat(v any, format string) string
- func (s *Site) LinkForSurnameListPage(surname string) string
- func (s *Site) NewDocument() *md.Document
- func (s *Site) NewMarkdownBuilder() render.MarkupBuilder
- func (s *Site) RedirectPath(id string) string
- func (s *Site) ScanPersonForAnomalies(p *model.Person)
- func (s *Site) ScanPersonTodos(p *model.Person) []*model.ToDo
- func (s *Site) WriteAnomalyListPages(root string) error
- func (s *Site) WriteChartAncestors(root string) error
- func (s *Site) WriteChartTrees(root string) error
- func (s *Site) WriteDescendantTree(fname string, p *model.Person, depth int) error
- func (s *Site) WriteInferenceListPages(root string) error
- func (s *Site) WritePages(contentDir string, mediaDir string) error
- func (s *Site) WritePersonListPages(root string) error
- func (s *Site) WritePlaceListPages(root string) error
- func (s *Site) WriteSourceListPages(root string) error
- func (s *Site) WriteSurnameListPages(root string) error
- func (s *Site) WriteTodoListPages(root string) error
- func (s *Site) WriteTreeOverview(root string) error
- type Statement
- type TimelineEntryFormatter
- type Tuple
- type WikiTreeEncoder
- func (w *WikiTreeEncoder) BlockQuote(m render.Markdown)
- func (w *WikiTreeEncoder) DefinitionList(items [][2]render.Markdown)
- func (w *WikiTreeEncoder) EmptyPara()
- func (w *WikiTreeEncoder) EncodeBold(m string) string
- func (w *WikiTreeEncoder) EncodeCitationDetail(c *model.GeneralCitation) string
- func (w *WikiTreeEncoder) EncodeCitationSeperator() string
- func (w *WikiTreeEncoder) EncodeEmptyPara() string
- func (w *WikiTreeEncoder) EncodeItalic(m string) string
- func (w *WikiTreeEncoder) EncodeLink(text string, url string) string
- func (w *WikiTreeEncoder) EncodeModelLink(text string, m any) string
- func (w *WikiTreeEncoder) EncodeModelLinkDedupe(firstText string, subsequentText string, m any) string
- func (w *WikiTreeEncoder) EncodeWithCitations(s string, citations []*model.GeneralCitation) string
- func (w *WikiTreeEncoder) Heading2(m render.Markdown, id string)
- func (w *WikiTreeEncoder) Heading3(m render.Markdown, id string)
- func (w *WikiTreeEncoder) Heading4(m render.Markdown, id string)
- func (w *WikiTreeEncoder) OrderedList(items []render.Markdown)
- func (w *WikiTreeEncoder) Para(m render.Markdown)
- func (w *WikiTreeEncoder) ParaWithFigure(s render.Markdown, link string, alt string, caption render.Markdown)
- func (w *WikiTreeEncoder) Pre(s string)
- func (w *WikiTreeEncoder) RawMarkdown(m render.Markdown)
- func (w *WikiTreeEncoder) String() string
- func (w *WikiTreeEncoder) Timeline(rows []render.TimelineRow)
- func (w *WikiTreeEncoder) UnorderedList(items []render.Markdown)
Constants ¶
const ( NarrativeSequenceIntro = 0 NarrativeSequenceEarlyLife = 1 NarrativeSequenceLifeStory = 2 NarrativeSequenceDeath = 3 NarrativeSequencePostDeath = 4 )
const ( PageSectionPerson = "person" PageSectionPlace = "place" PageSectionCitation = "citation" PageSectionSource = "source" PageSectionList = "list" PageSectionChart = "chart" PageSectionMedia = "media" )
const ( PageCategoryPerson = "person" PageCategoryCitation = "citation" PageCategorySource = "source" PageCategoryPlace = "place" )
Variables ¶
var Command = &cli.Command{ Name: "gen", Usage: "Generate a website from a gedcom file", Action: gen, Flags: append([]cli.Flag{ &cli.StringFlag{ Name: "gedcom", Aliases: []string{"g"}, Usage: "GEDCOM file to read from", Destination: &genopts.gedcomFile, }, &cli.StringFlag{ Name: "gramps", Usage: "Gramps xml file to read from", Destination: &genopts.grampsFile, }, &cli.StringFlag{ Name: "gramps-dbname", Usage: "Name of the gramps database, used to keep IDs consistent between versions of the same database", Destination: &genopts.grampsDatabaseName, }, &cli.StringFlag{ Name: "id", Usage: "Identifier to give this tree", Destination: &genopts.treeID, }, &cli.StringFlag{ Name: "site", Aliases: []string{"s"}, Usage: "Directory in which to write generated site", Destination: &genopts.rootDir, }, &cli.StringFlag{ Name: "media", Usage: "Directory in which to copy media files", Destination: &genopts.mediaDir, }, &cli.StringFlag{ Name: "basepath", Aliases: []string{"b"}, Usage: "Base URL path to use as a prefix to all links.", Value: "/", Destination: &genopts.basePath, }, &cli.StringFlag{ Name: "identity-map", Aliases: []string{"m"}, Usage: "Filename of identity mapping file", }, &cli.StringFlag{ Name: "key", Aliases: []string{"k"}, Usage: "Identifier of the key individual", Destination: &genopts.keyIndividual, }, &cli.BoolFlag{ Name: "include-private", Usage: "Include living people and people who died less than 20 years ago.", Value: false, Destination: &genopts.includePrivate, }, &cli.StringFlag{ Name: "config", Aliases: []string{"c"}, Value: tree.DefaultConfigDir(), Usage: "Path to the folder where config should be stored.", Destination: &genopts.configDir, }, &cli.StringFlag{ Name: "inspect", Usage: "Type and ID of an object to inspect. The internal data structure of the object will be printed to stdout. Use format '{object}/{id}' where object can be 'person', 'place' or 'source'.", Destination: &genopts.inspect, }, &cli.BoolFlag{ Name: "wikitree", Usage: "Generate pages that include wikitree markup for copy and paste.", Value: false, Destination: &genopts.generateWikiTree, }, &cli.BoolFlag{ Name: "hugo", Usage: "Generate Hugo-specific markup and index pages.", Value: true, Destination: &genopts.generateHugo, }, &cli.StringFlag{ Name: "notes", Usage: "Path to the folder where research notes are stored (in markdown format).", Destination: &genopts.notesDir, }, &cli.StringFlag{ Name: "relation", Usage: "Only generate pages for people who are related to the key person. One of 'direct' (must be a direct ancestor), 'common' (must have a common ancestor) or 'any' (any relation). Ignored if no key person is specified.", Value: "any", Destination: &genopts.relation, }, }, logging.Flags...), }
Functions ¶
func AgeQualifier ¶
func AgeWhenWhere ¶
func AgeWhenWhere(ev model.IndividualTimelineEvent, enc render.PageMarkdownEncoder) string
func ChooseFrom ¶
func DeathWhat ¶
func DeathWhat(ev model.IndividualTimelineEvent, mode model.ModeOfDeath) string
func EncodePeopleListInline ¶
func EncodePeopleListInline(ps []*model.Person, formatter func(*model.Person) string, enc render.InlineMarkdownEncoder) string
EncodePeopleListInline encodes a list of people as a comma separated list
func EncodeRawLink ¶
func EncodeRawLink(u string, enc render.InlineMarkdownEncoder) string
func EncodeText ¶
func EncodeText(t model.Text, enc render.MarkupBuilder) string
func EventNarrativeDetail ¶
func EventNarrativeDetail(ev model.TimelineEvent, enc render.MarkupBuilder) string
func EventWhatWhenWhere ¶
func EventWhatWhenWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
func EventWhatWhere ¶
func EventWhatWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
func EventWhenWhere ¶
func EventWhenWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
func FollowingWhatWhenWhere ¶
func FollowingWhatWhenWhere(what string, dt *model.Date, pl *model.Place, preceding model.TimelineEvent, enc render.PageMarkdownEncoder) string
func GenerateOlb ¶
func IncludeInTimeline ¶
func IncludeInTimeline(ev model.TimelineEvent) bool
func InferredWhat ¶
func InferredWhat(w model.Whater, ev model.TimelineEvent) string
func PersonBirthSummary ¶
func PersonDeathSummary ¶
func PersonMarriageSummary ¶
func PersonParentage ¶
func PersonParentage(p *model.Person, enc render.InlineMarkdownEncoder) string
func PersonSummary ¶
func PositionInFamily ¶
func RenderCitationPage ¶
func RenderFacts ¶
func RenderNames ¶
func RenderNames(names []*model.Name, enc render.MarkupBuilder) error
func RenderTimeline ¶
func ScanGeneralCitationForAnomalies ¶
func ScanGeneralCitationForAnomalies(cit *model.GeneralCitation) []*model.Anomaly
func ScanTimelineEventForAnomalies ¶
func ScanTimelineEventForAnomalies(ev model.TimelineEvent) []*model.Anomaly
func WhatWhenWhere ¶
func WhoDoing ¶
WhoDoing returns a persons full or familiar name with their occupation as an aside if known.
func WhoFormalDoing ¶
WhoFormalDoing returns a persons unique or full name with their occupation as an aside if known.
func WhoWhatWhenWhere ¶
func WhoWhatWhenWhere(ev model.TimelineEvent, enc render.PageMarkdownEncoder) string
Types ¶
type Calendar ¶
type Calendar struct {
Events []model.TimelineEvent
}
type CensusStatement ¶
type CensusStatement struct { Principal *model.Person Event *model.CensusEvent }
func (*CensusStatement) End ¶
func (s *CensusStatement) End() *model.Date
func (*CensusStatement) NarrativeSequence ¶
func (s *CensusStatement) NarrativeSequence() int
func (*CensusStatement) Priority ¶
func (s *CensusStatement) Priority() int
func (*CensusStatement) RenderDetail ¶
func (s *CensusStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
func (*CensusStatement) Start ¶
func (s *CensusStatement) Start() *model.Date
type CitationSkippingEncoder ¶
type CitationSkippingEncoder struct {
render.MarkupBuilder
}
func (*CitationSkippingEncoder) EncodeCitationDetail ¶
func (e *CitationSkippingEncoder) EncodeCitationDetail(c *model.GeneralCitation) string
func (*CitationSkippingEncoder) EncodeModelLinkDedupe ¶
func (e *CitationSkippingEncoder) EncodeModelLinkDedupe(firstText string, subsequentText string, m any) string
func (*CitationSkippingEncoder) EncodeWithCitations ¶
func (e *CitationSkippingEncoder) EncodeWithCitations(s string, citations []*model.GeneralCitation) string
type DeathStatement ¶
func (*DeathStatement) End ¶
func (s *DeathStatement) End() *model.Date
func (*DeathStatement) NarrativeSequence ¶
func (s *DeathStatement) NarrativeSequence() int
func (*DeathStatement) Priority ¶
func (s *DeathStatement) Priority() int
func (*DeathStatement) RenderDetail ¶
func (s *DeathStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
func (*DeathStatement) Start ¶
func (s *DeathStatement) Start() *model.Date
type FamilyEndStatement ¶
func (*FamilyEndStatement) End ¶
func (s *FamilyEndStatement) End() *model.Date
func (*FamilyEndStatement) NarrativeSequence ¶
func (s *FamilyEndStatement) NarrativeSequence() int
func (*FamilyEndStatement) Priority ¶
func (s *FamilyEndStatement) Priority() int
func (*FamilyEndStatement) RenderDetail ¶
func (s *FamilyEndStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
func (*FamilyEndStatement) Start ¶
func (s *FamilyEndStatement) Start() *model.Date
type FamilyStatement ¶
func (*FamilyStatement) End ¶
func (s *FamilyStatement) End() *model.Date
func (*FamilyStatement) NarrativeSequence ¶
func (s *FamilyStatement) NarrativeSequence() int
func (*FamilyStatement) Priority ¶
func (s *FamilyStatement) Priority() int
func (*FamilyStatement) RenderDetail ¶
func (s *FamilyStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
func (*FamilyStatement) Start ¶
func (s *FamilyStatement) Start() *model.Date
type GrammarHints ¶
type GrammarHints struct {
DateInferred bool
}
type IntroGenerator ¶
type IntroGenerator struct { POV *model.POV NameMinSeq int // the minimum sequence that the person's name may be used in an intro AgeMinSeq int // the minimum sequence that the person's age may be used in an intro LastIntroDate *model.Date // the date that the last intro was requested PeopleIntroduced map[string][]string // a lookup of occupations for people who have been introduced }
func (*IntroGenerator) IntroducePerson ¶
func (n *IntroGenerator) IntroducePerson(seq int, p *model.Person, dt *model.Date, suppressSameSurname bool, enc render.PageMarkdownEncoder) string
func (*IntroGenerator) RelativeTime ¶
type IntroStatement ¶
type IntroStatement struct { Principal *model.Person Baptisms []*model.BaptismEvent SuppressRelation bool }
func (*IntroStatement) End ¶
func (s *IntroStatement) End() *model.Date
func (*IntroStatement) NarrativeSequence ¶
func (s *IntroStatement) NarrativeSequence() int
func (*IntroStatement) Priority ¶
func (s *IntroStatement) Priority() int
func (*IntroStatement) RenderDetail ¶
func (s *IntroStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
func (*IntroStatement) Start ¶
func (s *IntroStatement) Start() *model.Date
type NarrativeStatement ¶
type NarrativeStatement struct { Principal *model.Person Event model.TimelineEvent }
A NarrativeStatement is used for any general event that includes a narrative. If the Event is an IndividualNarrativeEvent then the narrative field is used in place of any generated text. Otherwise an introductory sentence is prepended.
func (*NarrativeStatement) End ¶
func (s *NarrativeStatement) End() *model.Date
func (*NarrativeStatement) NarrativeSequence ¶
func (s *NarrativeStatement) NarrativeSequence() int
func (*NarrativeStatement) Priority ¶
func (s *NarrativeStatement) Priority() int
func (*NarrativeStatement) RenderDetail ¶
func (s *NarrativeStatement) RenderDetail(seq int, intro *IntroGenerator, enc render.MarkupBuilder, hints *GrammarHints)
func (*NarrativeStatement) Start ¶
func (s *NarrativeStatement) Start() *model.Date
type NoteDoc ¶
type PageLayout ¶
type PageLayout string
const ( PageLayoutPerson PageLayout = "person" PageLayoutPlace PageLayout = "place" PageLayoutSource PageLayout = "source" PageLayoutCitation PageLayout = "citation" PageLayoutListInferences PageLayout = "listinferences" PageLayoutListAnomalies PageLayout = "listanomalies" PageLayoutListTodo PageLayout = "listtodo" PageLayoutListPeople PageLayout = "listpeople" PageLayoutListPlaces PageLayout = "listplaces" PageLayoutListSources PageLayout = "listsources" PageLayoutListSurnames PageLayout = "listsurnames" PageLayoutCalendar PageLayout = "calendar" PageLayoutTreeOverview PageLayout = "treeoverview" PageLayoutChartAncestors PageLayout = "chartancestors" PageLayoutChartTrees PageLayout = "charttrees" )
func (PageLayout) String ¶
func (p PageLayout) String() string
type Paginator ¶
type Paginator struct { HugoStyle bool MaxPageSize int Entries []PaginatorEntry }
func NewPaginator ¶
func NewPaginator() *Paginator
func (*Paginator) AddEntryWithGroup ¶
func (*Paginator) WritePages ¶
type PaginatorEntry ¶
type PersonWithGreatestNumberHeap ¶
type PersonWithGreatestNumberHeap []*PersonWithNumber
func (PersonWithGreatestNumberHeap) Len ¶
func (h PersonWithGreatestNumberHeap) Len() int
func (PersonWithGreatestNumberHeap) Less ¶
func (h PersonWithGreatestNumberHeap) Less(i, j int) bool
func (*PersonWithGreatestNumberHeap) Pop ¶
func (h *PersonWithGreatestNumberHeap) Pop() interface{}
func (*PersonWithGreatestNumberHeap) Push ¶
func (h *PersonWithGreatestNumberHeap) Push(x interface{})
func (PersonWithGreatestNumberHeap) Swap ¶
func (h PersonWithGreatestNumberHeap) Swap(i, j int)
type PersonWithLeastNumberHeap ¶
type PersonWithLeastNumberHeap []*PersonWithNumber
func (PersonWithLeastNumberHeap) Len ¶
func (h PersonWithLeastNumberHeap) Len() int
func (PersonWithLeastNumberHeap) Less ¶
func (h PersonWithLeastNumberHeap) Less(i, j int) bool
func (*PersonWithLeastNumberHeap) Pop ¶
func (h *PersonWithLeastNumberHeap) Pop() interface{}
func (*PersonWithLeastNumberHeap) Push ¶
func (h *PersonWithLeastNumberHeap) Push(x interface{})
func (PersonWithLeastNumberHeap) Swap ¶
func (h PersonWithLeastNumberHeap) Swap(i, j int)
type PersonWithNumber ¶
type PublishSet ¶
type PublishSet struct { KeyPerson *model.Person People map[string]*model.Person Citations map[string]*model.GeneralCitation Sources map[string]*model.Source Repositories map[string]*model.Repository Places map[string]*model.Place Families map[string]*model.Family MediaObjects map[string]*model.MediaObject Events map[model.TimelineEvent]bool LastUpdated time.Time }
func NewPublishSet ¶
func NewPublishSet(t *tree.Tree, include model.PersonMatcher) (*PublishSet, error)
func (*PublishSet) AncestorSurnameDistribution ¶
func (ps *PublishSet) AncestorSurnameDistribution() map[string]int
AncestorSurnameDistribution returns a map of surnames and the number of direct ancestors with that surname It excludes redacted people.
func (*PublishSet) AncestorSurnameGroupList ¶
func (ps *PublishSet) AncestorSurnameGroupList() []string
AncestorSurnameList returns a list of surname groups in generation order, starting with the father of the key person, then the mother, then the father's father etc..
func (*PublishSet) Ancestors ¶
Ancestors returns the ancestors of p. The returned list is ordered such that the father of entry n is found at (n+2)*2-2, the mother of entry n is found at (n+2)*2-1 The list will always contain 2^n entries, with unknown ancestors left as nil at the appropriate index. Odd numbers are female, even numbers are male. The child of entry n is found at (n-2)/2 if n is even and (n-3)/2 if n is odd. 0: father 1: mother 2: father's father 3: father's mother 4: mother's father 5: mother's mother 6: father's father's father 7: father's father's mother 8: father's mother's father 9: father's mother's mother 10: mother's father's father 11: mother's father's mother 12: mother's mother's father 13: mother's mother's mother 14: father's father's father's father 15: father's father's father's mother 16: father's father's mother's father 17: father's father's mother's mother 18: father's mother's father's father 19: father's mother's father's mother 20: father's mother's mother's father 21: father's mother's mother's mother 22: mother's father's father's father 23: mother's father's father's mother 24: mother's father's mother's father 25: mother's father's mother's mother 26: mother's mother's father's father 27: mother's mother's father's mother 28: mother's mother's mother's father 29: mother's mother's mother's mother
func (*PublishSet) EarliestBorn ¶
func (ps *PublishSet) EarliestBorn(limit int) []*model.Person
EarliestBorn returns a list of the earliest born people in the tree, sorted by descending date It excludes redacted people.
func (*PublishSet) GreatestChildren ¶
func (ps *PublishSet) GreatestChildren(limit int) []*model.Person
GreatestChildren returns a list of the people with the greatest number of children in the tree It excludes redacted people.
func (*PublishSet) Includes ¶
func (ps *PublishSet) Includes(v any) bool
func (*PublishSet) NumberOfPeople ¶
func (t *PublishSet) NumberOfPeople() int
NumberOfPeople returns the number of people in the tree. It excludes redacted people.
func (*PublishSet) OldestPeople ¶
func (ps *PublishSet) OldestPeople(limit int) []*model.Person
OldestPeople returns a list of the oldest people in the tree, sorted by descending age It excludes redacted people.
func (*PublishSet) TreeSurnameDistribution ¶
func (ps *PublishSet) TreeSurnameDistribution() map[string]int
TreeSurnameDistribution returns a map of surnames and the number of people in the tree with that surname It excludes redacted people.
type Site ¶
type Site struct { BaseURL string Tree *tree.Tree Calendars map[int]*Calendar PersonDir string PersonLinkPattern string PersonFilePattern string SourceDir string SourceLinkPattern string SourceFilePattern string CitationDir string CitationLinkPattern string CitationFilePattern string FamilyLinkPattern string CalendarLinkPattern string FamilyFilePattern string PlaceDir string PlaceLinkPattern string PlaceFilePattern string CalendarFilePattern string MediaDir string MediaLinkPattern string MediaFilePattern string ListInferencesDir string ListAnomaliesDir string ListTodoDir string ListPeopleDir string ListPlacesDir string ListSourcesDir string ListSurnamesDir string ChartAncestorsDir string ChartTreesDir string IncludePrivate bool TimelineExperiment bool GenerateHugo bool GenerateWikiTree bool WikiTreeDir string WikiTreeLinkPattern string WikiTreeFilePattern string // PublishSet is the set of objects that will have pages written PublishSet *PublishSet }
func (*Site) BuildCalendar ¶
func (*Site) BuildPublishSet ¶
func (s *Site) BuildPublishSet(m model.PersonMatcher) error
func (*Site) LinkForSurnameListPage ¶
func (*Site) NewDocument ¶
func (*Site) NewMarkdownBuilder ¶
func (s *Site) NewMarkdownBuilder() render.MarkupBuilder
func (*Site) RedirectPath ¶
func (*Site) ScanPersonForAnomalies ¶
func (*Site) WriteAnomalyListPages ¶
func (*Site) WriteChartAncestors ¶
func (*Site) WriteChartTrees ¶
func (*Site) WriteDescendantTree ¶
func (*Site) WriteInferenceListPages ¶
func (*Site) WritePersonListPages ¶
func (*Site) WritePlaceListPages ¶
func (*Site) WriteSourceListPages ¶
func (*Site) WriteSurnameListPages ¶
func (*Site) WriteTodoListPages ¶
func (*Site) WriteTreeOverview ¶
type Statement ¶
type Statement interface { RenderDetail(int, *IntroGenerator, render.MarkupBuilder, *GrammarHints) Start() *model.Date End() *model.Date NarrativeSequence() int Priority() int // priority within a narrative against another statement with same date, higher will be rendered first }
type TimelineEntryFormatter ¶
type TimelineEntryFormatter struct {
// contains filtered or unexported fields
}
func (*TimelineEntryFormatter) Detail ¶
func (t *TimelineEntryFormatter) Detail(seq int, ev model.TimelineEvent) string
func (*TimelineEntryFormatter) Title ¶
func (t *TimelineEntryFormatter) Title(seq int, ev model.TimelineEvent) string
type Tuple ¶
type Tuple[K simplevalue, V simplevalue] struct { K K V V }
func FlattenMap ¶
func FlattenMap[M ~map[K]V, K simplevalue, V simplevalue](m M) []Tuple[K, V]
FlattenMapByKeyAsc flattens a map into a slice of Tuples
func FlattenMapByKeyAsc ¶
func FlattenMapByKeyAsc[M ~map[K]V, K simplevalue, V simplevalue](m M) []Tuple[K, V]
FlattenMapByKeyAsc flattens a map and sorts by the key ascending
func FlattenMapByValueDesc ¶
func FlattenMapByValueDesc[M ~map[K]V, K simplevalue, V simplevalue](m M) []Tuple[K, V]
FlattenMapByValueDesc flattens a map and sorts by the value descending
type WikiTreeEncoder ¶
type WikiTreeEncoder struct {
// contains filtered or unexported fields
}
func (*WikiTreeEncoder) BlockQuote ¶
func (w *WikiTreeEncoder) BlockQuote(m render.Markdown)
func (*WikiTreeEncoder) DefinitionList ¶
func (w *WikiTreeEncoder) DefinitionList(items [][2]render.Markdown)
func (*WikiTreeEncoder) EmptyPara ¶
func (w *WikiTreeEncoder) EmptyPara()
func (*WikiTreeEncoder) EncodeBold ¶
func (w *WikiTreeEncoder) EncodeBold(m string) string
func (*WikiTreeEncoder) EncodeCitationDetail ¶
func (w *WikiTreeEncoder) EncodeCitationDetail(c *model.GeneralCitation) string
func (*WikiTreeEncoder) EncodeCitationSeperator ¶
func (w *WikiTreeEncoder) EncodeCitationSeperator() string
func (*WikiTreeEncoder) EncodeEmptyPara ¶
func (w *WikiTreeEncoder) EncodeEmptyPara() string
func (*WikiTreeEncoder) EncodeItalic ¶
func (w *WikiTreeEncoder) EncodeItalic(m string) string
func (*WikiTreeEncoder) EncodeLink ¶
func (w *WikiTreeEncoder) EncodeLink(text string, url string) string
func (*WikiTreeEncoder) EncodeModelLink ¶
func (w *WikiTreeEncoder) EncodeModelLink(text string, m any) string
func (*WikiTreeEncoder) EncodeModelLinkDedupe ¶
func (w *WikiTreeEncoder) EncodeModelLinkDedupe(firstText string, subsequentText string, m any) string
func (*WikiTreeEncoder) EncodeWithCitations ¶
func (w *WikiTreeEncoder) EncodeWithCitations(s string, citations []*model.GeneralCitation) string
func (*WikiTreeEncoder) OrderedList ¶
func (w *WikiTreeEncoder) OrderedList(items []render.Markdown)
func (*WikiTreeEncoder) Para ¶
func (w *WikiTreeEncoder) Para(m render.Markdown)
func (*WikiTreeEncoder) ParaWithFigure ¶
func (*WikiTreeEncoder) Pre ¶
func (w *WikiTreeEncoder) Pre(s string)
func (*WikiTreeEncoder) RawMarkdown ¶
func (w *WikiTreeEncoder) RawMarkdown(m render.Markdown)
func (*WikiTreeEncoder) String ¶
func (w *WikiTreeEncoder) String() string
func (*WikiTreeEncoder) Timeline ¶
func (w *WikiTreeEncoder) Timeline(rows []render.TimelineRow)
func (*WikiTreeEncoder) UnorderedList ¶
func (w *WikiTreeEncoder) UnorderedList(items []render.Markdown)