Documentation
¶
Index ¶
Constants ¶
View Source
const KindleClippingLimitMessage = "<You have reached the clipping limit for this item>"
View Source
const KindleClippingsSeparator = "=========="
Variables ¶
View Source
var KindleClippingsSeparatorMatcher *regexp.Regexp = regexp.MustCompile(`={10}`)
View Source
var KindleDescriptionLineVariations []KindleDescriptionLineVariation = []KindleDescriptionLineVariation{ { Matcher: regexp.MustCompile(`^- Your (.+?) on page ([ivx0-9]+) \| location (\d+)-?(\d+)? \| Added on (.+)$`), RequiredMatchCount: 12, Type: [2]int{2, 3}, Page: [2]int{4, 5}, LocationInSourceStart: [2]int{6, 7}, LocationInSourceEnd: [2]int{8, 9}, CreateTime: [2]int{10, 11}, CreateTimeFormat: "Monday, 2 January 2006 15:04:05", }, { Matcher: regexp.MustCompile(`^- Your (.+?) at location (\d+)-?(\d+)? \| Added on (.+)$`), RequiredMatchCount: 10, Type: [2]int{2, 3}, Page: [2]int{-1, -1}, LocationInSourceStart: [2]int{4, 5}, LocationInSourceEnd: [2]int{6, 7}, CreateTime: [2]int{8, 9}, CreateTimeFormat: "Monday, 2 January 2006 15:04:05", }, { Matcher: regexp.MustCompile(`- (\d+)ページ\|位置No. (\d+)-?(\d+)?の(.+) \|作成日: (.+)`), RequiredMatchCount: 12, Type: [2]int{8, 9}, Page: [2]int{2, 3}, LocationInSourceStart: [2]int{4, 5}, LocationInSourceEnd: [2]int{6, 7}, CreateTime: [2]int{10, 11}, CreateTimeFormat: "2006年1月2日", }, { Matcher: regexp.MustCompile(`^- Your (.+?) on page ([ivx0-9]+) \| Location (\d+)-?(\d+)? \| Added on (.+)$`), RequiredMatchCount: 12, Type: [2]int{2, 3}, Page: [2]int{4, 5}, LocationInSourceStart: [2]int{6, 7}, LocationInSourceEnd: [2]int{8, 9}, CreateTime: [2]int{10, 11}, CreateTimeFormat: "Monday, January 2, 2006 3:04:05 PM", }, { Matcher: regexp.MustCompile(`^- Your (.+?) on Location (\d+)-?(\d+)? \| Added on (.+)$`), RequiredMatchCount: 10, Type: [2]int{2, 3}, Page: [2]int{-1, -1}, LocationInSourceStart: [2]int{4, 5}, LocationInSourceEnd: [2]int{6, 7}, CreateTime: [2]int{8, 9}, CreateTimeFormat: "Monday, January 2, 2006 3:04:05 PM", }, }
Functions ¶
This section is empty.
Types ¶
type BookcisionClippingSet ¶
type BookcisionClippingSet struct { Title string `json:"title"` Authors string `json:"authors"` Highlights []BookcisionHighlight }
type BookcisionClippings ¶
func (*BookcisionClippings) Parse ¶
func (b *BookcisionClippings) Parse() (Clippings, error)
Parse ...
type BookcisionHighlight ¶
type BookcisionHighlight struct { Text string IsNoteOnly bool Location BookcisionHighlightLocation Note string }
type Clipping ¶
type Clipping struct { Source string `yaml:"source"` Type ClippingType `yaml:"type"` // Page is not always a number. Sometimes it is a lowercase Roman numeral "ix" Page string `yaml:"page"` LocationInSource Location `yaml:"location_in_source"` CreateTime time.Time `yaml:"create_time"` Text string `yaml:"text"` }
type ClippingType ¶
type ClippingType int
const ( ClippingType_None ClippingType = iota ClippingType_Highlight ClippingType_Note )
type KindleClippings ¶
type KindleClippings struct { FilePath string RemoveClippingLimitClippings bool // contains filtered or unexported fields }
func (*KindleClippings) Parse ¶
func (k *KindleClippings) Parse() (Clippings, error)
A sample clipping:
--- Sample START ---
Alias Grace (Atwood, Margaret) - Your Highlight on page 22 | location 281-283 | Added on Sunday, 5 May 2019 10:23:20
They were bell-shaped and ruffled, gracefully waving and lovely under the sea; but if they washed up on the beach and dried out in the sun there was nothing left of them. And that is what the ladies are like: mostly water. ==========
--- Sample END ---
An alternate form of the second line is:
--- Sample START ---
- Your Highlight on page ix | location 341-344 | Added on Saturday, 25 January 2020 10:47:54
--- Sample END ---
Click to show internal directories.
Click to hide internal directories.