Understanding the five core composition rules
This document outlines the five core composition rules used in the Arshu Assembler framework. These rules define how HTML templates and JSON data are merged to generate the final output.
The main template uses a {{'{{'}}ComponentName{{'}}'}} placeholder. The engine replaces this
placeholder with the content of ComponentName.html, which is typically located in a
Component/ subdirectory.
center.html) defines a slot using a {{'{{'}}$SlotName{{'}}'}} placeholder.{{'{{'}}#LayoutName}}...{{'{{'}} /LayoutName{{'}}'}} block.{{'{{'}}@SlotName}}...{{'{{'}}/@SlotName{{'}}'}} block.This allows for creating reusable page layouts where only specific sections change.
The main template (e.g., html3A.html) uses a {{'{{'}}ComponentName{{'}}'}} placeholder.
The engine resolves this by looking for ComponentName.html within a context-specific
Views/ directory. This allows different views to use the same placeholder name but load different content.
json1A.html) is paired with a data file of the same name (json1A.json).{{'{{'}}$JsonKey{{'}}'}} placeholders to access and display the values from the JSON file.{{'{{'}}@ArrayKey}}...{{'{{'}} /ArrayKey{{'}}'}} block to loop through the array.{{'{{'}}$ObjectKey{{'}}'}} placeholders are used to access the properties of each object in the current iteration.{{'{{'}}@ConditionKey}}...{{'{{'}} /ConditionKey{{'}}'}} to render content if a key is true/truthy{{'{{'}}^ArrayKey}}...{{'{{'}} /ArrayKey{{'}}'}} for when the array is missing or emptyThese five composition rules form the foundation of the Arshu Assembler framework, enabling powerful and flexible template-based content generation across multiple programming languages.