Documentation
¶
Index ¶
- func ClosesFence(text, fence string) bool
- func FenceDelimiter(text string) string
- func FormatComment(path, text string) string
- func RegisterLanguage(ext string, e Extractor)
- func RegisterLineComment(ext string, prefix string)
- func SetPythonDocstrings(enabled bool)
- type Block
- func Extract(path string) ([]Block, error)
- func ExtractWithLoader(path string, loader func(string) ([]byte, error)) ([]Block, error)
- func ExtractWithNeedle(path, needle string, loader func(string) ([]byte, error)) ([]Block, error)
- func ExtractWithSettings(path, needle string, loader func(string) ([]byte, error), docstrings *bool) ([]Block, error)
- type Extractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClosesFence ¶
func FenceDelimiter ¶
FenceDelimiter returns a Markdown fence of at least three matching markers.
func FormatComment ¶
FormatComment uses the same registered language delimiters as extraction. Explicit line-comment registrations take precedence over built-in styles.
func RegisterLanguage ¶
func RegisterLineComment ¶
RegisterLineComment registers a simple single-line comment extractor that strips the provided prefix (e.g. "//", "#", "--") from each matching line.
func SetPythonDocstrings ¶
func SetPythonDocstrings(enabled bool)
SetPythonDocstrings controls extraction of standalone Python/Bzl docstrings. Quoted code strings are always ignored, and hash comments remain enabled.
Types ¶
type Block ¶
func ExtractWithLoader ¶
func ExtractWithNeedle ¶
ExtractWithNeedle skips built-in extraction when needle is absent from the entire source. When present, all comment blocks are returned unchanged. Custom language extractors always run because they can transform their input.