Documentation
¶
Index ¶
- type AstroWriter
- func (w *AstroWriter) TransformContent(content []byte, pkg string, meta DocMetadata) ([]byte, error)
- func (w *AstroWriter) WebsiteDir() string
- func (w *AstroWriter) WriteAsset(pkg, assetType, filename string, data []byte) error
- func (w *AstroWriter) WriteDoc(pkg, filename string, content []byte, meta DocMetadata) error
- func (w *AstroWriter) WriteManifest(manifest []byte) error
- type DocMetadata
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AstroWriter ¶
type AstroWriter struct {
// contains filtered or unexported fields
}
AstroWriter writes content in Astro's expected format. It handles: - Writing docs to src/content/docs/{pkg}/ - Writing assets to public/docs/{pkg}/ - Rewriting relative paths to absolute paths - Injecting/managing frontmatter
func NewAstro ¶
func NewAstro(websiteDir string) *AstroWriter
NewAstro creates a new AstroWriter for the given website directory
func (*AstroWriter) TransformContent ¶
func (w *AstroWriter) TransformContent(content []byte, pkg string, meta DocMetadata) ([]byte, error)
TransformContent applies Astro-specific transformations to markdown content. This delegates to the central transformer package for consistency.
func (*AstroWriter) WebsiteDir ¶
func (w *AstroWriter) WebsiteDir() string
WebsiteDir returns the target website directory
func (*AstroWriter) WriteAsset ¶
func (w *AstroWriter) WriteAsset(pkg, assetType, filename string, data []byte) error
WriteAsset writes an asset file to public/docs/{pkg}/{assetType}/{filename}
func (*AstroWriter) WriteDoc ¶
func (w *AstroWriter) WriteDoc(pkg, filename string, content []byte, meta DocMetadata) error
WriteDoc writes a documentation file to src/content/docs/{pkg}/{filename}
func (*AstroWriter) WriteManifest ¶
func (w *AstroWriter) WriteManifest(manifest []byte) error
WriteManifest writes the manifest file to docgen-output/manifest.json
type DocMetadata ¶
type DocMetadata struct {
Title string
Description string
Category string
Version string
Order int
Package string // Package title (for display)
}
DocMetadata contains metadata about a documentation file
type Writer ¶
type Writer interface {
// WriteDoc writes transformed markdown to the appropriate location
WriteDoc(pkg, filename string, content []byte, meta DocMetadata) error
// WriteAsset copies an asset (image, video, cast) to the appropriate location
WriteAsset(pkg, assetType, filename string, data []byte) error
// WriteManifest writes the manifest file
WriteManifest(manifest []byte) error
// TransformContent applies SSG-specific transformations (paths, frontmatter)
TransformContent(content []byte, pkg string, meta DocMetadata) ([]byte, error)
// WebsiteDir returns the target website directory
WebsiteDir() string
}
Writer abstracts output format for different static site generators. This allows docgen to support multiple SSGs like Astro, Hugo, Docusaurus, etc.