File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ use Sinnbeck\HtmlAst\Ast\Parser;
8181$ast = Parser::make($tokens);
8282
8383// Parse tokens into an AST (node tree)
84- $nodeTree = $ast->parse();
84+ $nodes = $ast->parse();
8585
8686// Optionally, inspect the node tree:
87- print_r($nodeTree );
87+ print_r($nodes );
8888```
8989
9090### Printing
@@ -95,15 +95,15 @@ The printer takes an HTML input or the resulting AST and renders it as neatly fo
9595use Sinnbeck\HtmlAst\Printer;
9696
9797// Create a Printer instance and render the HTML string
98- echo Printer::make($nodeTree )->render();
98+ echo Printer::make($nodes )->render();
9999```
100100
101101If you need to indent all lines by a certain level, you can easily do so.
102102``` php
103103use Sinnbeck\HtmlAst\Printer;
104104
105105// Indents everything by 1 extra indentation level
106- echo Printer::make($nodeTree )->render(1);
106+ echo Printer::make($nodes )->render(1);
107107```
108108
109109By default the output is indented with 4 spaces.
@@ -112,7 +112,7 @@ This can be easily changed by calling `->withIndent()`
112112use Sinnbeck\HtmlAst\Printer;
113113
114114// Indents with tab instead of 4 spaces
115- echo Printer::make($nodeTree )->indentWith("\t")->render();
115+ echo Printer::make($nodes )->indentWith("\t")->render();
116116```
117117
118118## Testing
You can’t perform that action at this time.
0 commit comments