It adds the capability to render the document AST in the preview server when adding the /ast postfix to the page's URL.
This is particularly helpful when a developer intends to implement render overrides or rewrite rules and is not sure which nodes to match on.
The server goes beyond just putting the AST out as a huge blob of text as that would not be very helpful:
The AST is rendered separately for each section, with original headers rendered between them.
It receives proper syntax highlighting.
It's rendered in the same page template, with all page navigation and site navigation intact.
The site navigation also links to the AST, not the HTML of other pages.
To get out of AST mode, the /ast postfix simply has to be removed from the URL again.
The AST shown is equivalent to the AST passed to the actual renderer after the final rewrite phase.
In case of writing custom render overrides it is the most accurate representation of the nodes you can match on.
When writing rewrite rules for earlier phases the actual nodes to match on might differ
(e.g. directives and links might still be unresolved).
This functionality finally makes the old demo app obsolete. The code for the app has already been removed some time ago, but once this feature is released as part of version 0.19.4, the running demo app will be decommissioned and the links to it removed from Laika's manual and README.
This is the penultimate feature PR for 0.19.
It adds the capability to render the document AST in the preview server when adding the
/ast
postfix to the page's URL.This is particularly helpful when a developer intends to implement render overrides or rewrite rules and is not sure which nodes to match on.
The server goes beyond just putting the AST out as a huge blob of text as that would not be very helpful:
/ast
postfix simply has to be removed from the URL again.The AST shown is equivalent to the AST passed to the actual renderer after the final rewrite phase. In case of writing custom render overrides it is the most accurate representation of the nodes you can match on. When writing rewrite rules for earlier phases the actual nodes to match on might differ (e.g. directives and links might still be unresolved).
This functionality finally makes the old demo app obsolete. The code for the app has already been removed some time ago, but once this feature is released as part of version 0.19.4, the running demo app will be decommissioned and the links to it removed from Laika's manual and README.