7x Products Exponential Code
← All products/Exponential Code
Open source · GPL · by 7x

// products / Exponential Code

Exponential Code
The code and template workbench.

The code and template workbench of the Exponential administration. Open a template, a settings file or a translation in the editor that Visual Studio Code is built on, keep every change as your own draft, preview it on any siteaccess, and publish it with a lint check, a backup, a git commit and the right cache clears. Free under the GNU GPL, and part of every Exponential installation on PHP 8.0 or later.

Every 7x project is on GitHub: github.com/se7enxweb.

install

Install with Composer

composer require se7enxweb/exp_code

  • Latest release: 0.0.0.1
  • With every Exponential install on PHP 8.0 or later
  • GNU GPL v2.0 or any later version

// about Exponential Code

What you get.

A real editor, inside the administration

Exponential Code replaces the plain text field of the old template editor with a workbench that feels familiar to anyone who uses Visual Studio Code: an explorer over the kernel designs, the settings, the installation and every active extension, tabs, the Monaco editor, a command palette and a status bar. It opens at Design > Templates (visual/code), and the old addresses keep working.

Nothing you type reaches the site until you publish it. Every change is a draft of your own, saved as you type, and a publish checks the file first, keeps a backup, writes it, commits it to git and clears exactly the caches it affects.

What you get in 0.0.0.1

  • The workbench: explorer, tabs, the Monaco editor with highlighting for templates, PHP, INI, CSS, JavaScript, JSON, HTML, XML, Markdown, YAML and Twig, a command palette, focus mode, your own settings and key bindings.
  • Drafts per user and publishing with a lint gate, a backup, a git commit of that one file (never pushed) and the matching cache clears.
  • Language services for templates: completion, hover with the reference page, go to definition, live diagnostics and formatting; INI and translation files checked as you type; PHP completion and hover through Phpactor, installed on request.
  • Override chains both ways, from a file to its rules and from a page to its template, and the override wizard: a new rule and its template in one step, previewed first.
  • The draft preview of any page on any siteaccess, with your drafts and nobody else's, at four widths and in light or dark; compare with the overridden template; an asset viewer and a token panel with contrast checks.
  • Source Control (changes, blame, timeline, commit), named changesets published all or nothing and reverted as a whole, search and replace across files as drafts.
  • Soft locks, a three-way merge of an outdated draft, co-editing, and an optional terminal that is off by default.
  • Pull requests, issues and reviews on GitHub, GitLab and Gitea; code-server behind a single sign-on proxy, on request.
  • An optional AI panel through Exponential Intelligence, off by default.
  • Policies with a Designer role, masked secrets and "Verify it's you" before publishing.

In development

The Templates page, in the next release: every template of a siteaccess with its whole override chain in the kernel's order, which rule wins for a node, every template a node's page uses, and creating, editing, reordering and removing override rules right where the chain is shown. It is not part of 0.0.0.1.

Built for Exponential

  • Runs under the administration's Content Security Policy: every script and worker comes from the site itself.
  • WCAG 2.2 AA in light and dark mode in every admin design, and a high-contrast mode that reaches WCAG AAA contrast.
  • CodeMirror 6 on phones and tablets, with native selection, the on-screen keyboard and pinch zoom.
  • Budgets checked by every release's browser test: the workbench interactive within 1.5 seconds, a file open within 200 ms.
  • The manual in English and German: a page per view, how-tos and generated reference pages.

Open source

Exponential Code is free under the GNU GPL v2.0 or any later version, maintained by 7x on GitHub and released on Packagist. Its browser libraries (Monaco Editor, CodeMirror 6, xterm.js, Yjs, all MIT) come pinned and checksummed in exponential-editor-assets.

// see it

See it at work.

The Exponential Code workbench in the administration: the explorer, a template in the editor, the output panel and the status bar The Exponential Code workbench in the administration: the explorer, a template in the editor, the output panel and the status bar
The workbench in the administration: the explorer, a template in the editor, the output panel and the status bar.
The command palette: every command of the workbench by name, with its keyboard shortcut The command palette: every command of the workbench by name, with its keyboard shortcut
The command palette: every command by name, with its key.
The Drafts view: recent publishes and changesets, each with a Revert button, beside the editor The Drafts view: recent publishes and changesets, each with a Revert button, beside the editor
Drafts: recent publishes and changesets, each one can be reverted.
The Overrides view: go to the template of a page, the base template of the open file, New override, and the list of templates with their number of rules The Overrides view: go to the template of a page, the base template of the open file, New override, and the list of templates with their number of rules
Overrides: from a page to its template, and New override.
The Outline view: the nested blocks, includes and definitions of the open template The Outline view: the nested blocks, includes and definitions of the open template
Outline: the blocks, includes and definitions of a template.

Figures from the Exponential Code manual, in the light or dark mode of this page.

Learn

Learn Exponential Code

The docs of a brand live at doc.<the brand's domain>: doc.se7enx.com for 7x, doc.exponential.earth for Exponential.

A question the docs do not answer: Help center · open a ticket · projects and partners in Exponential Centre