profileio

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProfileFieldNameMap map[ProfileField]string = map[ProfileField]string{
	ConfigField:       "config",
	BasicsField:       "basics",
	WorkField:         "work",
	EducationField:    "education",
	PublicationsField: "publications",
	ProjectsField:     "projects",
	AwardsField:       "awards",
	SkillsField:       "skills",
	LanguagesField:    "languages",
	InterestsField:    "interests",
	ReferencesField:   "references",
	ListField:         "list",
	CustomField:       "custom"}

ProfileFieldNameMap stores the field names of different sections in a profile, e.g. "config", "basics", etc.

View Source
var ProfileThemes map[ProfileTheme]string = map[ProfileTheme]string{
	BasicTheme:   "basic",
	PantherTheme: "panther"}

ProfileThemes is a map of list of available themes.

View Source
var PublicationFieldNameMap map[PublicationField]string = map[PublicationField]string{
	ArticleField:      "article",
	BookField:         "book",
	ThesisField:       "thesis",
	TechReportField:   "techreport",
	InCollectionField: "incollection",
	MiscField:         "misc",
	UnPublishedField:  "unpublished"}

PublicationFieldNameMap stores the names of different publication types, "article", "book", etc.

Functions

func GenerateTemplate

func GenerateTemplate(profile *Profile, sortedSectionList *[]SectionIndexRank, templateFile string)

GenerateTemplate writes template file for a given theme.

func GetDefaultRanks

func GetDefaultRanks(theme string) map[string]int

GetDefaultRanks returns default ranks of each section (work, education, publications, etc.) with the exception of custom field in the profile object.

func PopulateProfile

func PopulateProfile(jsonData *[]byte, profile *Profile)

PopulateProfile maps json data to profile struct.

func ProfileIO

func ProfileIO(jsonData []byte)

ProfileIO processes the given json file and generates tex and pdf resume files.

func SanitizeAndMakeTitle

func SanitizeAndMakeTitle(text string) string

SanitizeAndMakeTitle updates a string using strings.Title(...) and escapes required characters.

func SanitizeLabel

func SanitizeLabel(label string) string

SanitizeLabel returns escaped string for required characters, for a basic theme.

func SanitizeText

func SanitizeText(text string) string

SanitizeText updates string by escaping required characters such as '\', '&'.

func WriteResumeClass

func WriteResumeClass(file string)

