Skip to main content
Version: 0.4.0

Paid

kq portal:build

kq portal:build turns the model and its pages into a static site, and reports every problem with them as it goes. This page says how to run it, where the site goes and what each problem it reports means.

Building the site​

kq portal:build models/my-model --out site

kq portal:build needs the Portal package; without it, it says so, builds nothing and exits 3. It builds the model from model/ as kq build does, but writes nothing into your repository. It reads every page file under portal/, prints every problem with the model and the pages, and writes the site into --out.

  • Any error stops it, exit 1, and nothing is written. A warning does not stop it.
  • Your policy findings are printed too, after the model's, and none of them stops it, whatever its severity.
  • --out is emptied first, so the site is exactly this build. To keep you from losing files, kq portal:build only empties a directory it wrote itself (it leaves _kanoniq/kanoniq-portal.txt to recognize it); it refuses, with exit 2, a directory holding anything else, and a directory that is the repository or holds it. It also refuses a model with no kanoniq.repository.json at or above it: run kq init first.

The site is plain files with relative links. Serve it over HTTP from any static web server or hosting: a page links to another by its folder, which a browser opens as that folder's index.html only when a server answers, so opened straight from disk its links break. It fetches nothing from the internet, fonts and icons included. It carries the editor and your whole model, so anyone who can open the site can read the whole model, whatever the pages show.

In VS Code, Build Kanoniq Portal on the portal/ folder builds the site into portal-dist/ and serves it on your machine at the port in portal-dist/.kanoniq-server.json, 47620 unless you change it. See Building the portal.

kq portal:build comes from the package @extenza-works/kanoniq-export-portal, installed beside kq; see Installing.

What kq portal:build reports​

Each problem is one line, file:line:column severity code message, like kq validate's. Each code links to its page, with what it means and how to fix it.

CodeRuleSeverityChecks
KQP001well-formed YAMLErrorA page file, a Markdown page's or a decision record's frontmatter, and a view block are well-formed YAML: one document, no key repeated.
KQP002page shapeErrorA page file, a Markdown page's or a decision record's frontmatter, and a view block have every field they need and only those they take, each with a value it can take.
KQP003page nameErrorA page file's name is the canonical encoding of the page's name.
KQP004one file per pageErrorA page has one file: no two sibling files for names that differ only in case or composition, or for one name under two extensions.
KQP005one home pageErrorportal/ holds exactly one page file directly: the home page.
KQP006every page is reachableErrorEvery page file and decision record sits in a directory that mirrors a page.
KQP007a tile names a childErrorA page tile names a child page or decision record in the page's mirror directory.
KQP008a child is listed onceErrorA page's tiles list each child once.
KQP009a known iconErrorAn icon is named as Lucide names one of its icons.
KQP010a known plateauErrorA view tile's or view block's at and to name plateaus of the model, its to later than its at.
KQP011a known elementErrorA decision record's element Id names an element of the model.
KQP012a known successorErrorA superseded decision record's superseded-by names another decision record's file, by its path from portal/.
KQP013a chain of successors that endsErrorFollowing superseded-by from record to record never comes back to a record already passed.
KQP014an image pathErrorAn image in a page's text is named by a relative path to a file inside portal/.
KQP015an image that existsErrorAn image in a page's text names a file that exists.
KQP016an image typeErrorAn image in a page's text is a PNG, JPEG, GIF, WebP or SVG file, as its extension says and its first bytes agree.
KQP017an image's sizeErrorAn image in a page's text is at most 5 MiB.
KQP018a link's targetErrorA link in a page's text names a page file or decision record by a relative path, or is a fragment or an http, https or mailto address.
KQP019a known view pathErrorA path that decides which view opens, a view's domain, focus or anchor, names an element of the model of a type the parameter takes.
KQP101published under unpublishedLintA published page sits under a published parent, since it is not rendered otherwise.
KQP102an unlisted childLintA page's tiles list every child page, so their order is chosen rather than by name.
KQP103the element's pathLintA decision record's element path is the path its element Id is at in the model.
KQP104a successor in forceLintA superseded decision record's successor is not proposed or rejected, since then nothing has replaced the decision yet.
KQP105a link to an unrendered pageLintA rendered page links only to rendered pages, since a link to any other is written as its text.
KQP106a view's selected and collapsed pathsLintA view's selected path and collapsed entries name elements of the model.

© 2026 Extenza Works. All rights reserved.