Skip to content

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 01 Sep 08:12
· 23 commits to main since this release
v0.11.0
21eb9e5

Added

  • VS Code writes a run's script failures to the Markii output channel,
    one line per failed script with its name, failure kind, and the short
    reason the value marker's tooltip carries, so a failure behind a
    collapsed or hidden marker is discoverable without hovering. Obsidian
    already wrote the same lines to its console.

  • Hide script blocks in the preview (VS Code extension, Obsidian
    plugin). A named Lua fence normally renders as a collapsed marker you can
    expand to read the source. Turn on markii.hideScriptBlocks in VS Code,
    or "Hide script blocks" in the Obsidian settings, and the preview leaves
    those markers out, for a note meant to be read rather than edited.

    The setting is cosmetic and hides the source blocks only. A script that
    fails still marks the value it feeds, still flips the run marker to its
    failed state in VS Code, still produces the failure notice a manual run
    gets in Obsidian, and still writes its full reason to the host's
    diagnostics surface. The renderer is untouched: both hosts put one class
    on the document root and their own theme layer does the rest, so an
    exported note and any other consumer of @markii/react render exactly
    as before.

  • Turn script execution off on this device (VS Code extension, Obsidian
    plugin). Set markii.scriptsDisabled in VS Code, or turn on "Turn off
    script execution on this device" in the Obsidian settings, and no note
    runs its scripts: not an explicit Run, not run on open, and not a
    scheduled refresh. Markii: Toggle Script Execution and Toggle
    Markii script execution
    flip it from the command palette.

    A blocked Run says so in one line. A blocked automatic run is written to
    the host's diagnostics surface instead of interrupting you on every note
    you open, and a blocked scheduled run also stops that preview's timer, so
    the reason is recorded once rather than every interval. Notes still
    preview, still export, and still show whatever values their last run
    produced.

    Grants are untouched in both directions. Turning execution off leaves
    every stored network and bundle grant as it is, and turning it back on
    re-authorizes nothing beyond what was already granted by hand. In VS Code
    the setting is user-scope only, so a workspace cannot turn execution back
    on for you; in Obsidian it is stored per device through local storage,
    never in the vault, so one device's decision never travels with Sync or
    with a shared vault.

  • Values appear one at a time while a run is going (VS Code extension,
    Obsidian plugin). A note's scripts run one after another in a single
    isolate, so the first number is often ready seconds before the last one
    is. The preview now shows each value the moment its script finishes: that
    component switches from stale to fresh while every other component in the
    note stays stale until its own value lands. The run still reports its
    completion at the end, exactly as before, and a run that is cut short by
    the wall-clock watchdog now keeps the values that already arrived instead
    of coming back empty and clearing the note's last-known figures.

  • @markii/runtime: an onValue option on runDocumentScripts. It is
    called once per script, in document order, immediately after that
    script's value is written to the store, and it is called for a failed
    script as well as a successful one. The callback receives a copy of the
    summary entry, cannot change what the run stores or reports, and anything
    it throws is swallowed, so runDocumentScripts still never throws. A
    caller that does not pass it behaves exactly as before.

  • A script can read the note it runs in (@markii/runtime,
    @markii/lua). A doc table is now in scope for every script block:
    doc.directives(filter) returns the note's directives in document order,
    each as {name, form, attributes, text} with the inner markdown
    stripped, and doc.value(name) returns what a script ABOVE the caller
    produced. That is enough for a note to collect what its author already
    wrote: several :::prep_q blocks, one script that turns them into a
    quiz, one component that renders it. filter accepts {name = "..."};
    a directive written inside another appears in the list right after its
    parent, so filtering by name finds every match whatever wraps it.
    doc.truncated says whether anything was left out to stay inside the
    caps.

    The table is read-only and carries no authority, so it is not tier
    gated: an auto or scheduled run sees exactly what a manual run sees, and
    nothing new was granted. Reading a name that belongs to a script further
    down the note (or to the caller itself) fails the run and the marker
    reads "script error: reads "quiz", which runs later in the note", rather
    than quietly returning a value whose meaning depends on where the reader
    happened to be written. An unknown name, and a name whose script failed,
    both read as nil.

  • @markii/runtime: buildDirectiveListing, createDocViewSource,
    laterScriptReadMessage, DEFAULT_DOC_LISTING_LIMITS,
    EMPTY_DIRECTIVE_LISTING, sanitizeText, utf8ByteLength
    , plus the
    DirectiveEntry, DirectiveListing, DocListingLimits, DocView,
    DocValueRead, DocViewSource, DocumentContext and
    DocumentTreeNode types. runDocumentScripts takes a new optional
    doc option (the listing the host built from the tree it already
    parsed) and ScriptExecutor receives a new optional doc input, one
    view per script. An executor written before this still satisfies the
    type and behaves exactly as it did.

    The listing is capped: 512 KiB in total, 2,000 directives, 8 KiB of text
    and 32 attributes per directive, 1 KiB per attribute value, and 200
    levels of tree depth. Being over a cap shortens the listing and sets
    truncated; it is never an error. Text and attribute values reach a
    script with control characters and unpaired surrogates already removed.

  • @markii/lua: buildDoc and the DocConfig/DocRejections types,
    and a doc option on runScript. The listing crosses into Lua as JSON
    text and is decoded by the same trusted in-Lua decoder net.fetch_json
    uses, so a script receives genuine Lua tables. Each doc.directives()
    call decodes afresh, so an entry a script writes to cannot change what
    the next call returns, and each script already runs in its own engine. A
    refused read is recorded out of band, the way capability denials already
    are, so the reported sentence is the clean one rather than a Lua stack
    traceback, and a script cannot forge it.

Added

  • Export a note and the notes it links to as one archive (VS Code
    extension). Markii: Export as HTML cascade… follows the note-relative
    markdown links out of the active note, exports each note it reaches the
    same way the single-note export does, and writes one zip archive at a path
    you pick. Links between exported notes are rewritten to the exported file
    names, so the archive browses on its own, and a link to anything outside
    your workspace or the note's own folder is never followed and stays exactly
    as written. The walk is bounded at four hops and one hundred notes, and
    every note that was skipped or could not be read is named on the Markii
    output channel. This mirrors the Obsidian plugin's Export Markii note as
    HTML cascade
    , and both hosts share the walk, the naming, the link
    rewriting, and the archive itself.

Install

The renderer pulls the rest in as dependencies:

npm install @markii/react@0.11.0

All eight packages, if you want them explicitly:

npm install @markii/core@0.11.0
npm install @markii/stdlib@0.11.0
npm install @markii/bundle@0.11.0
npm install @markii/pack@0.11.0
npm install @markii/runtime@0.11.0
npm install @markii/lua@0.11.0
npm install @markii/react@0.11.0
npm install @markii/html@0.11.0

Downloads

The attached tarballs are the packed npm packages. The names are
stable across releases, so the latest of each is always at a fixed URL:

https://github.com/markii-org/markii/releases/latest/download/markii-core.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-stdlib.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-bundle.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-pack.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-runtime.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-lua.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-react.tgz
https://github.com/markii-org/markii/releases/latest/download/markii-html.tgz