Thanks for considering a contribution! This repository is an Obsidian community plugin built with TypeScript + esbuild and targets both desktop and mobile.
- Node.js 18+
- npm
- Obsidian (desktop recommended for development)
npm installPrefer just if available:
just install
just dev
just build
just test
just lint
just checkEquivalent npm scripts also exist:
npm run dev
npm run build
npm test
npm run lintThis plugin can be loaded from a vault folder.
Option A: Manual (simple)
-
Build once:
npm run build
-
Copy the plugin folder into your vault:
<Vault>/.obsidian/plugins/read-only-view/- required files:
main.js,manifest.json - optional:
styles.css
Option B: Symlink (recommended) Symlink the repository into your vault plugin folder so rebuilds land in place:
ln -s /absolute/path/to/read-only-view <Vault>/.obsidian/plugins/read-only-viewThen run watch mode:
npm run devRestart Obsidian or reload plugins when needed.
Repository layout (high level):
src/main.ts— plugin lifecycle, enforcement orchestration, settings tab UIsrc/matcher.ts— path normalization and matching logictests/— unit testsmain.jsandbuild-tests/— generated outputs (do not hand-edit)
Run at minimum:
just lint
just test
just buildIf you can’t run something, say exactly what you didn’t run and why in the PR description.
-
Keep runtime dependencies minimal. Avoid heavy matching libraries.
-
Don’t change behavior silently.
-
If behavior changes, update documentation:
README.md(user-facing behavior)docs/PROJECT_STATE.md(internal system map)
-
Keep command IDs stable unless there is an explicit migration plan.
-
Preserve mobile compatibility; avoid Node/Electron-only runtime APIs.
- Follow the existing code style and patterns in the repo.
- Prefer small, focused changes.
- Add/adjust unit tests for matcher logic and enforcement flow when behavior changes.
Tests include:
- Matcher correctness and edge cases (wildcards, long paths, normalization)
- Orchestration/enforcement flow tests (where applicable)
When adding new matching semantics or path normalization rules:
- Add both a “typical case” and at least one “tricky edge case” test.
- Obsidian version + platform (desktop/mobile, OS)
- Plugin version
- A minimal rule set (include/exclude) that reproduces the issue
- A sample
file.pathstring that fails - Whether
Use glob patternsandCase sensitiveare enabled - Any relevant console logs (avoid sharing full paths unless necessary)
Please describe:
- The user story (what you’re trying to accomplish)
- How you expect it to behave on mobile
- Any compatibility concerns
This plugin is intended to evaluate rules locally and does not require network access for normal operation. If a proposed change introduces network requests or telemetry, it must be discussed explicitly and documented.
By contributing, you agree that your contributions will be licensed under the repository’s license (see LICENSE).