OpenFini

Docs / Guides

Frameworks, libraries and documents in the Code studio

OpenFini cannot run Node.js, so there is no npm install, no bundler and no dev server. "Framework support" therefore means projects that run as they are: the sandboxed preview and the exported static site load ES modules, import maps and CDN-delivered runtimes directly in the browser. This page explains what that covers, the starter templates, the library manager, offline use, and the Markdown and LaTeX support (including its limits).

What is possible without a build step#

WorksDoes not work
Classic scripts, ES modules (<script type="module">), import maps, dynamic import()JSX, TypeScript compilation, .vue single-file components, Svelte, Sass, PostCSS, tree shaking
Libraries from jsDelivr, cdnjs and unpkg, or copied into vendor/Packages that need Node APIs or a bundler to resolve their imports
Web components, htm tagged templates, Vue render functions, Alpine components, htmx attributesVue template strings and Alpine's standard build (they need unsafe-eval, which the desktop app's Content-Security-Policy forbids)
Tailwind CSS through its browser build (prototypes)Production Tailwind builds (use the Tailwind CLI elsewhere)
Service workers and manifests in the exported siteService workers in the preview (it is a sandboxed frame); test a PWA after export

The Content-Security-Policy#

The desktop app allows scripts from 'self', data:, cdn.jsdelivr.net, cdnjs.cloudflare.com and unpkg.com, and no eval. esm.sh is not allowed (it would need a deliberate CSP change), so the templates use jsDelivr's +esm builds instead. The web version has no such restriction, but everything here works under the desktop policy, and node scripts/serve.mjs --csp lets you check your own projects against it.

Import maps in the preview. Browsers treat an inline <script type="importmap"> as an inline script, which the desktop CSP blocks. The preview therefore applies the import map itself: bare specifiers in your modules are rewritten to the mapped URL (or to the project file, for local entries such as ./vendor/vue.js). The import map stays in the page for the exported site, where it is a normal import map. Limits: scopes are not applied, and remote modules that import bare names (for example three/addons/… from a CDN) cannot be rewritten; prefer jsDelivr's /+esm URLs, whose imports are absolute.

Template matrix#

File ▸ New ▸ Code shows the plain templates first, then these. Every one is verified in the preview and as an exported site without console errors.

