wiki

package
v0.0.0-...-77dcaa2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArticleTemplate = `` /* 3822-byte string literal not displayed */

ArticleTemplate is the default template for articles

View Source
var EditorTemplate = `` /* 1477-byte string literal not displayed */

EditorTemplate is the default template for the wiki editor

Functions

This section is empty.

Types

type ArticleMeta

type ArticleMeta struct {
	Title      string `yml:"title"`
	LastEdit   string `yml:"lastEditedAt"`
	LastEditor string `yml:"lastEditedBy"`
}

ArticleMeta specifies all stuff

type HeadLevel

type HeadLevel struct {
	Name     string
	ID       string
	Children []HeadLevel
	Depth    int
}

HeadLevel specifies data about what to be put in the index

type Wiki

type Wiki struct {
	// contains filtered or unexported fields
}

Wiki is an instance for the wiki element

func NewWiki

func NewWiki(manager manager.Manager, articleTempl, editorTempl string) Wiki

NewWiki returns a new Wiki instance

func (*Wiki) ExtractMeta

func (wiki *Wiki) ExtractMeta(v *ArticleMeta, file []byte) ([]byte, error)

ExtractMeta gives the meta information from a byte slice

func (*Wiki) GetSource

func (wiki *Wiki) GetSource(w http.ResponseWriter, r *http.Request)

GetSource returns the source for an article

func (*Wiki) HandleEdit

func (wiki *Wiki) HandleEdit(w http.ResponseWriter, r *http.Request)

HandleEdit handles an edit

func (*Wiki) ReadMarkdown

func (wiki *Wiki) ReadMarkdown(name string) []byte

ReadMarkdown reads the markdown file for an article

func (*Wiki) RenderMarkdown

func (wiki *Wiki) RenderMarkdown(w http.ResponseWriter, r *http.Request)

RenderMarkdown renders the markdown of the article

func (*Wiki) Router

func (wiki *Wiki) Router() chi.Router

Router returns a valid router for the wiki module

func (*Wiki) WikiEditor

func (wiki *Wiki) WikiEditor(w http.ResponseWriter, r *http.Request)

WikiEditor renders the editor view

Jump to

Keyboard shortcuts

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