Documentation ¶
Overview ¶
Package links provides a data type for links.
Index ¶
- type Link
- func (link *Link) Classes() (classes string)
- func (link *Link) Display() string
- func (link *Link) Href() string
- func (link *Link) ImgSrc() string
- func (link *Link) IsBlueLink() bool
- func (link *Link) MarkAsExisting() *Link
- func (link *Link) OfKind(kind LinkType) bool
- func (link *Link) TargetHypha() string
- type LinkType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link is an abstraction for universal representation of links, be they links in mycomarkup links or whatever.
func (*Link) Classes ¶
Classes returns CSS class string for given link. It is not wrapped in any quotes, wrap yourself.
func (*Link) Href ¶
Href returns content for the href attribute for hyperlink. You should always use it.
func (*Link) IsBlueLink ¶ added in v0.5.1
IsBlueLink is true if the link should be blue, not red. Red links are links to hyphae that do not exist, all other links are blue.
func (*Link) MarkAsExisting ¶ added in v0.5.1
MarkAsExisting notes that the hypha does exist.
func (*Link) TargetHypha ¶ added in v0.5.1
TargetHypha returns the name of the target hypha. Use for hypha links.
type LinkType ¶
type LinkType int
LinkType tells what type the given link is.
const ( // LinkLocalRoot is a link like "/list", "/user-list", etc. LinkLocalRoot LinkType = iota // LinkLocalHypha is a link like "test", "../test", etc. LinkLocalHypha // LinkExternal is an external link with specified protocol. LinkExternal // LinkInterwiki is currently left unused. In the future it will be used for interwiki links. LinkInterwiki )