Synticore Developer Docs - File Include Notes
This page covers implementation-aware and advanced behavior notes for Synticore's cure-gulp-file-include integration.
If you primarily need feature usage and syntax examples, use the builder-facing Synticore Builder Guide - File Include Guide.
Behavior Notes
@@ifand@@forincure-gulp-file-includeuse dynamic evaluation throughnew Functionwith context-scoped access.@@ifsupports branch chains with optional@@elseifblocks and an optional@@elsefallback.- In
@@ifand@@forexpressions, prefer explicitcontext.*access. - Inside
@@foroutput markup, prefer backtick interpolation for item values. - Variable replacement is direct token lookup such as
@@titleor@@site.name, rather than@@context.title. include_oncededupe is path-string keyed and scoped by source file.- Recursion protection includes a self-include check.
- Some parse or read failures may
console.error(...)and return instead of throwing richer diagnostics. - In Synticore task integration, HTML-include-affecting inputs include
in/_html/**/*.jsonin addition toin/_html/**/*.htmlandin/_html/**/*.md.
Evaluation Order
Processing order is:
- Strip HTML-commented
@@include(...) @@if@@for- Variable replacement
@@include_once@@include@@loop
Why this order matters:
- Conditionals and
forblocks run before include and loop expansion, so top-level control flow is decided early. - Variable replacement runs before include and loop calls in the current text scope.
- Includes and loops recurse into their own content, so nested directives still resolve.
When To Use This Page
Use this page when you need to:
- debug why include syntax resolves in a certain order
- inspect
cure-gulp-file-includeintegration behavior - reason about recursion, scoping, or dynamic evaluation details
- understand watch and cache implications around include inputs