preview server - render document AST under /ast path postfix #513
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.