Involved Source Files Package text provides functionalities to manipulate texts.reader.gosegment.go
Package-Level Type Names (total 5)
/* sort by: | */
A BlockReader interface is a reader that is optimized for Blocks. Advance advances the internal pointer. AdvanceAndSetPadding advances the internal pointer and add padding to the
reader. AdvanceLine advances the internal pointer to the next line head. FindClosure finds corresponding closure. Match performs regular expression searching to current line. LineOffset returns a distance from the line head to current position. Match performs regular expression matching to current line. Peek returns a byte at current position without advancing the internal pointer. PeekLine returns the current line without advancing the internal pointer. Position returns current line number and position. PrecendingCharacter returns a character just before current internal pointer.( BlockReader) ReadRune() (r rune, size int, err error) Reset resets current state and sets new segments to the reader. ResetPosition resets positions. SetPadding sets padding to the reader. SetPosition sets current line number and position. SkipSpaces skips blank lines and returns a non-blank line.
If it reaches EOF, returns false. SkipSpaces skips space characters and returns a non-blank line.
If it reaches EOF, returns false. Source returns a source of the reader. Value returns a value of the given segment.
BlockReader : Reader
BlockReader : io.RuneReader
func NewBlockReader(source []byte, segments *Segments) BlockReader
FindClosureOptions is options for Reader.FindClosure. Advance is a flag for the FindClosure. If this is set to true,
FindClosure advances pointers when closer is found. CodeSpan is a flag for the FindClosure. If this is set to true,
FindClosure ignores closers in codespans. Nesting is a flag for the FindClosure. If this is set to true,
FindClosure allows nesting. Newline is a flag for the FindClosure. If this is set to true,
FindClosure searches for a closer over multiple lines.
func BlockReader.FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool)
func Reader.FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool)
A Reader interface provides abstracted method for reading text. Advance advances the internal pointer. AdvanceAndSetPadding advances the internal pointer and add padding to the
reader. AdvanceLine advances the internal pointer to the next line head. FindClosure finds corresponding closure. Match performs regular expression searching to current line. LineOffset returns a distance from the line head to current position. Match performs regular expression matching to current line. Peek returns a byte at current position without advancing the internal pointer. PeekLine returns the current line without advancing the internal pointer. Position returns current line number and position. PrecendingCharacter returns a character just before current internal pointer.( Reader) ReadRune() (r rune, size int, err error) ResetPosition resets positions. SetPadding sets padding to the reader. SetPosition sets current line number and position. SkipSpaces skips blank lines and returns a non-blank line.
If it reaches EOF, returns false. SkipSpaces skips space characters and returns a non-blank line.
If it reaches EOF, returns false. Source returns a source of the reader. Value returns a value of the given segment.BlockReader(interface)
Reader : io.RuneReader
func NewReader(source []byte) Reader
func github.com/yuin/goldmark/parser.ParseAttributes(reader Reader) (parser.Attributes, bool)
func github.com/yuin/goldmark/parser.ASTTransformer.Transform(node *ast.Document, reader Reader, pc parser.Context)
func github.com/yuin/goldmark/parser.BlockParser.Close(node ast.Node, reader Reader, pc parser.Context)
func github.com/yuin/goldmark/parser.BlockParser.Continue(node ast.Node, reader Reader, pc parser.Context) parser.State
func github.com/yuin/goldmark/parser.BlockParser.Open(parent ast.Node, reader Reader, pc parser.Context) (ast.Node, parser.State)
func github.com/yuin/goldmark/parser.CloseBlocker.CloseBlock(parent ast.Node, block Reader, pc parser.Context)
func github.com/yuin/goldmark/parser.InlineParser.Parse(parent ast.Node, block Reader, pc parser.Context) ast.Node
func github.com/yuin/goldmark/parser.ParagraphTransformer.Transform(node *ast.Paragraph, reader Reader, pc parser.Context)
func github.com/yuin/goldmark/parser.Parser.Parse(reader Reader, opts ...parser.ParseOption) ast.Node
Segments is a collection of the Segment. Append appends the given segment after the tail of the collection. AppendAll appends all elements of given segments after the tail of the collection. At returns a segment at the given index. Clear delete all element of the collection. Len returns the length of the collection. Set sets the given Segment. SetSliced replace the collection with a subsliced value. Sliced returns a subslice of the collection. Unshift insert the given Segment to head of the collection.
func NewSegments() *Segments
func BlockReader.FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool)
func Reader.FindClosure(opener, closer byte, options FindClosureOptions) (*Segments, bool)
func github.com/yuin/goldmark/ast.(*BaseBlock).Lines() *Segments
func github.com/yuin/goldmark/ast.(*BaseInline).Lines() *Segments
func github.com/yuin/goldmark/ast.Node.Lines() *Segments
func NewBlockReader(source []byte, segments *Segments) BlockReader
func BlockReader.Reset(segment *Segments)
func github.com/yuin/goldmark/ast.(*BaseBlock).SetLines(v *Segments)
func github.com/yuin/goldmark/ast.(*BaseInline).SetLines(v *Segments)
func github.com/yuin/goldmark/ast.Node.SetLines(*Segments)
Package-Level Functions (total 5)
NewBlockReader returns a new BlockReader.
NewReader return a new Reader that can read UTF-8 bytes .
NewSegment return a new Segment.
NewSegmentPadding returns a new Segment with the given padding.
NewSegments return a new Segments.
Package-Level Constants (only one)
EOF indicates the end of file.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.