Repository navigation
Installation
| Needed for | |
|---|---|
PHP 8 (the php command) |
rendering, and checking includes |
Div (divengine/div) |
rendering, and checking includes |
| Xdebug (optional) | the PHP debugger |
| Python 3.11+ | only to install divide from its source code |
| A web browser (optional) | only for the web mode (divide --web) |
Editing, highlighting, completion and most checks work without PHP. Everything that needs to know what Div would do (rendering, resolving {% includes %}) asks the real engine, so it needs PHP and Div.
| Platform | Support |
|---|---|
| Linux (x86_64, arm64) | supported: tested on every change, binaries and packages in every release |
| Windows (x86_64) | supported: tested on every change, .msi, .zip and Scoop in every release |
| macOS | not supported for now: not tested automatically, no new official binaries |
macOS is not supported for now: its UI tests failed intermittently on CI. Releases from 0.11.0 on have no macOS binaries and no new Homebrew formula; 0.10.0 and earlier keep theirs. On macOS you can still run divide from the source code. Official macOS binaries come back after ten consecutive macOS CI runs pass with no manual rerun, the recurring UI failures are investigated, the Intel and Apple silicon packages build, and the packaged binary starts, edits, saves and exits cleanly in a smoke test.
Every release carries divide ready to run on Linux and Windows, with Python inside: nothing else to install. Pick the way that suits your system.
brew install divengine/tap/divideThe tap still installs divide 0.10.0 on macOS and Linux, but it is not updated while macOS is experimental: on Linux, use the packages, the AppImage or the binary below for the latest version.
scoop install https://github.com/divengine/divide/releases/latest/download/divide.jsonscoop update divide updates it. Or download divide-<version>-windows-x86_64.msi from the release: the installer puts divide in Program Files and on the PATH (open a new terminal afterwards). The .zip holds divide.exe alone, to put wherever you like.
From the release, for your architecture (amd64/x86_64 or arm64/aarch64):
| System | Package | Install |
|---|---|---|
| Debian, Ubuntu | divide_<version>_amd64.deb |
sudo apt install ./divide_<version>_amd64.deb |
| Fedora, RHEL, openSUSE | divide-<version>-1.x86_64.rpm |
sudo dnf install ./divide-<version>-1.x86_64.rpm |
| Alpine | divide_<version>_x86_64.apk |
sudo apk add --allow-untrusted divide_<version>_x86_64.apk |
| Arch | divide-<version>-1-x86_64.pkg.tar.zst |
sudo pacman -U divide-<version>-1-x86_64.pkg.tar.zst |
The packages put divide in /usr/bin and recommend php-cli.
chmod +x divide-<version>-linux-x86_64.AppImage
./divide-<version>-linux-x86_64.AppImageOr the standalone binary, in a folder on your PATH:
curl -fLo ~/.local/bin/divide https://github.com/divengine/divide/releases/download/v<version>/divide-<version>-linux-x86_64
chmod +x ~/.local/bin/divideReleases up to 0.10.0 have divide-<version>-macos-arm64.tar.gz (Apple silicon) and -macos-x86_64.tar.gz (Intel), with the binary; later releases have none (see Supported platforms). It is not signed, so macOS stops it the first time; allow it with:
xattr -d com.apple.quarantine divide(Homebrew does not need this.) On Windows, SmartScreen asks the same before the first run of the .exe or the .msi: More info > Run anyway.
Each release has a SHA256SUMS file to check what you downloaded.
With Python 3.11 or newer, as a command for your user:
git clone https://github.com/divengine/divide.git
cd divide
tools/install.shtools/install.sh creates the checkout's .venv if needed, installs divide there (editable) and links the divide command in ~/.local/bin (or the folder you give it: tools/install.sh /usr/local/bin). git pull in the checkout updates the command. To remove it, delete the link.
Or as an isolated command with pipx:
pipx install git+https://github.com/divengine/divide.gitdivide --version
cd ~/sites/my-project
divide . # this folder is the project
divide page.tpl # a file on its own, no folderThe usual way is Composer, in the project that holds your templates:
composer require divengine/divdivide finds the engine by itself, in this order:
- the
DIVIDE_DIV_PHPenvironment variable: avendor/autoload.php, or a Div checkout'ssrc/div.php(with itsvendor/installed); - the
engineof the project's Div setup (.div/setup.json), then of yours (~/.div/setup.json); - the path set in Options > Div engine… (saved in
~/.config/divide/config.json); - a
vendor/autoload.phpwithvendor/divengine/div, looking upwards from the template and from the project folder.
If none is found, Ctrl+F9 on a template explains what to do, and include checks are simply skipped.
divide # nothing opened: the Welcome window (recent folders and files)
divide . # the current folder as the project, project window open
divide ~/sites/shop # another folder as the project
divide index.tpl card.tpl # files on their own, with no folder
divide ~/sites/shop index.tpl
divide --palette turbo-c # start with a colour theme: turbo-pascal, turbo-c, free-pascal, modern-dark, phosphor-white, phosphor-green, phosphor-green-black, phosphor-amber, phosphor-amber-black
divide --colors truecolor # colour depth when the terminal says less than it can: auto, truecolor, 256, 16
divide --language es # the interface in Spanish for this run: en, es
divide --web ~/sites/shop # in a web browser on this computer: open the address it prints (see [[Web Mode]])The first two are also in Options > Colors, which remembers them (see The Desktop#colours); the language is in Options > Language (see The Desktop#language).
A folder is opened only when you give it, as in VS Code; File > Open folder opens one later (see The Desktop#a-folder-a-file-or-nothing).
Use a terminal at least 80×25; 120 columns or more is comfortable for working side by side with the output.
Next: Getting Started.
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