TemplateLibraries (CDN, pinned)Notes
Tailwind CSS@tailwindcss/browser 4.1Dark mode toggle with a @custom-variant; the browser build prints a "not for production" console warning.
Bootstrap 5Bootstrap 5.3 CSS and bundleNavbar, cards, accordion, modal, validated form.
Alpine.js@alpinejs/csp 3.14CSP build: register components with Alpine.data(); attribute expressions cannot assign (x-model), call methods with arguments or build object literals.
htmxhtmx 2.0allowEval is off. js/mock-server.js answers requests inside the page so it works offline; delete it and point hx-get at a real server.
Vue 3vue 3.5 runtime buildES modules, import map, components written with h() render functions.
Preact + htmhtm/preact/standaloneHooks and JSX-like tagged templates.
ReactReact 18, ReactDOM, htm (jsDelivr +esm)Hooks; templates with htm (no JSX compiler).
LitLit 3Custom elements with reactive properties and scoped styles.
Web componentsnoneVanilla custom elements with Shadow DOM, slots, accessible tabs.
Three.jsthree r170Scene, lights, drag to rotate, reduced motion honored.
Markdown blognonePosts in content/posts/*.md, layouts in layouts/*.tmpl, generated pages included.
Markdown docs sitenoneSidebar from page titles, "On this page" table of contents.
PWA starternoneManifest, service worker (app shell cache, offline page), install button, notes in localStorage. SVG icons only: some browsers want PNG icons before they offer installation.

More starters (engine/web/starters.js): only their names are part of the Code studio; the files of a group load when one of them is created (tpl/starters-sites.js, starters-apps.js, starters-games.js, starters-libs.js). The first three groups make no external requests.

GroupStartersLibraries (CDN, pinned)
Static sitesResume (print stylesheet), Restaurant (menu, hours, reservation form), Event (schedule, speakers, tickets), Product page (features, pricing, FAQ), Coming soon (countdown, sign-up), Photo gallery (<dialog> lightbox with arrow keys)none
Apps and PWAsTo-do app (installable PWA: manifest, cache-first service worker, localStorage), Notes app (search, escaped Markdown-lite preview), Calculator (own parser, no eval, keyboard, history)none
GamesSnake (fixed-step loop, keyboard and swipe, high score), Breakout (requestAnimationFrame with a time step, levels), Memory (DOM cards, moves, timer)none
LibrariesPhaser game (arcade physics platformer), p5.js sketch, Chart dashboard, Map (OpenStreetMap tiles, keep the attribution), Data visualization (D3 as an ES module), Pico CSS site, Bulma site, Mithril app (components and routing), jQuery pagePhaser 3.87, p5 1.11, Chart.js 4.4, Leaflet 1.9, D3 7.9, Pico 2.0, Bulma 1.0, Mithril 2.2, jQuery 3.7

All of them work under the desktop CSP (no eval, which is why there is no petite-vue or Alpine non-CSP starter). Tested in tests/web/starters-open.test.js: every starter loads, its pages parse without errors, every local reference resolves to a file of the starter, scripts compile, and only the library starters reference other hosts. The Vibe tools list_templates and create_website know them too.

Libraries#

Open Libraries from the activity bar, the command palette (Libraries…) or Vibe (add_library).

  • Installed: every script, stylesheet and import-map entry of every page, plus CDN import statements in your JavaScript. Check for updates asks jsDelivr / cdnjs for newer versions; Update rewrites the URL. Remove deletes the tag or import-map entry (and the import map itself when it becomes empty).
  • Popular: a catalog of 25 libraries with pinned, tested versions (Tailwind, Bootstrap, icons, Alpine, htmx, Vue, React, Lit, Three.js, Chart.js, D3, GSAP, marked, Day.js, KaTeX, highlight.js …). A Google Fonts helper adds the stylesheet link (the font itself is loaded from Google; self-hosting fonts is not automated).
  • Search: npm packages (registry search) or cdnjs. Choose a package, a version (jsDelivr data API https://data.jsdelivr.com/v1/package/npm/<name>), a file (suggested scripts, ES modules or stylesheets) and whether to use it as a <script>, a <link> or an import-map entry. The file list comes from the jsDelivr API.

All edits go through the editor, so they are undoable and keep your formatting. The import map is created in <head> before any script and edited as JSON.

Download into project (offline)#

Download into project fetches the file and what it needs and stores it under vendor/<package>@<version>/…:

  • ES modules: imports that are absolute URLs or root paths (jsDelivr's +esm bundles import their siblings) are downloaded recursively and rewritten to relative paths.
  • Stylesheets: url(…) assets such as fonts and images and @imported sheets are downloaded; the relative layout is kept.
  • The page then points at ./vendor/…, and the exported site works with no network. Limits: 80 files and 12 MB per library; only jsDelivr, cdnjs and unpkg hosts are fetched; source map comments are removed.
  • Licenses stay your responsibility: vendored libraries keep their own license headers, add notices where required.

Offline mode and errors#

Every request (search, versions, downloads) first asks app.network.assert("cdn"); with offline mode on you get the standard offline message and nothing is sent. Other failures are explained: host unreachable, timeouts after 20 seconds, "not found". Libraries already in the project keep working.

Completions and snippets#

  • Class names: Tailwind (about 6,000 utility names generated from the scale, with variant prefixes such as md:, hover:, dark:) and Bootstrap 5.3 classes are offered in class="…" when the project uses that framework (detected from tags, import maps and scripts), next to your own classes.
  • Attributes: Alpine (x-data, x-show, @click, :class …) and htmx (hx-get, hx-target, hx-swap …), with common values for hx-swap, hx-trigger and hx-target.
  • Add panel: Bootstrap components (navbar, card, grid, alert, accordion, modal, form group, tabs, list group), Tailwind blocks (button, card, hero, feature grid, badge, input) and htmx patterns appear when the project uses them.

Markdown#

Open .md, .markdown or .mdx files from File ▸ Open, by drag and drop or inside a folder.

  • A single file opens as a one-file project (sidebar closed, editor and preview only); a folder keeps its structure and opens the README, index.md or main.tex first. Save this file… in the preview bar writes the text back out.
  • Editor: CodeMirror Markdown mode and a toolbar (bold, italic, strikethrough, code, headings, quote, lists, tasks, link, image, table, code block, rule, footnote, math).
  • Preview (own renderer, engine/web/markdown.js): CommonMark with GFM tables, task lists, strikethrough, bare URL autolinks, footnotes, front matter (shown as a table), {#custom-id} heading ids, fenced code with simple syntax highlighting (JavaScript/TypeScript, JSON, CSS, HTML, shell, Python, YAML, TOML, SQL, diff, Go, Rust, C family, TeX), $…$ / $$…$$ math through KaTeX, and .mdx in a lightweight form (imports and exports are ignored, components are shown as placeholders; JSX is never executed). Scrolling follows the caret.
  • Safety: the HTML is sanitized with an allowlist (no scripts, styles, frames, forms, event handlers, ids or classes; only http(s), mailto, tel, relative and data:image URLs); project images are served as blob URLs; remote images are skipped in offline mode. Relative .md links open the file.
  • Export: Export as HTML page adds a standalone page to the project (math pre-rendered; the KaTeX stylesheet loads from jsDelivr), Download saves it, Print or save as PDF uses the system print dialog with print styles (page margins, URLs after links, no page breaks inside code and tables).
  • Known limits: no raw-HTML block nesting corner cases beyond what CommonMark specifies for kinds 1 to 7, no HTML entities beyond about 70 common names, no Mermaid or diagrams, no emoji shortcodes, no definition lists.

Markdown-driven sites#

Projects with content/**/*.md and layouts/*.tmpl are turned into HTML pages automatically whenever a Markdown file, layout or site.json changes (or with Build Pages from Markdown). Front matter: title, description, date, layout, order, nav, slug, draft, hidden. Layouts use {{title}}, {{{content}}}, {{#each posts}}…{{/each}}, {{#if date}}…{{/if}}, {{nav}} items, {{toc}}, {{root}} and {{site.title}}. Links to .md files become .html links and paths that start with / are relative to the site root. Generated files carry a marker comment; hand-written files with the same name are never overwritten, and the exported site leaves out content/, layouts/ and site.json.

LaTeX#

Open .tex / .latex (and .bib, .sty, .cls) files the same way. Highlighting uses CodeMirror's stex stream mode.

The LaTeX preview is not a TeX engine. It converts a practical subset to HTML. It does not reproduce page layout, fonts, hyphenation, page numbers, floats placement or most packages.

  • Understood: \documentclass/\usepackage (ignored with a note), \title \author \date \maketitle, abstract, \part … \subparagraph (numbered like LaTeX, starred variants, \appendix), text styles and size declarations, special characters, accents and ligature-like dashes and quotes, itemize/enumerate/description, quote/verse, center, tabular (\hline, \multicolumn), figure/table with \caption, \includegraphics of project images, \label/\ref/\eqref/\autoref/\cref, \cite/\citep/\citet with .bib files or thebibliography, \footnote, \newcommand/\def/\newenvironment (macros are also expanded inside math), \newtheorem and proof, verbatim and lstlisting, \input/\include, \tableofcontents, \url/\href.
  • Math is typeset with KaTeX (vendored under app/vendor/katex, MIT, loaded only when a document has formulas). KaTeX supports most of amsmath's core but not everything; a formula it rejects is shown as source with the reason.
  • Honest degradation: unknown commands and environments appear as highlighted markers, are listed under notes about this preview with line numbers, and counted in the status. Undefined references and citations show ??.
  • Export: the same HTML export, download and print buttons as Markdown (print styles apply; the output is a browser rendering of the preview, not a PDF typeset by LaTeX). The Navigator shows the section outline.

Other text files#

.txt .json .yaml .yml .xml .csv .tsv .toml .ini .conf .properties .log .ts .tsx .jsx .js .css .html open as one-file projects with syntax highlighting (JSON, YAML, TOML, INI, TypeScript/JSX via CodeMirror; the rest as text). Files that contain NUL bytes are refused as binary. .svg keeps opening as a vector document in the Vector studio.

Vibe tools#

list_templates, list_libraries, search_packages (network, asks first), add_library (network, asks first), render_markdown, convert_latex_preview, create_markdown_document. create_website accepts every template id.

Edit on GitHub → docs/frameworks.md