Documentation
¶
Overview ¶
Package markdown provides a Goldmark-based markdown rendering implementation for NASA S3E.
Package markdown provides a Goldmark-based markdown rendering implementation for NASA S3E.
This module implements the full RenderingProvider interface using Goldmark as the core markdown parsing and rendering engine. It supports CommonMark compliance, syntax highlighting, front matter processing, and template integration.
Index ¶
- type MarkdownFactory
- func (f *MarkdownFactory) Create(config map[string]any, initialize bool, moduleRegistry types.ModuleRegistry) (common.ModuleProvider, error)
- func (f *MarkdownFactory) CreateRenderingProvider(config map[string]any, initialize bool, moduleRegistry types.ModuleRegistry) (rendering.RenderingProvider, error)
- func (f *MarkdownFactory) Description() string
- func (f *MarkdownFactory) GetModuleType() types.ModuleType
- func (f *MarkdownFactory) Name() string
- type MarkdownRenderer
- func (m *MarkdownRenderer) CanRender(document *types.Document) bool
- func (m *MarkdownRenderer) CheckSupportOutputFormat(format string) bool
- func (m *MarkdownRenderer) Close() error
- func (m *MarkdownRenderer) GetConfig(ctx context.Context) (map[string]any, error)
- func (m *MarkdownRenderer) GetModuleType() types.ModuleType
- func (m *MarkdownRenderer) GetSupportedInputFormats() []*types.FormatInfo
- func (m *MarkdownRenderer) GetSupportedOutputFormats() []*types.FormatInfo
- func (m *MarkdownRenderer) HealthCheck(ctx context.Context) error
- func (m *MarkdownRenderer) Initialize(config map[string]any) error
- func (m *MarkdownRenderer) Render(ctx context.Context, document *types.Document, options *types.RenderOptions) (*types.RenderResult, error)
- func (m *MarkdownRenderer) SetConfig(ctx context.Context, config map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarkdownFactory ¶
type MarkdownFactory struct{}
MarkdownFactory implements the RenderingFactory interface for creating markdown rendering providers.
func NewMarkdownFactory ¶
func NewMarkdownFactory() *MarkdownFactory
NewMarkdownFactory creates a new markdown rendering factory.
func (*MarkdownFactory) Create ¶
func (f *MarkdownFactory) Create(config map[string]any, initialize bool, moduleRegistry types.ModuleRegistry) (common.ModuleProvider, error)
Create creates a new markdown rendering provider instance with the given configuration.
func (*MarkdownFactory) CreateRenderingProvider ¶
func (f *MarkdownFactory) CreateRenderingProvider(config map[string]any, initialize bool, moduleRegistry types.ModuleRegistry) (rendering.RenderingProvider, error)
CreateRenderingProvider creates a new rendering provider instance with the given configuration. The same as Create but with proper returning type.
func (*MarkdownFactory) Description ¶
func (f *MarkdownFactory) Description() string
Description returns a human-readable description of the rendering provider. Should include capabilities and use cases.
func (*MarkdownFactory) GetModuleType ¶
func (f *MarkdownFactory) GetModuleType() types.ModuleType
GetModuleType returns the module type of the provider.
func (*MarkdownFactory) Name ¶
func (f *MarkdownFactory) Name() string
Name returns the unique name of the rendering provider type. Used for provider registration and configuration.
type MarkdownRenderer ¶
type MarkdownRenderer struct {
// contains filtered or unexported fields
}
MarkdownRenderer implements the RenderingProvider interface using Goldmark. It provides full-featured markdown rendering with syntax highlighting, front matter processing, and template integration.
func NewMarkdownRenderer ¶
func NewMarkdownRenderer(moduleRegistry types.ModuleRegistry) *MarkdownRenderer
NewMarkdownRenderer creates a new MarkdownRenderer instance.
func (*MarkdownRenderer) CanRender ¶
func (m *MarkdownRenderer) CanRender(document *types.Document) bool
CanRender checks if the provider can render the given document type. The markdown renderer can handle markdown files and plain text.
func (*MarkdownRenderer) CheckSupportOutputFormat ¶
func (m *MarkdownRenderer) CheckSupportOutputFormat(format string) bool
CheckSupportOutputFormat checks if the provider supports the specified output format.
func (*MarkdownRenderer) Close ¶
func (m *MarkdownRenderer) Close() error
Close cleans up any resources used by the rendering provider.
func (*MarkdownRenderer) GetConfig ¶
GetConfig retrieves current provider configuration with sensitive data filtering.
func (*MarkdownRenderer) GetModuleType ¶
func (m *MarkdownRenderer) GetModuleType() types.ModuleType
GetModuleType returns the module type for this rendering provider.
func (*MarkdownRenderer) GetSupportedInputFormats ¶
func (m *MarkdownRenderer) GetSupportedInputFormats() []*types.FormatInfo
GetSupportedInputFormats returns detailed information about supported input formats.
func (*MarkdownRenderer) GetSupportedOutputFormats ¶
func (m *MarkdownRenderer) GetSupportedOutputFormats() []*types.FormatInfo
GetSupportedOutputFormats returns detailed information about supported output formats.
func (*MarkdownRenderer) HealthCheck ¶
func (m *MarkdownRenderer) HealthCheck(ctx context.Context) error
HealthCheck returns the health status of the rendering provider.
func (*MarkdownRenderer) Initialize ¶
func (m *MarkdownRenderer) Initialize(config map[string]any) error
Initialize sets up the rendering provider with the given configuration.
func (*MarkdownRenderer) Render ¶
func (m *MarkdownRenderer) Render(ctx context.Context, document *types.Document, options *types.RenderOptions) (*types.RenderResult, error)
Render transforms the document content into the final output format. For the markdown renderer, this processes markdown content into HTML with optional template application.
Source Files
¶
- factory.go
- renderer.go