Documentation
¶
Overview ¶
Package extract provides a reusable source-signature extraction API backed by the language-specific packages in this module. Parse returns source snippets, a function count, and optionally processed full content in a stable result shape suitable for source-packaging tools.
Index ¶
- func CleanSource(src []byte, opts Options, out *bytes.Buffer)
- func ProcessContent(s string, opts Options) string
- func StripComments(content string) string
- func TrimBlankLines(s string) string
- func TrimIndent(s string) string
- func Truncate(src []byte, opts Options, snippets []string) string
- type Options
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanSource ¶
CleanSource applies comment stripping, indent trimming, and blank line collapsing in a single pass without intermediate string allocations.
func ProcessContent ¶
ProcessContent applies the requested comment, indentation, and blank-line cleanup.
func StripComments ¶
StripComments removes line and block comments while preserving string literals.
func TrimBlankLines ¶
TrimBlankLines collapses runs of blank lines.
func TrimIndent ¶
TrimIndent removes leading indentation from every line.
Types ¶
type Options ¶
type Options struct {
ExportedOnly bool
StripComments bool
TrimIndent bool
TrimBlankLines bool
MaxLines int
MaxLinesHead int
MaxLinesTail int
RemoveBodyFunc bool
}
Options controls signature filtering and content cleanup for Parse.