wiki

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: GPL-3.0 Imports: 9 Imported by: 1

README

goldmark-wiki godocs.io builds.sr.ht status

Adds wiki style link support to goldmark. Includes a parsers and HTML renderer. I use this extension's parser in my gemtext renderer library.

A wiki style link uses the form [[click here]] where "click here" will be both the link's destination and label. A pipe character | can provide a seperate destination and label: [[destination page|click here]]

import (
    "bytes"
    "github.com/yuin/goldmark"
    "github.com/yuin/goldmark/extension"
)

md := goldmark.New(
  goldmark.WithExtensions(wiki.Wiki),
)
var buf bytes.Buffer
if err := md.Convert(source, &buf); err != nil {
    panic(err)
}

Documentation

Overview

Package wiki is an extension for goldmark. https://github.com/yuin/goldmark

Index

Constants

This section is empty.

Variables

View Source
var Wiki = &wiki{}

Wiki is a goldmark.Extender implementation.

Functions

func New

func New() goldmark.Extender

New returns a new extension. Useless, but included for compatibility.

func NewHTMLRenderer

func NewHTMLRenderer() renderer.NodeRenderer

NewHTMLRenderer returns a new HTMLRenderer.

func NewParser

func NewParser() parser.InlineParser

NewParser returns a new parser.InlineParser that can parse wiki link syntax.

Types

This section is empty.

Directories

Path Synopsis
Package ast defines a wiki link AST node to represent the wiki extension's link element.
Package ast defines a wiki link AST node to represent the wiki extension's link element.

Jump to

Keyboard shortcuts

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