Documentation
¶
Overview ¶
Package linkrewrite handles Markdown link rewriting across different output formats. It transforms .md file references in HTML content to appropriate targets (anchor links for single-page, page links for multi-page site).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizePath ¶
NormalizePath normalizes a chapter file path for consistent map lookups. It cleans the path, converts to forward slashes, and lowercases the file extension so that "chapter.MD" and "chapter.md" resolve to the same key.
Types ¶
type Mode ¶
type Mode string
Mode determines how links are rewritten.
const ( // ModeSingle rewrites .md links to #anchor links within a single page. ModeSingle Mode = "single" // ModeSite rewrites .md links to separate page filenames. ModeSite Mode = "site" // ModeEpub rewrites .md links to the flat <chapterID>.xhtml documents an // ePub's OEBPS directory is made of. Without it a cross-chapter link ships // as a dead .md href, which epubcheck reports as RSC-007 and readers // silently ignore. ModeEpub Mode = "epub" )
Click to show internal directories.
Click to hide internal directories.