package text
Import Path
github.com/yuin/goldmark/text (on go.dev )
Dependency Relation
imports 5 packages , and imported by 7 packages
Package-Level Type Names (total 6, in which 4 are exported)
/* sort exporteds by: alphabet | popularity */
type BlockReader (interface)
A BlockReader interface is a reader that is optimized for Blocks.
Methods (total 19, all are exported )
( T) Advance (int )
Advance advances the internal pointer.
( T) AdvanceAndSetPadding (int , int )
AdvanceAndSetPadding advances the internal pointer and add padding to the
reader.
( T) AdvanceLine ()
AdvanceLine advances the internal pointer to the next line head.
( T) FindSubMatch (reg *regexp .Regexp ) [][]byte
Match performs regular expression searching to current line.
( T) LineOffset () int
LineOffset returns a distance from the line head to current position.
( T) Match (reg *regexp .Regexp ) bool
Match performs regular expression matching to current line.
( T) Peek () byte
Peek returns a byte at current position without advancing the internal pointer.
( T) PeekLine () ([]byte , Segment )
PeekLine returns the current line without advancing the internal pointer.
( T) Position () (int , Segment )
Position returns current line number and position.
( T) PrecendingCharacter () rune
PrecendingCharacter returns a character just before current internal pointer.
( T) ReadRune () (r rune , size int , err error )
( T) Reset (segment *Segments )
Reset resets current state and sets new segments to the reader.
( T) ResetPosition ()
ResetPosition resets positions.
( T) SetPadding (int )
SetPadding sets padding to the reader.
( T) SetPosition (int , Segment )
SetPosition sets current line number and position.
( T) SkipBlankLines () (Segment , int , bool )
SkipSpaces skips blank lines and returns a non-blank line.
If it reaches EOF, returns false.
( T) SkipSpaces () (Segment , int , bool )
SkipSpaces skips space characters and returns a non-blank line.
If it reaches EOF, returns false.
( T) Source () []byte
Source returns a source of the reader.
( T) Value (Segment ) []byte
Value returns a value of the given segment.
Implemented By (at least one unexported )
/* at least one unexported ... */ /* at least one unexported: */
*blockReader
Implements (at least 2, both are exported )
T : Reader
T : io.RuneReader
As Outputs Of (at least one exported )
func NewBlockReader (source []byte , segments *Segments ) BlockReader
type Reader (interface)
A Reader interface provides abstracted method for reading text.
Methods (total 18, all are exported )
( T) Advance (int )
Advance advances the internal pointer.
( T) AdvanceAndSetPadding (int , int )
AdvanceAndSetPadding advances the internal pointer and add padding to the
reader.
( T) AdvanceLine ()
AdvanceLine advances the internal pointer to the next line head.
( T) FindSubMatch (reg *regexp .Regexp ) [][]byte
Match performs regular expression searching to current line.
( T) LineOffset () int
LineOffset returns a distance from the line head to current position.
( T) Match (reg *regexp .Regexp ) bool
Match performs regular expression matching to current line.
( T) Peek () byte
Peek returns a byte at current position without advancing the internal pointer.
( T) PeekLine () ([]byte , Segment )
PeekLine returns the current line without advancing the internal pointer.
( T) Position () (int , Segment )
Position returns current line number and position.
( T) PrecendingCharacter () rune
PrecendingCharacter returns a character just before current internal pointer.
( T) ReadRune () (r rune , size int , err error )
( T) ResetPosition ()
ResetPosition resets positions.
( T) SetPadding (int )
SetPadding sets padding to the reader.
( T) SetPosition (int , Segment )
SetPosition sets current line number and position.
( T) SkipBlankLines () (Segment , int , bool )
SkipSpaces skips blank lines and returns a non-blank line.
If it reaches EOF, returns false.
( T) SkipSpaces () (Segment , int , bool )
SkipSpaces skips space characters and returns a non-blank line.
If it reaches EOF, returns false.
( T) Source () []byte
Source returns a source of the reader.
( T) Value (Segment ) []byte
Value returns a value of the given segment.
Implemented By (at least 3, in which 1 are exported )
BlockReader (interface)
/* 2+ unexporteds ... */ /* 2+ unexporteds: */
*blockReader
*reader
Implements (at least one exported )
T : io.RuneReader
As Outputs Of (at least one exported )
func NewReader (source []byte ) Reader
As Inputs Of (at least 29, in which 10 are exported )
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
func golang.org/x/pkgsite/internal/postgres.(*ASTTransformer ).Transform (node *ast .Document , reader Reader , pc parser .Context )
/* 19+ unexporteds ... */ /* 19+ unexporteds: */
func findSubMatchReader (r Reader , reg *regexp .Regexp ) [][]byte
func matchReader (r Reader , reg *regexp .Regexp ) bool
func readRuneReader (r Reader ) (rune , int , error )
func skipBlankLinesReader (r Reader ) (Segment , int , bool )
func skipSpacesReader (r Reader ) (Segment , int , bool )
func github.com/yuin/goldmark/parser.generateAutoHeadingID (node *ast .Heading , reader Reader , pc parser .Context )
func github.com/yuin/goldmark/parser.parseAttribute (reader Reader ) (parser .Attribute , bool )
func github.com/yuin/goldmark/parser.parseAttributeArray (reader Reader ) ([]interface{}, bool )
func github.com/yuin/goldmark/parser.parseAttributeNumber (reader Reader ) (float64 , bool )
func github.com/yuin/goldmark/parser.parseAttributeOthers (reader Reader ) (interface{}, bool )
func github.com/yuin/goldmark/parser.parseAttributeString (reader Reader ) ([]byte , bool )
func github.com/yuin/goldmark/parser.parseAttributeValue (reader Reader ) (interface{}, bool )
func github.com/yuin/goldmark/parser.parseLastLineAttributes (node ast .Node , reader Reader , pc parser .Context )
func github.com/yuin/goldmark/parser.parseLinkDestination (block Reader ) ([]byte , bool )
func github.com/yuin/goldmark/parser.parseLinkReferenceDefinition (block Reader , pc parser .Context ) (int , int )
func github.com/yuin/goldmark/parser.parseLinkTitle (block Reader ) ([]byte , bool )
func github.com/yuin/goldmark/parser.preserveLeadingTabInCodeBlock (segment *Segment , reader Reader , indent int )
func github.com/yuin/goldmark/parser.processLinkLabelOpen (block Reader , pos int , isImage bool , pc parser .Context ) *parser .linkLabelState
func github.com/yuin/goldmark/parser.scanAttributeDecimal (reader Reader , w io .ByteWriter )
type Segment (struct)
A Segment struct holds information about source positions.
Fields (total 3, all are exported )
Padding int
Padding is a padding length of the segment.
Start int
Start is a start position of the segment.
Stop int
Stop is a stop position of the segment.
This value should be excluded.
Methods (total 10, all are exported )
(*T) Between (other Segment ) Segment
Between returns a segment between this segment and the given segment.
(*T) ConcatPadding (v []byte ) []byte
ConcatPadding concats the padding to the given slice.
(*T) IsEmpty () bool
IsEmpty returns true if this segment is empty, otherwise false.
(*T) Len () int
Len returns a length of the segment.
(*T) TrimLeftSpace (buffer []byte ) Segment
TrimLeftSpace returns a new segment by slicing off all leading
space characters including padding.
(*T) TrimLeftSpaceWidth (width int , buffer []byte ) Segment
TrimLeftSpaceWidth returns a new segment by slicing off leading space
characters until the given width.
(*T) TrimRightSpace (buffer []byte ) Segment
TrimRightSpace returns a new segment by slicing off all trailing
space characters.
(*T) Value (buffer []byte ) []byte
Value returns a value of the segment.
(*T) WithStart (v int ) Segment
WithStart returns a new Segment with same value except Start.
(*T) WithStop (v int ) Segment
WithStop returns a new Segment with same value except Stop.
Implements (at least one unexported )
/* at least one unexported ... */ /* at least one unexported: */
*T : github.com/aws/aws-sdk-go/aws/corehandlers.lener
As Outputs Of (at least 20, in which 18 are exported )
func NewSegment (start, stop int ) Segment
func NewSegmentPadding (start, stop, n int ) Segment
func BlockReader .PeekLine () ([]byte , Segment )
func BlockReader .Position () (int , Segment )
func BlockReader .SkipBlankLines () (Segment , int , bool )
func BlockReader .SkipSpaces () (Segment , int , bool )
func Reader .PeekLine () ([]byte , Segment )
func Reader .Position () (int , Segment )
func Reader .SkipBlankLines () (Segment , int , bool )
func Reader .SkipSpaces () (Segment , int , bool )
func (*Segment).Between (other Segment ) Segment
func (*Segment).TrimLeftSpace (buffer []byte ) Segment
func (*Segment).TrimLeftSpaceWidth (width int , buffer []byte ) Segment
func (*Segment).TrimRightSpace (buffer []byte ) Segment
func (*Segment).WithStart (v int ) Segment
func (*Segment).WithStop (v int ) Segment
func (*Segments ).At (i int ) Segment
func (*Segments ).Sliced (lo, hi int ) []Segment
/* 2+ unexporteds ... */ /* 2+ unexporteds: */
func skipBlankLinesReader (r Reader ) (Segment , int , bool )
func skipSpacesReader (r Reader ) (Segment , int , bool )
As Inputs Of (at least 15, in which 13 are exported )
func BlockReader .SetPosition (int , Segment )
func BlockReader .Value (Segment ) []byte
func Reader .SetPosition (int , Segment )
func Reader .Value (Segment ) []byte
func (*Segment).Between (other Segment ) Segment
func (*Segments ).Append (t Segment )
func (*Segments ).AppendAll (t []Segment )
func (*Segments ).Set (i int , v Segment )
func (*Segments ).Unshift (v Segment )
func github.com/yuin/goldmark/ast.MergeOrAppendTextSegment (parent ast .Node , s Segment )
func github.com/yuin/goldmark/ast.MergeOrReplaceTextSegment (parent ast .Node , n ast .Node , s Segment )
func github.com/yuin/goldmark/ast.NewRawTextSegment (v Segment ) *ast .Text
func github.com/yuin/goldmark/ast.NewTextSegment (v Segment ) *ast .Text
/* 2+ unexporteds ... */ /* 2+ unexporteds: */
func github.com/yuin/goldmark/parser.newLinkLabelState (segment Segment , isImage bool ) *parser .linkLabelState
func github.com/yuin/goldmark/parser.preserveLeadingTabInCodeBlock (segment *Segment , reader Reader , indent int )
/* 2 unexporteds ... */ /* 2 unexporteds: */ type blockReader (struct)
Fields (total 8, none are exported )
/* 8 unexporteds ... */ /* 8 unexporteds: */
head int
last int
line int
lineOffset int
pos Segment
segments *Segments
segmentsLength int
source []byte
Methods (total 19, all are exported )
(*T) Advance (n int )
(*T) AdvanceAndSetPadding (n, padding int )
(*T) AdvanceLine ()
(*T) FindSubMatch (reg *regexp .Regexp ) [][]byte
(*T) LineOffset () int
(*T) Match (reg *regexp .Regexp ) bool
(*T) Peek () byte
(*T) PeekLine () ([]byte , Segment )
(*T) Position () (int , Segment )
(*T) PrecendingCharacter () rune
(*T) ReadRune () (rune , int , error )
io.RuneReader interface
(*T) Reset (segments *Segments )
(*T) ResetPosition ()
(*T) SetPadding (v int )
(*T) SetPosition (line int , pos Segment )
(*T) SkipBlankLines () (Segment , int , bool )
(*T) SkipSpaces () (Segment , int , bool )
(*T) Source () []byte
(*T) Value (seg Segment ) []byte
Implements (at least 3, all are exported )
*T : BlockReader
*T : Reader
*T : io.RuneReader
type reader (struct)
Fields (total 7, none are exported )
/* 7 unexporteds ... */ /* 7 unexporteds: */
head int
line int
lineOffset int
peekedLine []byte
pos Segment
source []byte
sourceLength int
Methods (total 18, all are exported )
(*T) Advance (n int )
(*T) AdvanceAndSetPadding (n, padding int )
(*T) AdvanceLine ()
(*T) FindSubMatch (reg *regexp .Regexp ) [][]byte
(*T) LineOffset () int
(*T) Match (reg *regexp .Regexp ) bool
(*T) Peek () byte
(*T) PeekLine () ([]byte , Segment )
(*T) Position () (int , Segment )
(*T) PrecendingCharacter () rune
(*T) ReadRune () (rune , int , error )
io.RuneReader interface
(*T) ResetPosition ()
(*T) SetPadding (v int )
(*T) SetPosition (line int , pos Segment )
(*T) SkipBlankLines () (Segment , int , bool )
(*T) SkipSpaces () (Segment , int , bool )
(*T) Source () []byte
(*T) Value (seg Segment ) []byte
Implements (at least 2, both are exported )
*T : Reader
*T : io.RuneReader
The pages are generated with Golds v0.3.2-preview . (GOOS=darwin 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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .