html

package
v39.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package html is shared HTML rendering components that are shared by the other packages.

Index

Constants

View Source
const (
	IndividualMaleColor   = "#0275d8"
	IndividualFemaleColor = "#d9534f"
)
View Source
const (
	DiffPageShowAll         = "all" // default
	DiffPageShowOnlyMatches = "only-matches"
	DiffPageShowSubset      = "subset"
)

These are used for optionShow. If you update these options you will also need to adjust validateOptions.

View Source
const (
	DiffPageSortWrittenName       = "written-name" // default
	DiffPageSortHighestSimilarity = "highest-similarity"
)

These are used for optionSort. If you update these options you will also need to adjust validateOptions.

View Source
const (
	LivingVisibilityShow        = "show"
	LivingVisibilityHide        = "hide"
	LivingVisibilityPlaceholder = "placeholder"
)
View Source
const UnknownEmphasis = "<em>Unknown</em>"

Variables

This section is empty.

Functions

func GetIndexLetters

func GetIndexLetters(document *gedcom.Document, livingVisibility LivingVisibility) []rune

func GetIndividuals

func GetIndividuals(document *gedcom.Document, placesMap map[string]*place) map[string]*gedcom.IndividualNode

func PageFamilies

func PageFamilies() string

func PageIndividual

func PageIndividual(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) string

func PageIndividuals

func PageIndividuals(firstLetter rune) string

func PagePlace

func PagePlace(place string, places map[string]*place) string

func PagePlaces

func PagePlaces() string

func PageSource

func PageSource(source *gedcom.SourceNode) string

func PageSources

func PageSources() string

func PageStatistics

func PageStatistics() string

func PageSurnames

func PageSurnames() string

Types

type Age

type Age struct {
	// contains filtered or unexported fields
}

func NewAge

func NewAge(start, end gedcom.Age) *Age

func (*Age) WriteHTMLTo

func (c *Age) WriteHTMLTo(w io.Writer) (int64, error)

type AllParentButtons

type AllParentButtons struct {
	// contains filtered or unexported fields
}

AllParentButtons represent one or more families that an individual belongs to. These are show as large buttons above the large name of the person in on their individual page.

func NewAllParentButtons

func NewAllParentButtons(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) *AllParentButtons

func (*AllParentButtons) WriteHTMLTo

func (c *AllParentButtons) WriteHTMLTo(w io.Writer) (int64, error)

type DiffPage

type DiffPage struct {
	// contains filtered or unexported fields
}

func NewDiffPage

func NewDiffPage(comparisons gedcom.IndividualComparisons, filterFlags *gedcom.FilterFlags, googleAnalyticsID string, show, sort string, progress chan gedcom.Progress, compareOptions *gedcom.IndividualNodesCompareOptions, visibility LivingVisibility) *DiffPage

func (*DiffPage) WriteHTMLTo

func (c *DiffPage) WriteHTMLTo(w io.Writer) (int64, error)

type DiffRow

type DiffRow struct {
	// contains filtered or unexported fields
}

func NewDiffRow

func NewDiffRow(name string, nd *gedcom.NodeDiff, hideSame bool) *DiffRow

func (*DiffRow) WriteHTMLTo

func (c *DiffRow) WriteHTMLTo(w io.Writer) (int64, error)

type EventDate

type EventDate struct {
	// contains filtered or unexported fields
}

EventDate shows a date like "d. 1882" but will not show anything if the date is not provided.

func NewEventDate

func NewEventDate(event string, dates []*gedcom.DateNode) *EventDate

func (*EventDate) IsBlank

func (c *EventDate) IsBlank() bool

func (*EventDate) WriteHTMLTo

func (c *EventDate) WriteHTMLTo(w io.Writer) (int64, error)

type EventDates

type EventDates struct {
	// contains filtered or unexported fields
}

EventDates contains several eventDate instances that are separated by three spaces. Only the dates that are non-empty will be shown.

func NewEventDates

func NewEventDates(items []*EventDate) *EventDates

func (*EventDates) WriteHTMLTo

func (c *EventDates) WriteHTMLTo(w io.Writer) (int64, error)

type EventStatistics

type EventStatistics struct {
	// contains filtered or unexported fields
}

func NewEventStatistics

func NewEventStatistics(document *gedcom.Document) *EventStatistics

func (*EventStatistics) WriteHTMLTo

func (c *EventStatistics) WriteHTMLTo(w io.Writer) (int64, error)

type FamilyInList

type FamilyInList struct {
	// contains filtered or unexported fields
}

func NewFamilyInList

func NewFamilyInList(document *gedcom.Document, family *gedcom.FamilyNode, visibility LivingVisibility, placesMap map[string]*place) *FamilyInList

func (*FamilyInList) WriteHTMLTo

func (c *FamilyInList) WriteHTMLTo(w io.Writer) (int64, error)

type FamilyListPage

type FamilyListPage struct {
	// contains filtered or unexported fields
}

func NewFamilyListPage

func NewFamilyListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *FamilyListPage

func (*FamilyListPage) WriteHTMLTo

func (c *FamilyListPage) WriteHTMLTo(w io.Writer) (int64, error)

type FamilyStatistics

type FamilyStatistics struct {
	// contains filtered or unexported fields
}

func NewFamilyStatistics

func NewFamilyStatistics(document *gedcom.Document) *FamilyStatistics

func (*FamilyStatistics) WriteHTMLTo

func (c *FamilyStatistics) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualAdditionalNames

type IndividualAdditionalNames struct {
	// contains filtered or unexported fields
}

IndividualAdditionalNames is shown on the individual page. It shows all of the extra names (except the primary name) and their type.

func NewIndividualAdditionalNames

func NewIndividualAdditionalNames(individual *gedcom.IndividualNode) *IndividualAdditionalNames

func (*IndividualAdditionalNames) WriteHTMLTo

func (c *IndividualAdditionalNames) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualButton

type IndividualButton struct {
	// contains filtered or unexported fields
}

IndividualButton is a large coloured button that links to an individuals page. It contains the same and some date information. This is also used to represent unknown or missing individuals.

func NewIndividualButton

func NewIndividualButton(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) *IndividualButton

func (*IndividualButton) WriteHTMLTo

func (c *IndividualButton) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualCompare

type IndividualCompare struct {
	// contains filtered or unexported fields
}

func NewIndividualCompare

func NewIndividualCompare(comparison *gedcom.IndividualComparison, filterFlags *gedcom.FilterFlags, progress chan gedcom.Progress, compareOptions *gedcom.IndividualNodesCompareOptions, visibility LivingVisibility) *IndividualCompare

func (*IndividualCompare) WriteHTMLTo

func (c *IndividualCompare) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualDates

type IndividualDates struct {
	// contains filtered or unexported fields
}

func NewIndividualDates

func NewIndividualDates(individual *gedcom.IndividualNode, visibility LivingVisibility) *IndividualDates

func (*IndividualDates) EventDates

func (c *IndividualDates) EventDates() []*EventDate

func (*IndividualDates) IsBlank

func (c *IndividualDates) IsBlank() bool

func (*IndividualDates) WriteHTMLTo

func (c *IndividualDates) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualEvent

type IndividualEvent struct {
	// contains filtered or unexported fields
}

IndividualEvent is a row in the "Events" section of the individuals page.

func NewIndividualEvent

func NewIndividualEvent(date, place string, description core.Component, individual *gedcom.IndividualNode, event gedcom.Node, placesMap map[string]*place) *IndividualEvent

func (*IndividualEvent) WriteHTMLTo

func (c *IndividualEvent) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualEvents

type IndividualEvents struct {
	// contains filtered or unexported fields
}

IndividualEvents is the table of events show in the "Events" section of the individuals page.

func NewIndividualEvents

func NewIndividualEvents(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) *IndividualEvents

func (*IndividualEvents) WriteHTMLTo

func (c *IndividualEvents) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualInList

type IndividualInList struct {
	// contains filtered or unexported fields
}

IndividualInList is a single row in the table of individuals on the list page.

func NewIndividualInList

func NewIndividualInList(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) *IndividualInList

func (*IndividualInList) WriteHTMLTo

func (c *IndividualInList) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualIndexHeader

type IndividualIndexHeader struct {
	// contains filtered or unexported fields
}

func NewIndividualIndexHeader

func NewIndividualIndexHeader(document *gedcom.Document, selectedLetter rune, livingVisibility LivingVisibility, indexLetters []rune) *IndividualIndexHeader

