shortlink

package module
v0.0.0-...-70a0976 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

README

goldmark-shortlink is an extension for the goldmark markdown parser which recognizes shortlinks like go/foobar and links them to fully-resolved domain names.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extender

type Extender struct {
	// A map of short link prefixes to their full URL prefixes.
	//
	// Example:
	// {"man": "https://man.gnoack.org/"}
	Prefixes map[string]string
}

Extender is a goldmark extension for recognizing shortlinks

A shortlink starts with a shortlink name, followed by a slash and a URL path, e.g. "go/foo".

Valid shortlink examples:

* go/foo * files/my/document.txt * wiki/FooBar * wiki/FooBar#Header1

func (*Extender) Extend

func (s *Extender) Extend(m goldmark.Markdown)

Jump to

Keyboard shortcuts

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