Add docs for the freemarker templates - #601
Conversation
📝 WalkthroughWalkthroughUpdates FreeMarker documentation with template trust-boundary and HTML-escaping guidance, adds the page to the Transform sidebar, and enables FTL syntax highlighting. ChangesFreeMarker documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Broken links, images & orphan pages
Links/images come from one crawl of the production build (baseUrl-aware). Orphans are docs not referenced by Summary
Broken links & imagesIntroduced by this PRNo new broken link(s)/image(s) introduced by this PR. ✅ Already on
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@en/docs/develop/transform/freemarker.md`:
- Around line 14-16: Update the “Rendering from a file” guidance around
freemarker:renderFromFile to describe disk templates as trusted,
operator-managed server-side code; remove the suggestion that non-developers can
freely edit them and explicitly state that user-supplied template source is
prohibited.
- Around line 25-32: Add ftl to the themeConfig.prism.additionalLanguages list
in docusaurus.config.ts, preserving the existing registered languages. This
enables syntax highlighting for the FreeMarker fences used throughout
freemarker.md.
- Around line 196-204: Add a best-practice entry near the existing formatting
and nullable-field guidance explaining that interpolated untrusted values must
be HTML-escaped with the ?html built-in, or that templates should use an HTML
output format via .ftlh or output_format="HTML". Clarify that render and
renderFromFile otherwise use FreeMarker’s undefined output format and do not
escape values automatically.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d1c0080b-1813-4ec1-b57e-27176ec3e9b1
⛔ Files ignored due to path filters (6)
en/static/img/develop/transform/freemarker/freemarker-file-read-json.pngis excluded by!**/*.pngen/static/img/develop/transform/freemarker/freemarker-json-variable.pngis excluded by!**/*.pngen/static/img/develop/transform/freemarker/freemarker-print-inline-result.pngis excluded by!**/*.pngen/static/img/develop/transform/freemarker/freemarker-print-result.pngis excluded by!**/*.pngen/static/img/develop/transform/freemarker/freemarker-render-from-file.pngis excluded by!**/*.pngen/static/img/develop/transform/freemarker/freemarker-render-inline.pngis excluded by!**/*.png
📒 Files selected for processing (2)
en/docs/develop/transform/freemarker.mden/sidebars.ts
Purpose
Summary by CodeRabbit
ftl.