Property | Type | Description | |
---|---|---|---|
$buffer | The buffer is an array containing current lines that are parsed | ||
$currentLine | Current line | ||
$directive | Current directive to be applied on next node | ||
$directives | Current directives | ||
$document | Current document | ||
$environment | Environment | ||
$filename | File name | ||
$includeAllowed | Allow include directives? | ||
$includeRoot | Behaves like PHP's open_basedir | ||
$isCode | Is the current node code ? | ||
$lineInfo | |||
$listFlow | |||
$listLine | |||
$specialLetter | Current level of special lines (==== and so) | ||
$state | Current state |
Method | Description | |
---|---|---|
__construct ( $environment = null, $kernel = null ) | ||
createSpan ( $span ) : |
Create a span, which is a text with inline style | |
getCurrentLine ( ) | Gets the current line | |
getDocument ( ) : Gregwar\RST\Document | Get the current document | |
getEnvironment ( ) : |
Get the current environment | |
getFilename ( ) | Gets the current filename | |
getIncludeAllowed ( ) : boolean | ||
getIncludeRoot ( ) : string | ||
getKernel ( ) : |
Get the current kernel | |
getSubParser ( ) : |
Get a parser with the same environment that this one | |
includeFileAllowed ( $path ) : boolean | Is this file allowed to be included? | |
includeFiles ( $document ) | Include all files described in $document and returns the new string of the given document with includes processed | |
initDirectives ( ) | Initializing built-in directives | |
initReferences ( ) | Initializing references | |
parse ( string $document ) : Gregwar\RST\Document | Parse a document and return a Document instance | |
parseFile ( string $file ) : Gregwar\RST\Document | Parses a given file and return a Document instance | |
parseLink ( string $line ) : boolean | Try to parse a link definition | |
parseLocal ( string $document ) : Gregwar\RST\Document | ||
pushListLine ( string $line, boolean $flush = false ) : boolean | Push a line to the current list node buffer | |
registerDirective ( Gregwar\RST\Directive $directive ) | Register a new directive handler | |
setIncludePolicy ( boolean $allow, string $directory = null ) : self | Allow/disallow includes, or restrict them to a directory |
Method | Description | |
---|---|---|
directiveAddOption ( string $line ) | Try to add an option line to the current directive, returns true if sucess and false if failure | |
findTableChars ( string $line ) : array | boolean | Finding the table chars | |
flush ( ) | Flushes the current buffer to create a node | |
getCurrentDirective ( ) : Gregwar\RST\Directive | Gets the current directive | |
init ( ) | ||
initDirective ( string $line ) : false | Get current directive if the buffer contains one | |
isBlockLine ( string $line ) : boolean | A line is a code line if it's empty or if it begins with a trimable caracter, for instance: | |
isComment ( string $line ) : boolean | Is this line a comment ? | |
isDirective ( string $line ) : boolean | Is this line a directive ? | |
isListLine ( string $line ) : boolean | Is the given line a list line ? | |
isSpecialLine ( string $line ) : boolean | Tell if a line is a special separating line for title and separators, returns the depth of the special line | |
parseLine ( string &$line ) | Process one line | |
parseLines ( string $document ) | Process all the lines of a document string | |
parseListLine ( string $line ) : array | Parses a list line | |
parseTableLine ( string $line ) : mixed | If the given line is a table line, this will returns the parts of the given line, i.e the offset of the separators | |
prepareCode ( ) : boolean | Tells if the current buffer is announcing a block of code |
public createSpan ( $span ) : |
||
$span | the content string | |
return | a span object |
protected directiveAddOption ( string $line ) | ||
$line | string |
protected getCurrentDirective ( ) : Gregwar\RST\Directive | ||
return | Gregwar\RST\Directive |
public getDocument ( ) : Gregwar\RST\Document | ||
return | Gregwar\RST\Document | the document |
public getEnvironment ( ) : |
||
return | the parser environment |
public getKernel ( ) : |
||
return | the kernel |
public getSubParser ( ) : |
||
return | a new parser with the same environment |
public includeFileAllowed ( $path ) : boolean | ||
$path | ||
return | boolean |
public includeFiles ( $document ) |
protected initDirective ( string $line ) : false | ||
$line | string | |
return | false | if this is not a directive, else an array containing : - variable: the variable name of the directive - name: the directive name - data: the data of the directive - options: an array of all the options and their values |
protected isBlockLine ( string $line ) : boolean | ||
$line | string | the line text |
return | boolean | true if the line is still in a block |
protected isDirective ( string $line ) : boolean | ||
$line | string | the line |
return | boolean | true if it's a directive |
protected isListLine ( string $line ) : boolean | ||
$line | string | |
return | boolean | true if the given line is a list line |
protected isSpecialLine ( string $line ) : boolean | ||
$line | string | |
return | boolean |
protected parseLines ( string $document ) | ||
$document | string | the string (content) of the document |
protected parseListLine ( string $line ) : array | ||
$line | string | the string line |
return | array | containing: - true if the list is ordered, false else - the depth of the list - the text of the first line without the tick |
public parseLocal ( string $document ) : Gregwar\RST\Document | ||
$document | string | |
return | Gregwar\RST\Document | The created document |
protected parseTableLine ( string $line ) : mixed | ||
$line | string | |
return | mixed |
protected prepareCode ( ) : boolean | ||
return | boolean |
public registerDirective ( Gregwar\RST\Directive $directive ) | ||
$directive | Gregwar\RST\Directive | a directive handler |
public setIncludePolicy ( boolean $allow, string $directory = null ) : self | ||
$allow | boolean | |
$directory | string | |
return | self |
protected $buffer |
protected $specialLetter |