Read Only View
approvedby mrkazzila
Keep selected Markdown notes in Reading view using include and exclude path rules. - This plugin has not been manually reviewed by Obsidian staff.
Read Only View
Keep selected Markdown notes in Obsidian Reading view by matching their vault paths against simple include and exclude rules.
- Community Plugin: available through Obsidian Community Plugins
- Platforms: Desktop and Mobile
- Requires: Obsidian
1.10.3+ - License:
0BSD - Support: GitHub Issues
Privacy: no network requests, all rule matching stays local.
What it does
Read Only View forces matched .md notes to stay in Reading view.
- Use include rules to choose which notes should stay read-only.
- Use exclude rules to carve out exceptions.
- Match one folder, one file, or a broader pattern set.
- Use built-in diagnostics and the Path tester when a rule does not behave as expected.
This plugin changes Obsidian view behavior only. It does not change file-system permissions.
Read-only protection uses two layers:
- editor-level input blocking for CodeMirror-backed Markdown editors
- automatic return to Reading view for matched notes as a view-level fallback, including when a read-only editor context is interacted with
This additional editor layer is intended to cover contexts such as Page Preview / Hover Preview more directly, though some edge cases still depend on Obsidian internal view behavior.
Quick start
By default:
Use glob patternsis off, so rules are matched as plain path prefixes.Case sensitiveis on.Excluderules override matching include rules.
First working setup in default mode:
- Open Settings → Community plugins → Browse.
- Search for
Read Only View, then Install and Enable it. - Open Settings → Read Only View.
- Make sure
Enabledis on. - In Include rules, add a folder rule such as:
projects/
- Open a note inside that folder, for example
projects/plan.md. - The note should stay in Reading view.
If it does not apply:
- confirm the note path starts with
projects/ - check whether
Case sensitivematches the actual path casing - check whether an
Excluderule also matches - run Re-apply rules now from the Command Palette
- use the Path tester with the exact note path

