reflink

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reflink links the first mention of each task id in a document that renders links. It does no I/O: the caller resolves each id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTMLLink(id, title, url string) string

HTMLLink is the task as an anchor, its title and url escaped.

func MarkdownLink(id, title, url string) string

MarkdownLink is the task as a markdown link, brackets in the title escaped so the link text always ends where the link does.

func None

func None(string) (string, string, bool)

None resolves nothing, so a scan only reports the bare mentions.

Types

type Mention

type Mention struct {
	ID     string
	Line   int
	Linked bool
}

A Mention is the first bare mention of an id in a document, at a 1-based line, and whether it was rewritten into a link.

func HTML

func HTML(text, prefix string, resolve Resolve) (string, []Mention)

HTML is Markdown for a page. It skips the elements that hold no prose and every tag's attributes, and an anchor counts as a link.

func Markdown

func Markdown(text, prefix string, resolve Resolve) (string, []Mention)

Markdown links each id's first bare mention. It skips code, comments and links, and the lines f10 or the host parses.

type Resolve

type Resolve func(id string) (title, url string, ok bool)

Resolve gives an id's title and url. False leaves the mention bare.

type Scan

type Scan func(text, prefix string, resolve Resolve) (string, []Mention)

A Scan is Markdown or HTML.

Jump to

Keyboard shortcuts

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