Skip to content

docmd@0.9.9 – Variables, Playground & Personalisation

Latest

Choose a tag to compare

@mgks mgks released this 03 Nov 17:11

docmd logo

OpenAPI, LLMs & Internationalisation

v0.9.9 introduces a unified Variables Engine and interactive Playground, alongside fixes for search routing, template resolution, monorepo dependency handling, and AI assistant context synthesis.

Added

  • Unified Variables & Personalisation Engine (@docmd/core, @docmd/parser, @docmd/ui): Introduces {{ variable }} interpolation during static builds, with fallback values using || and syntax escaping via \{{ ... }}. Supports built-in variables including docmd.version, docmd.buildYear, docmd.buildDate, docmd.buildTime, docmd.gitCommit, docmd.gitBranch, site.title, site.base, page.title, page.slug, and page.path. Variables can also be used in configuration, banners, and footer copyright strings. Environment variables are accessible through env.*, with DOCMD_VAR_ values promoted to top-level variables.
  • Headless Client Runtime (@docmd/ui): Bundles docmd-runtime.js across the default and summer templates. Exposes window.docmd.var with get(), set(), list(), and sync() for dynamic personalisation, reactive DOM updates, personalised code snippets, and cross-frame synchronisation.
  • Interactive Playground Plugin (@docmd/plugin-playground): Adds a zero-configuration code runner, enabled by default. Supports executable fenced code blocks and ::: playground containers, source script integration via src, Live and Code view tabs, HTML/CSS previews, console interception, and execution result display. Integrates with the client runtime and Variables Engine, including docmd.var.get(), docmd.var.set(), and docmd.theme.toggle().

Improved

  • AI Assistant Context Synthesis (@docmd/plugin-ai): Introduces Snippet-First Synthesis for documentation tool calling, delivering relevant passages and code examples with fewer roundtrips.
  • Playground Authoring & Runtime Experience: Adds graceful warnings for missing scripts, structured execution error alerts, editor reset behaviour, and read-only mode handling. Playground assets are injected conditionally, so pages without playground blocks load no additional CSS or JavaScript.

Fixed

  • Versioned Search Path Resolution (@docmd/plugin-search): Search index loading now works correctly under versioned base paths such as /vX.Y.Z/. The client prioritises the authoritative build-time window.DOCMD_SITE_ROOT, retaining relative path deduction as a fallback. Contributed by @Goldloli in #266, closing #262.
  • SPA Logo Navigation (@docmd/ui): External logo destinations and root-relative workspace links now bypass unwanted client-side routing interception, fixing navigation errors while preserving internal SPA transitions.
  • Template Layout Slot Resolution (@docmd/api, @docmd/ui): Eliminates false-positive layout slot warnings, including those affecting the summer theme.
  • Monorepo Runtime Dependency Isolation: Restricts source package detection to valid monorepo contexts and adds hierarchical module resolution fallbacks to prevent peer dependency pruning during npm v7+ workspace development.

Security & Maintenance

  • Playground HTML previews run inside sandboxed iframes without allow-same-origin, restricting access to parent DOM, cookies, and storage. Runtime variable injection uses .textContent to avoid DOM XSS.
  • Updated the npm dependency group across workspace packages in PR #265.
  • Updated docker/login-action in PR #264.

Links

Documentation: https://docs.docmd.io/
Cloud Platform: https://cloud.docmd.io/
Dev & Writing Skills: https://github.com/docmd-io/docmd-skills

New Contributors

Full Changelog: 0.9.8...0.9.9