Documentation
¶
Index ¶
- Constants
- func DocDir(ctx context.Context) string
- func New() *cli.Command
- func Serve(ctx context.Context, addr string, contentPath string) error
- func ServeDocHandler(m *Module) http.HandlerFunc
- func WithDocDir(ctx context.Context, dir string) context.Context
- type DocMeta
- type Module
- type Tab
- type TabConfig
- type TabGroup
Constants ¶
View Source
const Name = "Start documentation server for markdown files"
Name is the command title.
Variables ¶
This section is empty.
Functions ¶
func ServeDocHandler ¶ added in v0.0.12
func ServeDocHandler(m *Module) http.HandlerFunc
ServeDocHandler returns an http.HandlerFunc that serves docs (for testing).
Types ¶
type DocMeta ¶
type DocMeta struct {
Title string `yaml:"title"`
Subtitle string `yaml:"subtitle"`
Layout string `yaml:"layout"`
}
DocMeta represents frontmatter metadata for a doc.
type Module ¶
type Module struct {
platform.UnimplementedModule
FS fs.FS
// contains filtered or unexported fields
}
Module represents the docs module for the platform.
func (*Module) DirectivesHandler ¶ added in v0.0.12
DirectivesHandler returns a handler for paragraphs containing @ directives. It detects lines starting with @ and processes them as directives, maintaining compatibility with the legacy @tabs, @render, @file, @example syntax.
func (*Module) LoadMarkdown ¶ added in v0.0.12
LoadMarkdown loads and parses a markdown file from the module's filesystem.
func (*Module) TabsHandler ¶ added in v0.0.12
TabsHandler returns a handler for ```tabs code blocks.
type Tab ¶
type Tab struct {
Label string
Content string
IsCode bool
Mode string // Ace editor mode (html, yaml, json, etc.)
}
Tab represents a single tab.
Click to show internal directories.
Click to hide internal directories.