Documentation
¶
Index ¶
- func AddTitleFromFilename(content, filename string, level int) string
- func CheckPandocAvailability() error
- func GetMarkdownFilesInDir(dir string) ([]string, error)
- func ShiftHeadings(content string, shiftBy int) string
- type DefaultExporter
- type ExportOptions
- type Exporter
- type Merger
- type PandocExporter
- type SiteReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTitleFromFilename ¶
AddTitleFromFilename Add heading from filename
func CheckPandocAvailability ¶
func CheckPandocAvailability() error
CheckPandocAvailability Check if Pandoc is available
func GetMarkdownFilesInDir ¶
GetMarkdownFilesInDir gets all Markdown files in a directory and sorts them by filename
func ShiftHeadings ¶
ShiftHeadings Adjust heading levels in Markdown text
Types ¶
type DefaultExporter ¶
type DefaultExporter struct {
// contains filtered or unexported fields
}
DefaultExporter is the default exporter implementation
func (*DefaultExporter) ExportDirectory ¶
func (e *DefaultExporter) ExportDirectory(inputDir, output string, options ExportOptions) error
ExportDirectory exports Markdown files in a directory
func (*DefaultExporter) ExportFile ¶
func (e *DefaultExporter) ExportFile(input, output string, options ExportOptions) error
ExportFile exports a single Markdown file
type ExportOptions ¶
type ExportOptions struct {
Template string // Word template file path
GenerateToc bool // Whether to generate table of contents
ShiftHeadingLevelBy int // Heading level offset
FileAsTitle bool // Whether to use filename as section title
Format string // Output format (docx, pdf, epub)
SiteType string // Site type (mkdocs, hugo, docusaurus)
Verbose bool // Whether to enable verbose logging
Logger *log.Logger // Logger
SourceDirs []string // List of source directories for processing image paths
TocDepth int // Table of contents depth, default is 3
}
ExportOptions defines export options
type Exporter ¶
type Exporter interface {
Export(input string, output string, options ExportOptions) error
}
Exporter defines exporter interface
type Merger ¶
type Merger struct {
ShiftHeadingLevelBy int
FileAsTitle bool
Logger *log.Logger
// Store all source directories, used to set Pandoc's resource paths
SourceDirs []string
// Whether to enable verbose logging
Verbose bool
}
Merger Merge multiple Markdown files
type PandocExporter ¶
PandocExporter Use Pandoc to export Markdown files
func (*PandocExporter) Export ¶
func (e *PandocExporter) Export(input, output string, options ExportOptions) error
Export Use Pandoc to export Markdown files
Click to show internal directories.
Click to hide internal directories.