Set up the toolchain, run the test suites, and work within the website module boundaries.
Developer Guide
This page is for contributors changing the implementation. To use the published gem or Action in another repository, follow Host Integration.
Workspace boundary
website/ contains the compiler, templates, frontend sources, dependencies, and tests. Project documentation lives in website/jekyll-obsidian-docs/. The gem includes runtime files and compiled assets only. Host content and configuration remain independent of the installation directory.
Runtime output is under the host root's .jekyll-obsidian-cache/. Frontend development assets are under website/.jekyll-obsidian-cache/assets/; packaging copies the selected build into website/assets/, which is ignored by Git.
Set up the toolchain
Install Ruby 4.0.x, Node.js 26.x, pnpm 11.18.0, and Git on macOS, Linux, or WSL. The pnpm version is pinned in website/package.json; install it if needed with npm install --global pnpm@11.18.0. From the repository root:
Setup checks the pnpm version against packageManager before installing locked Ruby and Node dependencies and building the gem. website/pnpm-lock.yaml is the sole frontend lockfile; use pnpm to update dependencies. pnpm-workspace.yaml approves the pinned esbuild build script, disables optional fsevents builds and rejects unreviewed dependency builds. After editing frontend sources, rerun the package command before previewing. Restart the preview after changing Ruby implementation files.
On native Windows, install RubyInstaller Ruby+Devkit 4.0.6, Bundler 4.0.16, Node 26, pnpm 11.18.0 and Git globally, then open a fresh PowerShell. Use the underlying commands instead of the Unix shell wrappers:
cd website
gem install bundler -v 4.0.16 --no-document
bundle install
pnpm install --frozen-lockfile
pnpm run build
bundle exec ruby scripts/package.rb --skip-assets
bundle exec rake test
pnpm run test:prepared
pnpm run build:browser-sites
pnpm exec playwright install chromium
pnpm exec playwright test
Gems use the shared Ruby installation. The lockfile includes x64-mingw-ucrt; pnpm links dependencies under website/node_modules. Directory-link tests use junctions when symbolic-link privileges are unavailable. File-link tests require Windows Developer Mode or symbolic-link privileges and otherwise skip with a reason; Windows cannot create the control-character filenames covered by the POSIX audit test. Audit tests invoke Ruby directly, and preview tests terminate only their isolated child process.
Run the tests
This builds assets and the gem, runs compiler and runtime tests, installs the actual gem in an isolated host, then runs TypeScript and Node tests. The package smoke test makes package files read-only and rejects Node and package-manager execution during the host build.
For browser coverage:
( && )
RUN_BROWSER_TESTS=1
Do not bypass package tests when running Ruby checks separately: rebuild assets and run bundle exec ruby scripts/package.rb --skip-assets first. The installed-gem test builds both themes in English and Simplified Chinese, checks their lazy entries and workers, and verifies that packaged files remain unchanged.
Asset builds write .jekyll-obsidian-cache/asset-statistics.json inside website/ for verification only. Each theme's synchronous JavaScript closure, including shared chunks and the color-scheme bootstrap, must stay within 45,000 raw bytes and 18,000 bytes of summed per-file gzip output. Archive and favorites entries belong to both theme manifests but load only when the page has their DOM markers. Browser navigation fixtures come from the actual compiler.
The statistics record SHA-256 hashes of build inputs (including the pnpm lockfile and build policy), the manifest, and synchronous JavaScript files. test:prepared verifies those hashes and recomputes sizes; stale inputs or outputs require pnpm run build before checking the budget. --skip-assets is appropriate only after that fresh asset build.
The project workflow runs this full suite. Downstream workflows build and verify only their host content.
Visual snapshots are separate for each operating system because native font rendering differs. After an intentional UI change, review and update the Windows and Linux baselines with pnpm exec playwright test site-visual.spec.ts theme-visual.spec.ts --update-snapshots, then rerun without that flag. Linux baselines must also pass the Ubuntu CI browser run.
Build a production fixture
The output is .jekyll-obsidian-cache/site-fixture/. The contributor wrapper builds frontend assets and then calls the same runtime as the installed gem. --skip-assets reuses an existing frontend build.
Build and release a gem
( && )
The gem is written to pkg/. The package task requires a complete asset manifest and excludes project documentation, tests, Node dependencies, and caches. See Releasing for the first publication and the versioned Action.
Authored content trust
Raw HTML in public notes is trusted author input. The compiler removes HTML and Obsidian comments, rejects dangerous Markdown URL schemes, and does not publish local attachments referenced only by raw HTML attributes.
Production pages include a meta Content Security Policy. Review authored HTML and linked HTTPS media before publishing.
Continue with Architecture, OFM v1 Conformance, or Deployment.