WriteResumeClass writes contents of res.cls (http://ftp.math.purdue.edu/mirrors/ctan.org/macros/latex/contrib/resume/res.cls).

Types

type AwardDetail

type AwardDetail struct {
	Value struct {
		Title   string
		Date    string
		Awarder string
		Summary string
	}
	Render bool
}

AwardDetail type

type AwardDetailSlice

type AwardDetailSlice []AwardDetail

AwardDetailSlice type

func (AwardDetailSlice) HasRender

func (s AwardDetailSlice) HasRender() bool

HasRender returns true if any item in the Awards list needs to be rendered.

type Awards

type Awards struct {
	Label string
	List  AwardDetailSlice
	Rank  int
}

Awards type

type Basics

type Basics struct {
	Name     ValueType
	Label    ValueType
	Email    ValueType
	Phone    ValueType
	URL      ValueType
	Summary  ValueType
	Location Location
	Profiles []SocialProfile
	Rank     int
}

Basics type

type BriefAndDetail

type BriefAndDetail struct {
	Brief  string
	Detail string
}

BriefAndDetail type

type Config

type Config struct {
	Homepage string
	Theme    ThemeType
	Meta     ConfigMeta
}

Config type defining configuration.

type ConfigMeta

type ConfigMeta struct {
	HideFooterCredit bool
}

ConfigMeta meta data for Config type.

type Custom

type Custom struct {
	Label        string
	Type         string
	Work         WorkDetailSlice
	Publications PublicationDetailSlice
	Projects     ProjectDetailSlice
	Education    EducationDetailSlice
	Awards       AwardDetailSlice
	Skills       SkillDetailSlice
	Languages    LanguageDetailSlice
	Interests    InterestDetailSlice
	List         ListDetailSlice
	Meta         CustomMeta
	Rank         int
}

Custom type

type CustomMeta

type CustomMeta struct {
	ListStyleType string
}

CustomMeta type

type CustomSlice

type CustomSlice []Custom

CustomSlice type

type Education

type Education struct {
	Label string
	List  EducationDetailSlice
	Rank  int
}

Education type

type EducationDetail

type EducationDetail struct {
	Value struct {
		Institution string
		URL         string
		Major       string
		Minor       string
		Degree      string
		StartDate   string
		EndDate     string
		Grade       float32
		GradeTotal  float32
		Courses     []string
	}
	Render bool
}

EducationDetail type

type EducationDetailSlice

type EducationDetailSlice []EducationDetail

EducationDetailSlice type

func (EducationDetailSlice) HasRender

func (s EducationDetailSlice) HasRender() bool

HasRender returns true if any item in the Education list needs to be rendered.

type InterestDetail

type InterestDetail struct {
	Value struct {
		Name     string
		Keywords []string
	}
	Render bool
}

InterestDetail type

type InterestDetailSlice

type InterestDetailSlice []InterestDetail

InterestDetailSlice type

func (InterestDetailSlice) HasRender

func (s InterestDetailSlice) HasRender() bool

HasRender returns true if any item in the Interests list needs to be rendered.

type Interests

type Interests struct {
	Label string
	List  InterestDetailSlice
	Rank  int
}

Interests type

type LanguageDetail

type LanguageDetail struct {
	Value struct {
		Language string
		Fluency  string
	}
	Render bool
}

LanguageDetail type

type LanguageDetailSlice

type LanguageDetailSlice []LanguageDetail

LanguageDetailSlice type

func (LanguageDetailSlice) HasRender

func (s LanguageDetailSlice) HasRender() bool

HasRender returns true if any item in the Languages list needs to be rendered.

type Languages

type Languages struct {
	Label string
	List  LanguageDetailSlice
	Rank  int
}

Languages type

type ListDetail

type ListDetail struct {
	Value struct {
		Brief  string
		Detail string
	}
	Render bool
}

ListDetail type

func (*ListDetail) Sanitize

func (s *ListDetail) Sanitize()

Sanitize escapes required characters for ListDetail type.

type ListDetailSlice

type ListDetailSlice []ListDetail

ListDetailSlice type

func (ListDetailSlice) HasRender

func (s ListDetailSlice) HasRender() bool

HasRender returns true if any item in the list needs to be rendered.

type Location

type Location struct {
	Value struct {
		Address     string
		PostalCode  string
		City        string
		CountryName string
		Region      string
	}
	Render bool
}

Location type

type Profile

type Profile struct {
	Config       Config
	Basics       Basics
	Work         Work
	Education    Education
	Publications Publications
	Projects     Projects
	Awards       Awards
	Skills       Skills
	Languages    Languages
	Interests    Interests
	References   References
	Custom       CustomSlice
}

Profile type

type ProfileField

type ProfileField int

ProfileField type identifier for each section in a profile.

const (
	ConfigField       ProfileField = iota
	BasicsField       ProfileField = iota
	WorkField         ProfileField = iota
	EducationField    ProfileField = iota
	ProjectsField     ProfileField = iota
	AwardsField       ProfileField = iota
	PublicationsField ProfileField = iota
	SkillsField       ProfileField = iota
	LanguagesField    ProfileField = iota
	InterestsField    ProfileField = iota
	ReferencesField   ProfileField = iota
	ListField         ProfileField = iota
	CustomField       ProfileField = iota
)

ProfileField identifier consts.

type ProfileTheme

type ProfileTheme int

ProfileTheme type identifier for themes, i.e. basic, panther, etc.

const (
	BasicTheme   ProfileTheme = iota
	PantherTheme ProfileTheme = iota
)

Theme identifier consts

type ProjectDetail

type ProjectDetail struct {
	Value struct {
		Name        string
		Description string
		Team        string
		Note        string
		Highlights  []BriefAndDetail
		Keywords    []string
		StartDate   string
		EndDate     string
		URL         string
		Roles       []string
		Type        string
	}
	Render bool
}

ProjectDetail type

type ProjectDetailSlice

type ProjectDetailSlice []ProjectDetail

ProjectDetailSlice type

func (ProjectDetailSlice) HasRender

func (s ProjectDetailSlice) HasRender() bool

HasRender returns true if any item in the Projects list needs to be rendered.

type Projects

type Projects struct {
	Label string
	List  ProjectDetailSlice
	Rank  int
}

Projects type

type PublicationDetail

type PublicationDetail struct {
	Value struct {
		Type         string
		Category     string
		Author       string
		Title        string
		Editor       string
		Edition      string // either edition or series and volume
		Series       string
		Journal      string
		Volume       int
		Booktitle    string
		Publisher    string
		Address      string
		Note         string
		Howpublished string
		Year         int
		Number       int
		Pages        string
		URL          string
		WebPage      WebPage
	}
	Render bool
}

PublicationDetail type

func (*PublicationDetail) Parse

func (item *PublicationDetail) Parse(config Config) string

Parse returnes parsed Publication field based on the theme.

func (*PublicationDetail) ParseBasic

func (item *PublicationDetail) ParseBasic(config Config) string

ParseBasic Publication

func (*PublicationDetail) ParsePanther

func (item *PublicationDetail) ParsePanther(config Config) string

ParsePanther Publication

type PublicationDetailSlice

type PublicationDetailSlice []PublicationDetail

PublicationDetailSlice type

func (PublicationDetailSlice) HasRender

func (s PublicationDetailSlice) HasRender() bool

HasRender returns true if any item in the Publications list needs to be rendered.

type PublicationField

type PublicationField int

PublicationField type identifier for publication fields like article, book, thesis, etc.

const (
	ArticleField      PublicationField = iota
	BookField         PublicationField = iota
	ThesisField       PublicationField = iota
	TechReportField   PublicationField = iota
	InCollectionField PublicationField = iota
	MiscField         PublicationField = iota
	UnPublishedField  PublicationField = iota
)

article field types

type Publications

type Publications struct {
	Label string
	List  PublicationDetailSlice
	Rank  int
}

Publications type

type ReferenceDetail

type ReferenceDetail struct {
	Value struct {
		Name        string
		Title       string
		Affiliation string
		Address     string
		PostalCode  string
		City        string
		CountryName string
		Region      string
		PhoneNumber string
		Email       string
		URL         string
	}
	Render bool
}

ReferenceDetail type

type ReferenceDetailSlice

type ReferenceDetailSlice []ReferenceDetail

ReferenceDetailSlice type

func (ReferenceDetailSlice) HasRender

func (s ReferenceDetailSlice) HasRender() bool

HasRender returns true if any item in the Reference list needs to be rendered.

type References

type References struct {
	Label string
	List  ReferenceDetailSlice
	Rank  int
}

References type

type Renderable

type Renderable interface {
	HasRender() bool
}

Renderable interface

type SectionIndexRank

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

SectionIndexRank type

func GetSortedSectionArray

func GetSortedSectionArray(profile *Profile) []SectionIndexRank

GetSortedSectionArray returns array of SectionIndexRank type objects sorted by their ranks.

type SkillDetail

type SkillDetail struct {
	Value struct {
		Name     string
		Level    string
		Keywords []string
	}
	Render bool
}

SkillDetail type

type SkillDetailSlice

type SkillDetailSlice []SkillDetail

SkillDetailSlice type

func (SkillDetailSlice) HasRender

func (s SkillDetailSlice) HasRender() bool

HasRender returns true if any item in the Skills list needs to be rendered.

type Skills

type Skills struct {
	Label string
	List  SkillDetailSlice
	Rank  int
}

Skills type

type SocialProfile

type SocialProfile struct {
	Value struct {
		Network  string
		Username string
		URL      string
	}
	Render bool
}

SocialProfile type

type ThemeType

type ThemeType struct {
	Label  string
	Value  string
	Render bool
	Meta   struct {
		ShowPageNumbers             bool
		HideSectionLines            bool
		PantherHeaderNameFontSize   int
		PantherHeaderColumnOneWidth float32
		PantherHeaderColumnTwoWidth float32
	}
}

ThemeType defines the type for a theme object.

type ValueType

type ValueType struct {
	Label  string
	Value  string
	Render bool
}

ValueType one of the basic types to store label, value, render info.

type WebPage

type WebPage struct {
	Slug string
}

WebPage type

type Work

type Work struct {
	Label string
	List  WorkDetailSlice
	Rank  int
}

Work type

type WorkDetail

type WorkDetail struct {
	Value struct {
		Name       string
		Location   string
		Brief      string
		Position   string
		URL        string
		StartDate  string
		EndDate    string
		Active     bool
		Highlights []BriefAndDetail
	}
	Render bool
}

WorkDetail type

type WorkDetailSlice

type WorkDetailSlice []WorkDetail

WorkDetailSlice type

func (WorkDetailSlice) HasRender

func (s WorkDetailSlice) HasRender() bool

HasRender returns true if any item in the Work list needs to be rendered.

Jump to

Keyboard shortcuts

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