Repository navigation
This release adds review: reading a pull request as readers will see it, page by page, with the changed blocks marked and the pull request's review comments beside them. It works in VS Code's page preview, in your site's own pages under astro dev, and as an HTML report CI can attach to every pull request. Comments are ordinary GitHub review comments, so there's nothing to set up or host. See Review.
The language
@snippetputs a code example from a file in the page as a fenced code block:@snippet: code:examples/quill/ascribe.toml#dimensions. The file is read on every check, build, and diff, so the example changes when the code does. A region is marked in the code with Bluehawk's tags (:snippet-start:,:snippet-end:,:remove:).ascribe checkreports a missing address, file, or region, and tags that don't balance (snippet-addressand five more). See@snippetand Drift.[sources.<name>]inascribe.tomlnames a folder of code outside the content that snippets may read, withincludeandignorepatterns. It's the only way a page reads outside its project's folder, and the folder must be in the project's git repository. See[sources.<name>].- A source in another repository:
git(andbranch) in place ofpath. The files snippets use are copied intosources/<name>/and pinned to a commit inascribe.lock. Both are committed with the docs, so checking, building, diffing, and drift never reach the other repository.ascribe checkreports copies that don't match the lock or the snippets (lock-invalid,source-copy-changed, and three more). See a source in another repository and Docs kept apart from the code. - A table row can have an availability: an attribute block at the end of its first cell,
| `stream` {available="self-managed preview 3.4"} | … |. A badge build marks the row, and a filter build removes it where it isn't available. The spec is checked as an@availableline's is, within the table's own availability. Behavior change: a{key=value}that ends a body row's first cell was text and is now an attribute block, so a key other thanavailableis an error (attribute-unknown-key). See table rows. - A page title can show code.
inline = "code"on a content type'sstringfield reads code spans in it:title = { type = "string", inline = "code" }lets a page be titled "`ascribe.toml` reference". The site output writes the field as plain text, for<title>and search, and as HTML under the new keyformatted(entry.data.formatted.titlein an Astro layout). The JSON output hasformattedtoo. Behavior changes: a type can no longer declare a field namedformatted(model-field-reserved), and in a field that turnsinlineon, a backslash before punctuation is an escape and is removed, as in Markdown. See code in a field. - A link can name a heading from a fragment the page includes:
setup.md#prerequisitesworks whenprerequisitescomes from a fragmentsetup.mdincludes. It was an error (link-id-in-fragment, now retired). See@include.
The ascribe command
ascribe diffshows what changed between a git revision and the working tree, as readers will see it: each build's changed pages, and the blocks added, removed, changed, or moved on them, with the words that changed. It compares resolved pages, so a page that changed only through a fragment, a phrase, or a build's settings is listed with the cause, and reformatting is no change. The default base is the merge base with the default branch, as in a pull request.--format jsonadds each block's source lines, for tools. It needs onlygit. It also says how many errors the working tree has, as do the HTML report and both previews, so a broken render isn't read as the change. Seeascribe diff.ascribe diff --format htmlwrites the changes as one self-contained HTML file: every changed page rendered with its changes marked, and the page as it will be and as it was a click away. It makes no network requests and runs nothing from the pages, so CI can attach it to a pull request. See the HTML report and the report in CI.ascribe driftlists the pages whose code examples changed between a git revision and the working tree: first those whose own text didn't change, so the words around the code may be out of date, then those that changed with their examples, then those whose examples no longer resolve. A region is compared as text, so an edit elsewhere in its file isn't a change.--format summarywrites Markdown for a CI job's summary,--format jsonis for tools, and--exit-codeexits 1 when an example broke, or changed while its page didn't. Seeascribe driftand Drift.ascribe build --emit site --anchorsmarks each block of the site output with its source file and lines (data-ascribe-source, anddata-ascribe-viafor a block from a fragment). Without the flag, the output is unchanged. See the site-render contract.ascribe sources fetchmakes the copies of sources in other repositories matchascribe.lock.ascribe sources updatemoves a source's pin to the head of its branch (or--to), copies again, and reports the commits, the copies, and the pages whose examples changed, as text, JSON, or Markdown for a pull request.ascribe sources statusshows each pin and copy, offline.fetchandupdaterungitwith its own credentials, and are the only commands that reach the network. Seeascribe sources.- Each command's
--helpdescribes its options in the words of the command reference, whose option lists are generated from it, and ends with a link to its section on the docs site, https://ascribed-dev.com.-hshows the first paragraph of each. - Fixed: the plain-markdown output (
--emit plain) writes an inline<br>as a line break, or as;in a table cell or heading. It was dropped, so code spans on either side ran together.
The editor
- Review in the preview. Ascribe: Start Review compares the active page's project with a base: the base of the branch's pull request, the default branch, or a revision you type. The preview marks what changed on the page and follows your edits. Its header shows the base and the page's changes, switches between Changes / As it will be / As it was, and steps through the changes and the changed pages. Ascribe: Changed Pages lists the pages the change touches, and a status bar item shows whether review is on and starts it. See Review in the preview.
- Comments in the preview. When the branch has an open pull request, the preview shows its review threads beside their blocks. You can reply, resolve, comment on any block, and submit or discard your review. New comments are visible only to you until you submit. Ascribe: Refresh Comments reads the threads again. Threads also show on their source lines, unless the GitHub Pull Requests extension shows them already (the new setting
ascribe.review.sourceComments). Comments use VS Code's GitHub sign-in or the GitHub CLI's. Without either, review shows the changes only. See Comments in the preview. - The site preview. Ascribe: Open Site Preview opens the active page on its project's dev server, in the browser, at the heading the editor shows. The preview panel's Page | Site switch shows it in the panel, following the active file. See Site preview.
- Ascribe: Open Preview to the Side is now Ascribe: Open Page Preview to the Side (the command id is unchanged). The new Ascribe: Open Page Preview opens the preview in place of the editor.
- The preview and the editor scroll together by block instead of by heading, in both directions, and double-clicking a block puts the cursor on its source line.
ascribe.preview.scrollPreviewWithEditorandascribe.preview.scrollEditorWithPreviewturn each direction off. - The preview takes scripts, event handlers, and
javascript:URLs out of a page's HTML before showing it, as the review report does. - The Settings editor describes each setting in the words of the editor guide, whose settings table is generated from it.
Astro
- Review in the site preview. In
astro dev, an Ascribe review app in Astro's dev toolbar marks a change's blocks on the real page, in your site's layout, and shows the pull request's review threads beside them. Commenting goes through the GitHub CLI, which the dev server runs. It stays off when the dev server listens on the network, or when the Vite config lets other pages reach it. Thereviewoption (on by default) turns the app off.astro buildoutput has no anchors, overlay, or review code. See Review in the site preview. astro devwrites its address to.ascribe/dev.jsonin the project, for the editor's site preview, and removes it when it stops.- The
anchorsoption turns source anchors on:"dev"inastro devonly,truealways. - A code block's title, such as a
@snippet's, shows above it, in a<figure class="code-title">with a<figcaption>. ThecodeTitlesoption turns it off. See code block titles. @ascribed/astro/Availability.astrorenders a page'savailablefrontmatter as the element library's badge:<Availability available={entry.data.available} />.- The integration copies the generated schema into
.astro/integrations/_ascribed_astro/schema.tsafter each build. A site whose Ascribe project is outside the Astro root imports that copy, so type-checking findsastro/zod. See define the collection. - A clean build's check summary (
checked 14 files: 0 errors, 0 warnings) is logged as info, not as a warning. - The npm packages' source maps include their sources, so Vite no longer warns that they point to missing files.
The language server
- It answers
ascribe/review/setBaseandascribe/review/changes, andascribe/previewwithreview: trueadds the page's changes, for editors other than VS Code. Seecrates/tessera-lsp/README.md.
Installing
- The Linux binaries run on glibc 2.28 or later, instead of 2.39, so
@ascribed/cliinstalls and runs in the build images of Vercel, AWS Amplify, and Cloudflare Pages as well as Netlify's. - A canary of the npm packages, built from
main, is published every night under thenexttag:npm install @ascribed/cli@next @ascribed/astro@next. It comes with no promise of stability, and itsascribe --versionnames the commit it was built from. Releases still publish underlatest.
@ascribed/review
- A new package, for hosts that show review. Its Node part finds the open pull request for a checkout's branch, reads its review threads, places each on its rendered block, and posts comments and replies into the reviewer's pending review. It talks to GitHub through the GitHub CLI or a token its host supplies, and stores no token. Its browser part marks a rendered page's changed blocks and draws the threads beside them. Comment bodies render from a safe subset of Markdown, with no raw HTML, and no image loads without a click. See
packages/review.