markdown

package
v0.0.0-...-32c27a5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

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

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

func (m *MarkdownRenderer) GetConfig(ctx context.Context) (map[string]any, error)

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.

func (*MarkdownRenderer) SetConfig

func (m *MarkdownRenderer) SetConfig(ctx context.Context, config map[string]any) error

SetConfig updates provider configuration with validation and hot-reloading support.

Source Files

  • factory.go
  • renderer.go

Jump to

Keyboard shortcuts

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