hyperlink

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

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

Info hold advanced settings of hyperlink

func New

func New(options ...Option) *Info

New creates and returns a new Info object that holds settings for hyperlink and related styles

func (*Info) Set

func (i *Info) Set(options ...Option)

Set sets new options for hyperlink

func (*Info) String

func (i *Info) String() string

String returns text version of hyperlink info

func (*Info) Validate

func (i *Info) Validate() error

nolint Validate validates hyperlink info and return error in case of invalid settings

type Option

type Option func(o *Info)

Option is helper type to set options for hyperlink

func Display

func Display(display string) Option

Display adds a display information for hyperlink

func Styles

func Styles(s interface{}) Option

Styles sets style format to requested DirectStyleID or styles.Info

func ToBookmark

func ToBookmark(location string) Option

ToBookmark sets target to bookmark, that can be named region in xlsx, bookmark of remote file or even site

func ToFile

func ToFile(fileName string) Option

ToFile sets target to external file

func ToMail

func ToMail(address, subject string) Option

ToMail sets target to email

func ToRef

func ToRef(ref types.Ref, sheetName string) Option

ToRef sets target to ref of sheet with sheetName. Omit sheetName to set location to ref of active sheet

func ToTarget

func ToTarget(target string) Option

ToTarget is very close to HYPERLINK function of Excel

 https://support.office.com/en-us/article/hyperlink-function-333c7ce6-c5ae-4164-9c47-7de9b76f577f

	a) to target: "target" or "[target]"
	b) to location at target: "[target]location" or "target#location"

Here are some examples of supported values:

  • same file, same sheet =HYPERLINK("#A1", "Reference to same sheet")

  • same file, other sheet =HYPERLINK("#SheetName!A1", "Reference to sheet without space in name") =HYPERLINK("#'Sheet Name'!A1", "Reference to sheet with space in name")

  • other local file =HYPERLINK("D:\Folder\File.docx","Word file") =HYPERLINK("D:\Folder\File.docx#Bookmark","Local Word file with bookmark") =HYPERLINK("D:\Folder\File.xlsx#SheetName!A1","Local Excel file with reference") =HYPERLINK("D:\Folder\File.xlsx#'Sheet Name'!A1","Local Excel file with reference")

    =HYPERLINK("[D:\Folder\File.docx]","Word file") =HYPERLINK("[D:\Folder\File.docx]Bookmark","Local Word file with bookmark") =HYPERLINK("[D:\Folder\File.xlsx]SheetName!A1","Local Excel file with reference") =HYPERLINK("[D:\Folder\File.xlsx]'Sheet Name'!A1","Local Excel file with reference")

  • other remote file =HYPERLINK("\\SERVER\Folder\File.doc", "Remote Word file") =HYPERLINK("\\SERVER\Folder\File.xlsx#SheetName!A1", "Remote Excel file with reference") =HYPERLINK("\\SERVER\Folder\File.xlsx#'Sheet Name'!A1", "Remote Excel file with reference") =HYPERLINK("[\\SERVER\Folder\File.xlsx]SheetName!A1", "Remote Excel file with reference") =HYPERLINK("[\\SERVER\Folder\File.xlsx]'Sheet Name'!A1", "Remote Excel file with reference")

  • url =HYPERLINK("https://www.spam.it","Website without bookmark") =HYPERLINK("https://www.spam.it/#bookmark","Website with bookmark") =HYPERLINK("[https://www.spam.it/]bookmark","Website with bookmark")

    -email =HYPERLINK("mailto:spam@spam.it","Email without subject") =HYPERLINK("mailto:spam@spam.it?subject=topic","Email with subject")

func ToUrl

func ToUrl(address string) Option

ToUrl sets target to web site

func Tooltip

func Tooltip(tip string) Option

Tooltip adds a tooltip information for hyperlink

Jump to

Keyboard shortcuts

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