Documentation ¶
Index ¶
- func Format(ctx context.Context, logger log.Logger, files []string, opts ...Option) error
- func FormatFrontMatter(m map[string]interface{}) ([]byte, error)
- type BackMatterTransformer
- type CodeBlockTransformer
- type Diffs
- type FormatFrontMatterTransformer
- type Formatter
- type FrontMatterTransformer
- type LinkTransformer
- type Option
- func WithBackMatterTransformer(bm BackMatterTransformer) Option
- func WithCodeBlockTransformer(cb CodeBlockTransformer) Option
- func WithFrontMatterTransformer(fm FrontMatterTransformer) Option
- func WithLinkTransformer(l LinkTransformer) Option
- func WithMetrics(reg *prometheus.Registry) Option
- func WithSoftWraps() Option
- type RemoveFrontMatter
- type SourceContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format formats given markdown files in-place. IsFormatted `With...` function to see what modifiers you can add.
func FormatFrontMatter ¶ added in v0.2.0
Types ¶
type BackMatterTransformer ¶ added in v0.9.0
type BackMatterTransformer interface { TransformBackMatter(ctx SourceContext) ([]byte, error) Close(ctx SourceContext) error }
type CodeBlockTransformer ¶
type CodeBlockTransformer interface { TransformCodeBlock(ctx SourceContext, infoString []byte, code []byte) ([]byte, error) Close(ctx SourceContext) error }
type Diffs ¶
type FormatFrontMatterTransformer ¶ added in v0.9.0
type FormatFrontMatterTransformer struct{}
func (FormatFrontMatterTransformer) Close ¶ added in v0.9.0
func (FormatFrontMatterTransformer) Close(SourceContext) error
func (FormatFrontMatterTransformer) TransformFrontMatter ¶ added in v0.9.0
func (FormatFrontMatterTransformer) TransformFrontMatter(_ SourceContext, frontMatter map[string]interface{}) ([]byte, error)
type FrontMatterTransformer ¶
type FrontMatterTransformer interface { TransformFrontMatter(ctx SourceContext, frontMatter map[string]interface{}) ([]byte, error) Close(ctx SourceContext) error }
type LinkTransformer ¶
type LinkTransformer interface { TransformDestination(ctx SourceContext, destination []byte) ([]byte, error) Close(ctx SourceContext) error }
type Option ¶
type Option func(*Formatter)
Option is a functional option type for Formatter objects.
func WithBackMatterTransformer ¶ added in v0.9.0
func WithBackMatterTransformer(bm BackMatterTransformer) Option
WithBackMatterTransformer allows you to override the default BackMatterTransformer.
func WithCodeBlockTransformer ¶
func WithCodeBlockTransformer(cb CodeBlockTransformer) Option
WithCodeBlockTransformer allows you to override the default CodeBlockTransformer.
func WithFrontMatterTransformer ¶
func WithFrontMatterTransformer(fm FrontMatterTransformer) Option
WithFrontMatterTransformer allows you to override the default FrontMatterTransformer.
func WithLinkTransformer ¶
func WithLinkTransformer(l LinkTransformer) Option
WithLinkTransformer allows you to override the default LinkTransformer.
func WithMetrics ¶ added in v0.9.0
func WithMetrics(reg *prometheus.Registry) Option
WithMetrics allows you to pass in Prometheus registry.
func WithSoftWraps ¶ added in v0.9.0
func WithSoftWraps() Option
WithCodeBlockTransformer allows you to override default softWrap.
type RemoveFrontMatter ¶
type RemoveFrontMatter struct{}
func (RemoveFrontMatter) Close ¶
func (RemoveFrontMatter) Close() error
func (RemoveFrontMatter) TransformFrontMatter ¶
func (RemoveFrontMatter) TransformFrontMatter(_ SourceContext, _ map[string]interface{}) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.