Repository navigation
Getting Started

The shop's templates generate HTML because it is the easiest output to read; a generator of Python, JavaScript, configuration or any other text is written, checked, rendered and traced the same way.
A five-minute tour with a tiny shop. The repository ships it ready in
examples/shop
(divide examples/shop); its layout, simplified:
shop/
├── index.tpl
├── index.json
├── components/card.tpl
└── layout/header.tpl, layout/footer.tpl
index.tpl:
{% layout/header %}
<main>
<h1>{^^title}</h1>
[$products] product =>
{% components/card %}
@empty@
<p>Nothing on sale today.</p>
[/$products]
</main>
{% layout/footer %}
index.json, the data. By Div's convention index.tpl takes index.json:
{
"title": "the divide shop",
"products": [
{"name": "Potato", "price": 1.5, "offer": true},
{"name": "Tomato", "price": 2.25, "offer": false}
]
}divide examples/shopThe project window opens on the left. (divide alone shows the Welcome window, with the folders and files you opened lately: see The Desktop#a-folder-a-file-or-nothing.) Move with the arrows, press Enter on index.tpl: it opens beside the tree. F6 cycles windows, Alt+1…9 jumps to a window by number, F5 zooms.
Inside the loop, type {$. A list opens with what is visible there: product, product.name, product.price, the fields name, price directly, and Div's loop variables. Type to narrow it, Enter to insert.

More in Completion.
Delete the [/$products] line. The loop opening turns red and the status line says why. Alt+F9 opens the Messages window with every problem; Enter on a message jumps to it; Alt+F8 / Alt+F7 walk the errors without opening the window. Undo with Ctrl+Z.
More in Checking Templates.
Press Ctrl+F9. divide runs your template through PHP and Div, with your unsaved edits: a progress box tells how it went (it closes by itself, or with any key) and the result is in an Output window to the right. From now on, saving the template or its data (F2) renders again.
More in Rendering.
Press Ctrl+T in the template: its data file opens as a tree. Enter edits a value, Ins adds one, Del removes it, F2 saves, and the Output follows.
More in Data Files.
Put the cursor on {% components/card %} and press Ctrl+Enter (or Ctrl+click): the template Div would include opens. If Div cannot find it, divide offers to create it.
Back in the project window (Ctrl+B), press Ins for a new file, F7 for a new folder, F2 to rename, Del to delete, or Alt+F10 for the local menu.
More in Project Window.
Leave with Alt+X; divide asks about unsaved changes.
divide · part of Divengine · report an issue
Manual
- The Desktop
- Editing Templates
- Editing PHP
- Outline
- Finding Files and Commands
- Language Servers
- Completion
- Checking Templates
- Rendering
- Render Trace
- Running PHP
- Running Flows
- Flow Structure
- Flow Designer
- Flow Functions
- Flow Simulation
- Function Mock Simulation
- Debugging PHP
- Web Server
- Data Files
- Other Files
- Project Window
- Div Setup
- Dialector
- Translating Templates
- Composer
- Git
Reference
Links