interwiki

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package interwiki provides interwiki capabilities. Most of them, at least.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HrefLinkFormatFor added in v1.11.0

func HrefLinkFormatFor(prefix string) (string, options.InterwikiError)

func ImgSrcFormatFor added in v1.11.0

func ImgSrcFormatFor(prefix string) (string, options.InterwikiError)

func Init

func Init()

func InitHandlers

func InitHandlers(rtr *mux.Router)

Types

type Wiki

type Wiki struct {
	// Name is the name of the wiki, and is also one of the possible prefices.
	Name string `json:"name"`

	// Aliases are alternative prefices you can use instead of Name. This slice can be empty.
	Aliases []string `json:"aliases,omitempty"`

	// URL is the address of the wiki.
	URL string `json:"url"`

	// LinkHrefFormat is a format string for interwiki links. See Mycomarkup internal docs hidden deep inside for more information.
	//
	// This field is optional. If it is not set, it is derived from other data. See the code.
	LinkHrefFormat string `json:"link_href_format"`

	ImgSrcFormat string `json:"img_src_format"`

	// Engine is the engine of the wiki. Invalid values will result in a start-up error.
	Engine WikiEngine `json:"engine"`
}

Wiki is an entry in the interwiki map.

type WikiEngine

type WikiEngine string

WikiEngine is an enumeration of supported interwiki targets.

const (
	Mycorrhiza WikiEngine = "mycorrhiza"
	Agora      WikiEngine = "agora"
	// Generic is any website.
	Generic WikiEngine = "generic"
)

func (WikiEngine) Valid added in v1.11.0

func (we WikiEngine) Valid() bool

Jump to

Keyboard shortcuts

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