vestaboard / vbml
The Vestaboard Markup Language for PHP
dev-main
2026-11-18 16:49 UTC
Requires
- php: ^8.1
- ext-mbstring: *
- mustache/mustache: ^v3.0.0
Requires (Dev)
- phpunit/phpunit: ^10.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- dev-fix-npm-publish-node-24
- dev-vbml-schema-validation
- dev-hotfix/npm-deploy
- dev-PROD-1159-fix-vertical-align-center-overflow
- dev-fix/inverted-board-dimensions-in-tests
- dev-feature/raw-characters-string
- dev-copilot/run-npm-publish
- dev-feature/new-npm-script
- dev-copilot/install-vbml-package
- dev-jottenlips-patch-1
- dev-feature/ignore-other-langs
This package is auto-updated.
Last update: 2026-11-18 16:49:59 UTC
README
Installation
JavaScript / TypeScript
yarn install @vestaboard/vbml
or
npm i @vestaboard/vbml
Python
pip install pyvbml
PHP
composer require vestaboard/vbml
Usage
JavaScript / TypeScript
import { vbml } from "@vestaboard/vbml"; // Generate an array of 6 rows of 22 character codes representing the template const characters = vbml.parse({ components: [ { style: { justify: "center", align: "center", }, template: "Hello World!", }, ], });
Python
from pyvbml import vbml # Generate an array of 6 rows of 22 character codes representing the template characters = vbml.parse({ "components": [ { "style": { "justify": "center", "align": "center", }, "template": "Hello World!", } ] })
PHP
use Vestaboard\Vbml\Vbml; // Generate an array of 6 rows of 22 character codes representing the template $characters = Vbml::parse([ 'components' => [ [ 'style' => [ 'justify' => 'center', 'align' => 'center', ], 'template' => 'Hello World!', ], ], ]);
Schema (JavaScript / TypeScript)
A definition can include an optional schema describing each prop. When present, vbml.parse validates props against it and throws if they don't conform. The descriptions also help AI agents fill in templates.
import { vbml, IVBML, VBMLSchemaError } from "@vestaboard/vbml"; const definition: IVBML = { props: { away_team: "Lakers", away_score: 101, accent: "{68}" }, schema: { away_team: { description: "Name of the visiting team", columns: 10, evidence: "TemporalFact", }, away_score: { type: "Numeric", description: "Visiting team's current score", columns: 3, evidence: "TemporalFact", evidenceRule: "Use the same game and score update as home_score.", }, accent: { type: "Color", // character codes 63-71, e.g. "{68}" (see the exported `Color` map) description: "Decorative accent color", required: false, // evidence omitted, so it defaults to "Freeform" }, }, components: [{ template: "{{away_team}} {{away_score}} {{accent}}" }], }; try { vbml.parse(definition); } catch (e) { if (e instanceof VBMLSchemaError) console.log(e.issues); // [{ prop, code, message }] }
type:Text(default),Numeric,ColororEnum(Enumrequiresoptions: [{ value, description }]).rows/columns: maximum lines / cells per line. Each{nn}token and color emoji counts as one cell.required: defaults totrue; a missing prop throwsVBMLSchemaErrorlisting every problem.evidence(optional;"TemporalFact","GeneralFact"or"Freeform", defaulting to"Freeform") andevidenceRuleare guidance for agents and are not enforced. See docs/schema.md for the full reference.- Props not declared in the schema are passed through unvalidated.
- A malformed schema throws
VBMLSchemaDefinitionError.
The same schema field is supported in the Python (pyvbml) and PHP packages. See docs/schema.md for examples in each language.
Docs
Full documentation is available at https://docs.vestaboard.com/docs/vbml