goldmark_wikilinks

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 5 Imported by: 1

README

This is a goldmark plugin for processing wikilinks (links that look like [[Hi there]]). You can add it directly to your goldmark to have it turn links like the example into [Hi there](Hi there.html). Using a FilenameNormalizer you can customize what the link destination is. Using a WikilinkTracker you can gather up the links to create a list of backlinks, which was the reason I created this in the first place.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Wikilinks = &wikilinks{}

Functions

func NewWikilinksParser

func NewWikilinksParser() *wikilinksParser

NewWikilinksParser gives you back a parser that you can use to process wikilinks.

Types

type FilenameNormalizer

type FilenameNormalizer interface {
	Normalize(linkText string) string
}

FilenameNormalizer is a plugin which takes link text and converts the text given to a filename which can be linked to in the final format of your file.

type WikilinkTracker

type WikilinkTracker interface {
	LinkWithContext(destText string, destFilename string, context string)
}

WikilinkTracker is a plugin that can get called for each discovered link and gather up information about the links. This is useful for creating backlinks, for example (the purpose for which I created this plugin).

Jump to

Keyboard shortcuts

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