Help us shape the future of Go! Take the 2026 Go Developer Survey

docgo

package module
v0.0.0-...-0cab60d Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 20 Imported by: 0

README

docgo

Write documentation in Go: pages built with htmlgo, served or exported as a static site, with a table of contents, search and highlighted code.

This is the go-rvq fork of theplant/docgo. It speaks github.com/go-rvq/htmlgo (Write(*Context) error instead of MarshalHTML) and the page runtime of github.com/go-rvq/rvq/web (instead of qor5/web). It is the library only: the upstream documentation site and the docgo CLI are not part of it. It is used by the documentation of rvq (admin/docs/docsrc).

import "github.com/go-rvq/docgo"
  • docgo.New() builds the site: .MainPageTitle(…), .SitePrefix(…), .Assets(prefix, fs), .DocTree(docs…), then .Build(); serve it (it is an http.Handler) or write it with .BuildStaticSite(dir).
  • docgo.Doc(children…) is a page: .Title(…), .Slug(…), .AbstractText(…); its content docgo.Markdown(…), code (ch.Code) and links to other pages (docgo.DocLink).
  • The JS and CSS of the pages are embedded (docjs/dist, ch/codehighlightjs/dist); their sources are in docjs and ch/codehighlightjs.

License: MIT, as upstream (see LICENSE).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSSComponentsPack

func CSSComponentsPack() web.ComponentsPack

func JSComponentsPack

func JSComponentsPack() web.ComponentsPack

func Markdown

func Markdown(body string) htmlgo.HTMLComponent

Types

type BoxBuilder

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

func Deprecated

func Deprecated(text string) (r *BoxBuilder)

func Experiment

func Experiment(text string) (r *BoxBuilder)

func Important

func Important(text string) (r *BoxBuilder)

func Note

func Note(text string) (r *BoxBuilder)

func Tip

func Tip(text string) (r *BoxBuilder)

func (*BoxBuilder) Children

func (b *BoxBuilder) Children(vs ...h.HTMLComponent) (r *BoxBuilder)

func (*BoxBuilder) Title

func (b *BoxBuilder) Title(v string) (r *BoxBuilder)

func (*BoxBuilder) Write

func (b *BoxBuilder) Write(ctx *h.Context) error

type Builder

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

func New

func New() (r *Builder)

func (*Builder) Assets

func (b *Builder) Assets(prefix string, v embed.FS) (r *Builder)

func (*Builder) Build

func (b *Builder) Build() (r *Builder)

func (*Builder) BuildStaticSite

func (b *Builder) BuildStaticSite(dir string)

func (*Builder) DocTree

func (b *Builder) DocTree(vs ...interface{}) (r *Builder)

*DocBuilder, *DocsGroup

func (*Builder) MainPageTitle

func (b *Builder) MainPageTitle(v string) (r *Builder)

func (*Builder) ServeHTTP

func (b *Builder) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Builder) SitePrefix

func (b *Builder) SitePrefix(v string) (r *Builder)

type DocBuilder

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

func Doc

func Doc(vs ...HTMLComponent) (r *DocBuilder)

func (*DocBuilder) AbstractText

func (b *DocBuilder) AbstractText(v string) (r *DocBuilder)

func (*DocBuilder) GetPageURL

func (b *DocBuilder) GetPageURL() (r string)

func (*DocBuilder) Slug

func (b *DocBuilder) Slug(v string) (r *DocBuilder)

func (*DocBuilder) Title

func (b *DocBuilder) Title(v string) (r *DocBuilder)

func (*DocBuilder) Write

func (b *DocBuilder) Write(ctx *Context) error

type DocLinkBuilder

type DocLinkBuilder struct {
	// contains filtered or unexported fields
}
func DocLink(doc *DocBuilder) (r *DocLinkBuilder)

func (*DocLinkBuilder) Write

func (b *DocLinkBuilder) Write(ctx *Context) error

type DocsGroup

type DocsGroup struct {
	Title string
	Docs  []*DocBuilder
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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