docsview

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 31 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docsview serves a read-only, Obsidian-style viewer for a repository's documentation directory. Markdown renders on the server; the browser adds navigation, search, the graph, Mermaid, and KaTeX.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Root is the repository directory. Only paths below it are served.
	Root string
	// Vaults are the note directories relative to Root, such as "docs" and
	// "openspec". Together they form the vault. The first holds the home note.
	Vaults []string
	// Assets is a verified directory of pinned browser assets.
	Assets string
	// AssetFiles lists the servable "name/path" entries under Assets.
	AssetFiles map[string]bool
	// AssetVersion is an immutable URL segment for Assets.
	AssetVersion string
	// Theme is the path of a theme stylesheet, absolute or relative to Root,
	// or "" for the built-in theme. Pages load it before viewer.css. The
	// .css and .woff2 files below its directory are served, so the
	// stylesheet can import the files next to it.
	Theme string
	// Poll is the live-reload check interval. Zero selects 500 ms.
	Poll time.Duration
	// SpecVault is the vault of OpenAPI specs, or "". Its YAML files render
	// as API reference pages.
	SpecVault string
}

Config selects the repository, the vault directories inside it, and verified assets.

type Handler

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

Handler serves the viewer. It is safe for concurrent use.

func New

func New(config Config) (*Handler, error)

New opens the repository and asset roots. Each vault directory must exist, and no vault directory can contain another.

func (*Handler) Close

func (h *Handler) Close() error

Close releases the directory handles.

func (*Handler) GitError

func (h *Handler) GitError() error

GitError returns the reason why the git diff features are off, or nil when they are on.

func (*Handler) ServeHTTP

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

Directories

Path Synopsis
Package linediff compares two sequences of strings with the Myers O(ND) algorithm in linear space.
Package linediff compares two sequences of strings with the Myers O(ND) algorithm in linear space.
Package markdown renders repository Markdown with the Obsidian syntax that the documentation viewer supports.
Package markdown renders repository Markdown with the Obsidian syntax that the documentation viewer supports.

Jump to

Keyboard shortcuts

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