Documentation
¶
Index ¶
- func AppendIndex(endIndex int64) int64
- func AppendIndexForTarget(endIndex int64, segmentID string) int64
- func BuildDeleteRequest(target Range, tabID string) *docs.Request
- func BuildInsertRequest(text string, index int64, tabID string) *docs.Request
- func BuildUpdateRequests(text string, insertIndex int64, tabID string, replace *Range) []*docs.Request
- func BuildWriteRequests(options WriteOptions) ([]*docs.Request, error)
- func ValidateAnchor(options AnchorOptions) error
- type AnchorOptions
- type EndInsertPlacementOptions
- type InsertPlacementOptions
- type MarkdownWriteMode
- type MarkdownWriteOptions
- type MarkdownWritePlan
- type MarkdownWriteReason
- type Placement
- func PlanEndInsertPlacement(options EndInsertPlacementOptions) (Placement, error)
- func PlanInsertPlacement(options InsertPlacementOptions) (Placement, error)
- func PlanRangePlacement(options RangePlacementOptions) (Placement, error)
- func PlanUpdatePlacement(options UpdatePlacementOptions) (Placement, error)
- type PlacementFacts
- type PlacementKind
- type Range
- type RangePlacementOptions
- type ResolvedPlacement
- type SearchOptions
- type TextRange
- type UpdatePlacementOptions
- type ValidationError
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIndex ¶
func AppendIndexForTarget ¶ added in v0.30.0
func BuildInsertRequest ¶
func BuildUpdateRequests ¶
func BuildWriteRequests ¶
func BuildWriteRequests(options WriteOptions) ([]*docs.Request, error)
func ValidateAnchor ¶
func ValidateAnchor(options AnchorOptions) error
Types ¶
type AnchorOptions ¶
type EndInsertPlacementOptions ¶
type EndInsertPlacementOptions struct {
Index *int64
AllowZero bool
AtEnd bool
Anchor AnchorOptions
}
type InsertPlacementOptions ¶
type InsertPlacementOptions struct {
Index *int64
AllowZero bool
Anchor AnchorOptions
}
type MarkdownWriteMode ¶
type MarkdownWriteMode uint8
const ( MarkdownWriteDriveReplace MarkdownWriteMode = iota MarkdownWriteLocalAppend MarkdownWriteLocalReplace )
type MarkdownWriteOptions ¶
type MarkdownWritePlan ¶
type MarkdownWritePlan struct {
Mode MarkdownWriteMode
Reason MarkdownWriteReason
Markdown string
Tab string
ImageCount int
ExplicitHeadingAnchors []docsmarkdown.ExplicitHeadingAnchor
CheckOrphans bool
OrphanScopeWholeDocument bool
RewriteHeadingLinks bool
InsertImages bool
ApplyDocumentStyle bool
RequiresDriveService bool
RequiresDocumentsService bool
}
func PlanMarkdownWrite ¶
func PlanMarkdownWrite(options MarkdownWriteOptions) (MarkdownWritePlan, error)
type MarkdownWriteReason ¶
type MarkdownWriteReason uint8
const ( MarkdownWriteWholeDocument MarkdownWriteReason = iota MarkdownWriteAppend MarkdownWriteTab MarkdownWriteTableCellBreaks )
type Placement ¶
type Placement struct {
Kind PlacementKind
Index int64
Range Range
Anchor AnchorOptions
}
func PlanEndInsertPlacement ¶
func PlanEndInsertPlacement(options EndInsertPlacementOptions) (Placement, error)
func PlanInsertPlacement ¶
func PlanInsertPlacement(options InsertPlacementOptions) (Placement, error)
func PlanRangePlacement ¶
func PlanRangePlacement(options RangePlacementOptions) (Placement, error)
func PlanUpdatePlacement ¶
func PlanUpdatePlacement(options UpdatePlacementOptions) (Placement, error)
type PlacementFacts ¶
type PlacementKind ¶
type PlacementKind uint8
const ( PlacementEnd PlacementKind = iota PlacementIndex PlacementRange PlacementAnchor )
type RangePlacementOptions ¶
type RangePlacementOptions struct {
Start *int64
End *int64
AllowZero bool
Anchor AnchorOptions
}
type ResolvedPlacement ¶
type ResolvedPlacement struct {
Index int64
Range *Range
TabID string
SegmentID string
SegmentKind string
RequiredRevisionID string
Anchored bool
InTable bool
}
func ResolvePlacement ¶
func ResolvePlacement(placement Placement, facts PlacementFacts) (ResolvedPlacement, error)
type SearchOptions ¶
type SearchOptions struct {
MatchCase bool
NormalizeWhitespace bool
TabID string
PreserveHTMLEntities bool
RequireTextSegment bool
}
SearchOptions controls document text normalization and range constraints.
type TextRange ¶
type TextRange struct {
StartIndex int64 `json:"startIndex"`
EndIndex int64 `json:"endIndex"`
ParagraphIndex int `json:"paragraphIndex"`
TabID string `json:"tabId"`
InTable bool `json:"inTable,omitempty"`
}
TextRange is one matched Google Docs UTF-16 range.
func FindTextRanges ¶
func FindTextRanges( document *docs.Document, searchText string, options SearchOptions, ) []TextRange
FindTextRanges returns non-overlapping matches in document source order.
type UpdatePlacementOptions ¶
type UpdatePlacementOptions struct {
Index int64
IndexProvided bool
AllowZero bool
ReplaceRange string
Anchor AnchorOptions
}
type ValidationError ¶
type ValidationError string
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type WriteOptions ¶
Click to show internal directories.
Click to hide internal directories.