Documentation
¶
Index ¶
- func BuildExportHTML(content template.HTML, includeJS bool, rootDir string) (string, error)
- func ExportFilename(mdPath string) string
- func Open(url string) error
- type Article
- type ExportData
- type PDFData
- type PDFGenerator
- type Parser
- type RenderedDocument
- type Server
- type ServerOptions
- type TOCEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildExportHTML ¶ added in v0.11.0
BuildExportHTML renders a standalone HTML page from rendered Markdown content. When includeJS is true, <script> tags for Mermaid and MathJax are included (for use when the file will be opened while the server is running). When includeJS is false, no JS is emitted (for CLI export or fully static output). rootDir is the base directory for resolving local image paths. Pass "" to skip image embedding.
func ExportFilename ¶ added in v0.11.0
ExportFilename derives the output filename from a Markdown file path. README.md -> README.html, path/to/doc.md -> doc.html
Types ¶
type ExportData ¶ added in v0.11.0
type ExportData struct {
Content template.HTML
CssLight template.CSS // github-markdown-light.css
CssCodeLight template.CSS // Chroma light syntax highlighting
CssMermaid template.CSS // github-mermaid.css
CssMathJax template.CSS // mathjax.css
CssClipboard template.CSS // github-clipboard.css
IncludeJS bool // include <script> tags for Mermaid/MathJax
}
ExportData carries the data used by the export template (templates/export.html).
type PDFData ¶ added in v0.11.0
type PDFData struct {
Content template.HTML
CssLight template.CSS // github-markdown-light.css
CssPrint template.CSS // stripped github-print.css
CssCodeLight template.CSS // Chroma light syntax highlighting
CssMermaid template.CSS // github-mermaid.css
CssMathJax template.CSS // mathjax.css
}
PDFData carries the data used by the print template (templates/print.html).
type PDFGenerator ¶ added in v0.11.0
type PDFGenerator struct {
// contains filtered or unexported fields
}
PDFGenerator manages a headless Chrome browser pool for PDF generation.
func NewPDFGenerator ¶ added in v0.11.0
func NewPDFGenerator(maxConcurrent int) (*PDFGenerator, error)
NewPDFGenerator creates a new PDFGenerator with a headless Chrome allocator. maxConcurrent controls how many PDFs can be generated in parallel (1-4).
func (*PDFGenerator) Close ¶ added in v0.11.0
func (g *PDFGenerator) Close()
Close shuts down the Chrome browser allocator and releases resources.
func (*PDFGenerator) GeneratePDF ¶ added in v0.11.0
func (g *PDFGenerator) GeneratePDF(htmlContent string) ([]byte, error)
GeneratePDF renders an HTML string to PDF using headless Chrome. It returns the PDF bytes ready to serve.
type RenderedDocument ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServerWithOptions ¶
func NewServerWithOptions(opts ServerOptions) *Server