ukuleleweb

package module
v0.0.0-...-bdb9181 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

Ukuleleweb

🌺 Ukuleleweb is a simple Wiki implementation in the style of the original WikiWikiWeb / C2 wiki.

You can see it in action on wiki.gnoack.org, where you can also find some documentation.

Unit tests

Few dependencies

The only dependencies are a markdown renderer and Peter Bourgon's diskv library for storage.

Simple Storage

Wiki pages are simply stored in a directory, where file names are page names and each file contains the page's markdown source. This way, you can never lose your data, and it's also easy to put it under version control.

Features

  • Recognizes WikiLinks in the classic WikiWikiWeb style (just CamelCasedWords).
  • Recognizes go-link syntax (go/ukuleleweb)
  • Displays reverse links at the bottom of each page. (Reverse links are recalculated when saving a page.)
  • Each wiki page is a file on disk, it's easy to add small analysis scripts externally, or to generate new Wiki pages.

Non-features

Ukuleleweb does not have user management, nor an authentication mechanism. To keep your wiki confidential, place it behind a reverse proxy.

Run it

To run Ukuleleweb, create an empty directory where it can store data, and point it to that directory using the -store_dir flag:

go run cmd/ukuleleweb/main.go -store_dir=/some/empty/directory

or, to install it:

$ go install github.com/gnoack/ukuleleweb/cmd/ukuleleweb@latest
$ go/bin/ukuleleweb -store_dir=/some/emtpy/directory

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PageTmpl = template.Must(template.Must(baseTmpl.Clone()).ParseFS(templateFiles, "templates/contents/page.html"))
	EditTmpl = template.Must(template.Must(baseTmpl.Clone()).ParseFS(templateFiles, "templates/contents/edit.html"))
)
View Source
var WikiLinkExt = &wikiLinkExt{}

Functions

func AllReverseLinks(d *diskv.Diskv) map[string][]string

AllReverseLinks calculates the reverse link map for the whole wiki. The returned map maps page names to a list of pages linking to it. Sets of pages are represented as sorted lists.

func NewServer

func NewServer(cfg *Config) http.Handler
func OutgoingLinks(md string) map[string]bool

OutgoingLinks returns the outgoing wiki links in a given Markdown input. The outgoing links are a map of page names to true.

func RenderHTML

func RenderHTML(md string) (string, error)

func ToTitle

func ToTitle(pageName string) string

ToTitle turns a given page name into a human-readable title.

This means that it inserts a space before every capital letter, except for the first one.

Types

type Config

type Config struct {
	MainPage string
	Store    *diskv.Diskv
}

type PageHandler

type PageHandler struct {
	MainPage string
	D        *diskv.Diskv
	// contains filtered or unexported fields
}

func (*PageHandler) ServeHTTP

func (h *PageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ShortLinkExt

type ShortLinkExt struct{}

ShortLinkExt is a goldmark extension for recognizing shortlinks like go/links.

func (*ShortLinkExt) Extend

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

Directories

Path Synopsis
cmd
wikiviz
An experimental command line tool for visualizing the graph of wiki pages.
An experimental command line tool for visualizing the graph of wiki pages.

Jump to

Keyboard shortcuts

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