func (*IndividualIndexHeader) WriteHTMLTo

func (c *IndividualIndexHeader) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualIndexLetter

type IndividualIndexLetter struct {
	// contains filtered or unexported fields
}

func NewIndividualIndexLetter

func NewIndividualIndexLetter(letter rune, isSelected bool) *IndividualIndexLetter

func (*IndividualIndexLetter) WriteHTMLTo

func (c *IndividualIndexLetter) WriteHTMLTo(w io.Writer) (int64, error)
type IndividualLink struct {
	// contains filtered or unexported fields
}

IndividualLink is a hyperlink to an individuals page. The link contains a coloured dot to represent their sex and their full name.

func NewIndividualLink(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) *IndividualLink

func (*IndividualLink) WriteHTMLTo

func (c *IndividualLink) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualListPage

type IndividualListPage struct {
	// contains filtered or unexported fields
}

IndividualListPage is the page that lists of all the individuals.

func NewIndividualListPage

func NewIndividualListPage(document *gedcom.Document, selectedLetter rune, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *IndividualListPage

func (*IndividualListPage) WriteHTMLTo

func (c *IndividualListPage) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualName

type IndividualName struct {
	// contains filtered or unexported fields
}

IndividualName outputs the full name of the individual. This is a wrapper for the String function on the IndividualNode. If the individual does not have any names then "Unknown" will be used. It is safe to use nil for the individual.

func NewIndividualName

func NewIndividualName(individual *gedcom.IndividualNode, visibility LivingVisibility, unknownHTML string) *IndividualName

func (*IndividualName) IsUnknown

func (c *IndividualName) IsUnknown() bool

func (*IndividualName) WriteHTMLTo

func (c *IndividualName) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualNameAndDates

type IndividualNameAndDates struct {
	// contains filtered or unexported fields
}

func NewIndividualNameAndDates

func NewIndividualNameAndDates(individual *gedcom.IndividualNode, visibility LivingVisibility, unknownText string) *IndividualNameAndDates

func (*IndividualNameAndDates) WriteHTMLTo

func (c *IndividualNameAndDates) WriteHTMLTo(w io.Writer) (int64, error)
type IndividualNameAndDatesLink struct {
	// contains filtered or unexported fields
}
func NewIndividualNameAndDatesLink(individual *gedcom.IndividualNode, visibility LivingVisibility, unknownText string) *IndividualNameAndDatesLink

func (*IndividualNameAndDatesLink) WriteHTMLTo

func (c *IndividualNameAndDatesLink) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualNameAndSex

type IndividualNameAndSex struct {
	// contains filtered or unexported fields
}

IndividualNameAndSex shows the name parts and sex of an individual in the "Name & Sex" section of the individuals page.

func NewIndividualNameAndSex

func NewIndividualNameAndSex(individual *gedcom.IndividualNode) *IndividualNameAndSex

func (*IndividualNameAndSex) WriteHTMLTo

func (c *IndividualNameAndSex) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualPage

type IndividualPage struct {
	// contains filtered or unexported fields
}

IndividualPage is the page that shows detailed information about an individual.

func NewIndividualPage

func NewIndividualPage(document *gedcom.Document, individual *gedcom.IndividualNode, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *IndividualPage

func (*IndividualPage) WriteHTMLTo

func (c *IndividualPage) WriteHTMLTo(w io.Writer) (int64, error)

type IndividualStatistics

type IndividualStatistics struct {
	// contains filtered or unexported fields
}

func NewIndividualStatistics

func NewIndividualStatistics(document *gedcom.Document, visibility LivingVisibility) *IndividualStatistics

func (*IndividualStatistics) WriteHTMLTo

func (c *IndividualStatistics) WriteHTMLTo(w io.Writer) (int64, error)

type LivingVisibility

type LivingVisibility string

func NewLivingVisibility

func NewLivingVisibility(lv string) LivingVisibility

type ParentButtons

type ParentButtons struct {
	// contains filtered or unexported fields
}

ParentButtons show two buttons separated by a "T" to be placed above the large individuals name.

func NewParentButtons

func NewParentButtons(document *gedcom.Document, family *gedcom.FamilyNode, visibility LivingVisibility, placesMap map[string]*place) *ParentButtons

func (*ParentButtons) WriteHTMLTo

func (c *ParentButtons) WriteHTMLTo(w io.Writer) (int64, error)

type PartnersAndChildren

type PartnersAndChildren struct {
	// contains filtered or unexported fields
}

PartnersAndChildren show the partners and/or children connected to the individual on their individual page.

func NewPartnersAndChildren

func NewPartnersAndChildren(document *gedcom.Document, individual *gedcom.IndividualNode, visibility LivingVisibility, placesMap map[string]*place) *PartnersAndChildren

func (*PartnersAndChildren) WriteHTMLTo

func (c *PartnersAndChildren) WriteHTMLTo(w io.Writer) (int64, error)

type PlaceEvent

type PlaceEvent struct {
	// contains filtered or unexported fields
}

func NewPlaceEvent

func NewPlaceEvent(document *gedcom.Document, node gedcom.Node, visibility LivingVisibility, placesMap map[string]*place) *PlaceEvent

func (*PlaceEvent) WriteHTMLTo

func (c *PlaceEvent) WriteHTMLTo(w io.Writer) (int64, error)

type PlaceInList

type PlaceInList struct {
	// contains filtered or unexported fields
}

func NewPlaceInList

func NewPlaceInList(document *gedcom.Document, place *place, placesMap map[string]*place) *PlaceInList

func (*PlaceInList) WriteHTMLTo

func (c *PlaceInList) WriteHTMLTo(w io.Writer) (int64, error)
type PlaceLink struct {
	// contains filtered or unexported fields
}
func NewPlaceLink(document *gedcom.Document, place string, placesMap map[string]*place) *PlaceLink

func (*PlaceLink) WriteHTMLTo

func (c *PlaceLink) WriteHTMLTo(w io.Writer) (int64, error)

type PlaceListPage

type PlaceListPage struct {
	// contains filtered or unexported fields
}

PlaceListPage lists all places.

func NewPlaceListPage

func NewPlaceListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *PlaceListPage

func (*PlaceListPage) WriteHTMLTo

func (c *PlaceListPage) WriteHTMLTo(w io.Writer) (int64, error)

type PlacePage

type PlacePage struct {
	// contains filtered or unexported fields
}

func NewPlacePage

func NewPlacePage(document *gedcom.Document, placeKey string, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *PlacePage

func (*PlacePage) WriteHTMLTo

func (c *PlacePage) WriteHTMLTo(w io.Writer) (int64, error)

type PlaceStatistics

type PlaceStatistics struct {
	// contains filtered or unexported fields
}

func (*PlaceStatistics) WriteHTMLTo

func (c *PlaceStatistics) WriteHTMLTo(w io.Writer) (int64, error)

type PlusSVG

type PlusSVG struct {
	// contains filtered or unexported fields
}

PlusSVG draws a "+" as an SVG with each line of the "+" being optional.

func NewPlusSVG

func NewPlusSVG(top, left, right, bottom bool) *PlusSVG

func (*PlusSVG) WriteHTMLTo

func (c *PlusSVG) WriteHTMLTo(w io.Writer) (int64, error)

type PublishHeader

type PublishHeader struct {
	// contains filtered or unexported fields
}

PublishHeader is the tabbed section at the top of each page. The PublishHeader will be the same on all pages except that some pages will use an extra tab for that page.

func NewPublishHeader

func NewPublishHeader(document *gedcom.Document, extraTab string, selectedTab string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *PublishHeader

func (*PublishHeader) WriteHTMLTo

func (c *PublishHeader) WriteHTMLTo(w io.Writer) (int64, error)

type PublishShowOptions

type PublishShowOptions struct {
	ShowIndividuals  bool
	ShowPlaces       bool
	ShowFamilies     bool
	ShowSurnames     bool
	ShowSources      bool
	ShowStatistics   bool
	LivingVisibility LivingVisibility
}

type Publisher

type Publisher struct {
	GoogleAnalyticsID string
	// contains filtered or unexported fields
}

func NewPublisher

func NewPublisher(doc *gedcom.Document, options *PublishShowOptions) *Publisher

NewPublisher generates the pages to be rendered for a published website.

The fileWriter will be responsible for rendering the pages to their destination. Which may be a file system, or somewhere else of your choosing. If you only wish to generate files you should use a DirectoryFileWriter.

func (*Publisher) Files

func (publisher *Publisher) Files(channelSize int) chan *core.File

func (*Publisher) Places

func (publisher *Publisher) Places() map[string]*place

func (*Publisher) Publish

func (publisher *Publisher) Publish(fileWriter core.FileWriter, parallel int) (err error)

type SexBadge

type SexBadge struct {
	// contains filtered or unexported fields
}

SexBadge shows a coloured "Male", "Female" or "Unknown" badge.

func NewSexBadge

func NewSexBadge(sex *gedcom.SexNode) *SexBadge

func (*SexBadge) WriteHTMLTo

func (c *SexBadge) WriteHTMLTo(w io.Writer) (int64, error)

type SourceInList

type SourceInList struct {
	// contains filtered or unexported fields
}

func NewSourceInList

func NewSourceInList(document *gedcom.Document, source *gedcom.SourceNode) *SourceInList

func (*SourceInList) WriteHTMLTo

func (c *SourceInList) WriteHTMLTo(w io.Writer) (int64, error)
type SourceLink struct {
	// contains filtered or unexported fields
}
func NewSourceLink(source *gedcom.SourceNode) *SourceLink

func (*SourceLink) WriteHTMLTo

func (c *SourceLink) WriteHTMLTo(w io.Writer) (int64, error)

type SourceListPage

type SourceListPage struct {
	// contains filtered or unexported fields
}

func NewSourceListPage

func NewSourceListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *SourceListPage

func (*SourceListPage) WriteHTMLTo

func (c *SourceListPage) WriteHTMLTo(w io.Writer) (int64, error)

type SourcePage

type SourcePage struct {
	// contains filtered or unexported fields
}

func NewSourcePage

func NewSourcePage(document *gedcom.Document, source *gedcom.SourceNode, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *SourcePage

func (*SourcePage) WriteHTMLTo

func (c *SourcePage) WriteHTMLTo(w io.Writer) (int64, error)

type SourceProperty

type SourceProperty struct {
	// contains filtered or unexported fields
}

func NewSourceProperty

func NewSourceProperty(document *gedcom.Document, node gedcom.Node) *SourceProperty

func (*SourceProperty) WriteHTMLTo

func (c *SourceProperty) WriteHTMLTo(w io.Writer) (int64, error)

type SourceStatistics

type SourceStatistics struct {
	// contains filtered or unexported fields
}

func NewSourceStatistics

func NewSourceStatistics(document *gedcom.Document) *SourceStatistics

func (*SourceStatistics) WriteHTMLTo

func (c *SourceStatistics) WriteHTMLTo(w io.Writer) (int64, error)

type StatisticsPage

type StatisticsPage struct {
	// contains filtered or unexported fields
}

func NewStatisticsPage

func NewStatisticsPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *StatisticsPage

func (*StatisticsPage) WriteHTMLTo

func (c *StatisticsPage) WriteHTMLTo(w io.Writer) (int64, error)

type SurnameInList

type SurnameInList struct {
	// contains filtered or unexported fields
}

func NewSurnameInList

func NewSurnameInList(document *gedcom.Document, surname string) *SurnameInList

func (*SurnameInList) WriteHTMLTo

func (c *SurnameInList) WriteHTMLTo(w io.Writer) (int64, error)

type SurnameIndex

type SurnameIndex struct {
	// contains filtered or unexported fields
}

func NewSurnameIndex

func NewSurnameIndex(document *gedcom.Document, selectedLetter rune, visibility LivingVisibility) *SurnameIndex

func (*SurnameIndex) WriteHTMLTo

func (c *SurnameIndex) WriteHTMLTo(w io.Writer) (int64, error)
type SurnameLink struct {
	// contains filtered or unexported fields
}
func NewSurnameLink(surname string) *SurnameLink

func (*SurnameLink) WriteHTMLTo

func (c *SurnameLink) WriteHTMLTo(w io.Writer) (int64, error)

type SurnameListPage

type SurnameListPage struct {
	// contains filtered or unexported fields
}

func NewSurnameListPage

func NewSurnameListPage(document *gedcom.Document, googleAnalyticsID string, options *PublishShowOptions, indexLetters []rune, placesMap map[string]*place) *SurnameListPage

func (*SurnameListPage) WriteHTMLTo

func (c *SurnameListPage) WriteHTMLTo(w io.Writer) (int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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