Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InspectImageAlt ¶
InspectImageAlt is a sample for options WIP
func StripTemplate ¶
StripTemplate is a WIP on remove golang template markup from a file
Types ¶
type Extractor ¶
Extractor is an interface for extracting plaintext
func ExtractorByFilename ¶
ExtractorByFilename returns an plaintext extractor based on filename heuristic
type GolangText ¶
type GolangText struct { }
GolangText extracts plaintext from Golang and other similar C or Java like files
Need to study. https://godoc.org/github.com/fluhus/godoc-tricks
Does not process embedded code blocks
func NewGolangText ¶
func NewGolangText() (*GolangText, error)
NewGolangText creates a new extractor
func (*GolangText) Text ¶
func (p *GolangText) Text(raw []byte) []byte
Text satisfies the Extractor interface
ReplaceGo is a specialized routine for correcting Golang source files. Currently only checks comments, not identifiers for spelling.
Other items:
- check strings, but need to ignore
- import "statements" blocks
- import ( "blocks" )
- skip first comment (line 0) if build comment
type HTMLText ¶
type HTMLText struct {
InspectImageAlt bool
}
HTMLText extracts plain text from HTML markup
func NewHTMLText ¶
NewHTMLText creates a new HTMLText extractor, using options.
type MarkdownText ¶
type MarkdownText struct {
Extractor Extractor
}
MarkdownText extracts plain text from markdown sources
func NewMarkdownText ¶
func NewMarkdownText(options ...func(*MarkdownText) error) (*MarkdownText, error)
NewMarkdownText creates a new extractor
func (*MarkdownText) Text ¶
func (p *MarkdownText) Text(text []byte) []byte
Text extracts text from a markdown source
type ScriptText ¶
type ScriptText struct { }
ScriptText extract plaintext from "generic script" languages that use the '#' character to denote a comment line It's not so smart. TODO: add support for Ruby, multi-line comment
http://www.tutorialspoint.com/ruby/ruby_comments.htm
func NewScriptText ¶
func NewScriptText() (*ScriptText, error)
NewScriptText creates a new file extractor