A note that matches the configured rules is kept in Reading view.
Installation
Community Plugins
Recommended for normal use.
- Open Settings → Community plugins.
- Click Browse.
- Search for
Read Only View. - Click Install.
- Click Enable.
BRAT (beta or dev testing)
Use this only to test unreleased changes instead of the Community Plugins release.
- Install Obsidian42 - BRAT from Settings → Community plugins → Browse.
- Open the Command Palette and run BRAT: Add a beta plugin for testing.
- Paste:
https://github.com/mrKazzila/Read-Only-View
- Add the plugin, refresh the plugin list if needed, then enable Read Only View.
Manual installation
Use this only as a fallback for local development or manual testing.
- Download or build the plugin files.
- Copy them into:
<Vault>/.obsidian/plugins/read-only-view/
- Required files:
main.jsmanifest.json
- Optional file:
styles.css
- Restart Obsidian or reload plugins, then enable Read Only View.
Local dev install with just
Use this to install a clearly marked local dev build into the repo demo vault by default without changing the repo manifest.json.
just link-plugin
DEV_PLUGIN_VERSION=999.1.0 just link-plugin
just unlink-plugin
just link-pluginsymlinksmain.jsand optionalstyles.css, then generates a vault-localmanifest.jsonwith a DEV label.- By default,
just link-pluginandjust unlink-plugintarget./demo-vaultin the repository root. - Use
VAULT=/path/to/vault just link-pluginorVAULT=/path/to/vault just unlink-pluginto target a different vault. DEV_PLUGIN_VERSION=... just link-pluginoverrides the default dev manifest version999.0.0.just unlink-pluginremoves only the local dev plugin install from the target vault after confirmation and leaves the vault notes intact.- Dev and release builds use the same plugin ID
read-only-view, so they cannot coexist in the same vault. - If
./demo-vaultdoes not exist yet, runjust demo-vaultorjust demo-vault-no-pluginfirst.
Demo vault for QA and media
Use the synthetic demo vault when you need manual QA, screenshots, or short videos without opening real notes.
just demo-vault
just demo-vault-reset
just demo-vault-no-plugin
just demo-vaultcreates or refreshes./demo-vaultand links the current local plugin build by default.just demo-vault-resetrecreates the vault from scratch.just demo-vault-no-plugincreates the same synthetic notes without linking plugin files.- The generated vault preconfigures
Include rulesforRead Only/andArchive/, plus anExclude ruleforRead Only/Drafts/. - If
main.jsis missing, the generator stops with a clear build-first message instead of creating a broken plugin install.
See docs/DEMO_VAULT.md for setup details and recommended recording scenarios.
How matching works
- Only Markdown files (
.md) are affected. - A note becomes read-only only if at least one include rule matches it.
- If an include rule and an
Excluderule both match, theExcluderule wins. - With
Use glob patternsoff, rules are treated as plain path prefixes. - With
Use glob patternson, rules may use*,**, and?. - Matching is case-sensitive unless you turn
Case sensitiveoff.
Default mode examples:
projects/matches notes under that folder, such asprojects/spec.mdnotes/policies/security.mdmatches that exact file path
If a rule surprises you, test the exact path in Path tester before changing several rules at once.
Rule examples
One folder in default mode
Use glob patterns off:
Include:
projects/
Exclude:
One exact file path
Use glob patterns off:
Include:
notes/policies/security.md
Exclude:
Include a folder, exclude one subfolder
Use glob patterns off:
Include:
projects/
Exclude:
projects/drafts/
Glob mode example
Turn Use glob patterns on first:
Include:
project_a/**
**/README.md
Exclude:
project_a/archive/**
Commands
Available from the Command Palette:
Enable read-only modeDisable read-only modeToggle read-only modeRe-apply rules now
Enable read-only mode appears only when the plugin is currently disabled.
Disable read-only mode appears only when the plugin is currently enabled.
Diagnostics and path tester
In Settings → Read Only View, you can configure:
EnabledUse glob patternsCase sensitiveDebug loggingDebug: verbose pathsInclude rulesExclude rules
While editing rules:
- settings are saved automatically after a short delay
- status text shows
Saving...,Saved., orSave failed. - diagnostics show suspicious or non-effective lines inline
- very large rule sets may cause extra lines to be ignored
Use Path tester to paste the exact note path and confirm:
- which include rules matched
- which exclude rules matched
- whether the final result is
READ-ONLY ONorREAD-ONLY OFF

Inline diagnostics help explain why a rule is valid, suspicious, or ignored.
Troubleshooting
- A note is not switching to Reading view:
- confirm the plugin
Enabledtoggle is on - confirm the file is a
.mdnote - confirm at least one include rule matches
- confirm no
Excluderule matches the same path
- confirm the plugin
- A rule looks right but still does not match:
- copy the exact note path into Path tester
- check path casing if
Case sensitiveis on - check whether
Use glob patternsis off and wildcard characters are being treated literally
- A folder rule matches too broadly:
- in default mode, remember that matching uses plain path prefixes
- keep a trailing
/for folder rules
- Rule changes do not seem to apply yet:
- wait for
Saved. - run Re-apply rules now
- reopen the note if needed
- after very rapid view toggles, allow a brief moment for the plugin to retry after the layout burst settles
- wait for
- Diagnostics show ignored rules:
- reduce the number of rules
- merge similar paths where practical
- prefer broader glob rules only if you intentionally enabled glob mode
Limitations
- This is not an OS-level read-only lock.
- It only affects Obsidian view behavior for Markdown files.
- It does not protect non-Markdown files.
- It is not a security boundary against other apps, editors, or external tools.
Development
For local development:
npm install
npm run lint
npm test
npm run build
For installing the plugin into a local test vault, use just link-plugin; remove it later with just unlink-plugin.
Repository guidance and contributor workflow live in CONTRIBUTING.md.
License
Licensed under 0BSD. See LICENSE.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.