package links
import "git.sr.ht/~bouncepaw/mycomarkup/v5/links"
Index ¶
- type InterwikiLink
- func (l *InterwikiLink) Classes(_ mycocontext.Context) string
- func (l *InterwikiLink) DisplayedText() string
- func (l *InterwikiLink) Err() error
- func (l *InterwikiLink) HyphaProbe(mycocontext.Context) func(string)
- func (l *InterwikiLink) ImgSrc(ctx mycocontext.Context) string
- func (l *InterwikiLink) LinkHref(ctx mycocontext.Context) string
- func (l *InterwikiLink) TryToGetError(ctx mycocontext.Context) bool
- type Link
- type LocalLink
- func (l *LocalLink) Classes(ctx mycocontext.Context) string
- func (l *LocalLink) DisplayedText() string
- func (l *LocalLink) Existing() bool
- func (l *LocalLink) HyphaProbe(ctx mycocontext.Context) func(string)
- func (l *LocalLink) ImgSrc(ctx mycocontext.Context) string
- func (l *LocalLink) LinkHref(ctx mycocontext.Context) string
- func (l *LocalLink) Target(ctx mycocontext.Context) string
- type LocalRootedLink
- func (l *LocalRootedLink) Classes(_ mycocontext.Context) string
- func (l *LocalRootedLink) DisplayedText() string
- func (l *LocalRootedLink) HyphaProbe(_ mycocontext.Context) func(string)
- func (l *LocalRootedLink) ImgSrc(_ mycocontext.Context) string
- func (l *LocalRootedLink) LinkHref(_ mycocontext.Context) string
- type URLLink
Types ¶
type InterwikiLink ¶
type InterwikiLink struct {
// contains filtered or unexported fields
}
InterwikiLink in Mycomarkup has this syntax:
[[prefix>target]] [[prefix>target|display]]
For every prefix, there is a known link format. A link format is a format string, that might resemble Go's format strings, but they are actually not. This is DSL for link formats. It is inspired by DokuWiki's interwiki link format: https://www.dokuwiki.org/interwiki.
https://example.org/view/{NAME}
Supported instructions are (more will be added):
{NAME} is the document name without any encoding.
func (*InterwikiLink) Classes ¶
func (l *InterwikiLink) Classes(_ mycocontext.Context) string
func (*InterwikiLink) DisplayedText ¶
func (l *InterwikiLink) DisplayedText() string
func (*InterwikiLink) Err ¶
func (l *InterwikiLink) Err() error
func (*InterwikiLink) HyphaProbe ¶
func (l *InterwikiLink) HyphaProbe(mycocontext.Context) func(string)
func (*InterwikiLink) ImgSrc ¶
func (l *InterwikiLink) ImgSrc(ctx mycocontext.Context) string
func (*InterwikiLink) LinkHref ¶
func (l *InterwikiLink) LinkHref(ctx mycocontext.Context) string
func (*InterwikiLink) TryToGetError ¶
func (l *InterwikiLink) TryToGetError(ctx mycocontext.Context) bool
type Link ¶
type Link interface { // Classes returns a string to put into the class attr in HTML. Classes(ctx mycocontext.Context) string // LinkHref returns a string to put into the href attr of <a>. LinkHref(ctx mycocontext.Context) string // ImgSrc returns a string to put into the src attr of <img>. ImgSrc(ctx mycocontext.Context) string // DisplayedText returns a string to put inside <a>. DisplayedText() string // HyphaProbe returns a function that captures the Link. Probes are checked against all existing hyphae. This is Mycorrhiza-specific. If it is nil, do not check this link for existence. TODO: make it optional. HyphaProbe(ctx mycocontext.Context) func(string) }
Link is a link of some kind.
func LinkFrom ¶
func LinkFrom(ctx mycocontext.Context, target, display string) Link
type LocalLink ¶
type LocalLink struct {
// contains filtered or unexported fields
}
func (*LocalLink) Classes ¶
func (l *LocalLink) Classes(ctx mycocontext.Context) string
func (*LocalLink) DisplayedText ¶
func (*LocalLink) Existing ¶
func (*LocalLink) HyphaProbe ¶
func (l *LocalLink) HyphaProbe(ctx mycocontext.Context) func(string)
func (*LocalLink) ImgSrc ¶
func (l *LocalLink) ImgSrc(ctx mycocontext.Context) string
func (*LocalLink) LinkHref ¶
func (l *LocalLink) LinkHref(ctx mycocontext.Context) string
func (*LocalLink) Target ¶
func (l *LocalLink) Target(ctx mycocontext.Context) string
type LocalRootedLink ¶
type LocalRootedLink struct {
// contains filtered or unexported fields
}
func (*LocalRootedLink) Classes ¶
func (l *LocalRootedLink) Classes(_ mycocontext.Context) string
func (*LocalRootedLink) DisplayedText ¶
func (l *LocalRootedLink) DisplayedText() string
func (*LocalRootedLink) HyphaProbe ¶
func (l *LocalRootedLink) HyphaProbe(_ mycocontext.Context) func(string)
func (*LocalRootedLink) ImgSrc ¶
func (l *LocalRootedLink) ImgSrc(_ mycocontext.Context) string
func (*LocalRootedLink) LinkHref ¶
func (l *LocalRootedLink) LinkHref(_ mycocontext.Context) string
type URLLink ¶
type URLLink struct {
// contains filtered or unexported fields
}
func (*URLLink) Classes ¶
func (l *URLLink) Classes(_ mycocontext.Context) string
func (*URLLink) DisplayedText ¶
func (*URLLink) HyphaProbe ¶
func (l *URLLink) HyphaProbe(_ mycocontext.Context) func(string)
func (*URLLink) ImgSrc ¶
func (l *URLLink) ImgSrc(_ mycocontext.Context) string
func (*URLLink) LinkHref ¶
func (l *URLLink) LinkHref(_ mycocontext.Context) string
Source Files ¶
- Version
- v5.6.0 (latest)
- Published
- Nov 29, 2023
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 7 hours ago –
Tools for package owners.