Documentation
¶
Overview ¶
Package plantuml provides rendering support for PlantUML diagrams.
Package plantuml provides rendering of PlantUML diagrams in Markdown content.
It detects ```plantuml code blocks in HTML content and converts them to SVG using either the PlantUML online server or a local plantuml command.
Package plantuml - plugin.go registers PlantUML rendering as an mdpress plugin.
Index ¶
- type Plugin
- func (p *Plugin) Cleanup() error
- func (p *Plugin) Description() string
- func (p *Plugin) Execute(hookCtx *plugin.HookContext) (*plugin.HookResult, error)
- func (p *Plugin) Hooks() []plugin.Phase
- func (p *Plugin) Init(cfg *config.BookConfig) error
- func (p *Plugin) Name() string
- func (p *Plugin) Version() string
- type Renderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements the plugin.Plugin interface for PlantUML diagram rendering.
func NewPlugin ¶
func NewPlugin() *Plugin
NewPlugin creates a new PlantUML plugin with default settings. If the default PlantUML server URL cannot be validated (e.g. DNS failure), the renderer is left nil; Init() must succeed before Execute() is called.
func (*Plugin) Description ¶
Description returns the plugin description.
func (*Plugin) Execute ¶
func (p *Plugin) Execute(hookCtx *plugin.HookContext) (*plugin.HookResult, error)
Execute processes the HTML content to render PlantUML diagrams.
func (*Plugin) Hooks ¶
Hooks returns the list of hook phases this plugin handles. PlantUML rendering happens after HTML parsing.
func (*Plugin) Init ¶
func (p *Plugin) Init(cfg *config.BookConfig) error
Init initializes the plugin from configuration. Expects config options:
- server: Base URL for PlantUML server (optional, defaults to https://www.plantuml.com/plantuml)
- local: Boolean flag to use local plantuml command (optional, defaults to false)
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer handles the detection and conversion of PlantUML diagrams.
func NewRenderer ¶
NewRenderer creates a new PlantUML renderer. serverURL should be the base URL without the /svg path (e.g. "https://www.plantuml.com/plantuml")
func (*Renderer) ClearCache ¶ added in v0.6.5
func (r *Renderer) ClearCache()
ClearCache removes all cached PlantUML renderings, freeing memory. This should be called between rebuild cycles in long-running processes.