Anup Chavan6k downloadsCreate custom HTML views for your notes based on filter rules. Transform how your notes are displayed.
Turn structured notes into purpose-built pages. Custom Views renders matching notes with your own HTML, CSS and JavaScript, while the data stays in ordinary Markdown and frontmatter.
A movie note can look like a film page, an album like a record sleeve with its tracklist, a recipe like a card. Edit the note as usual, and the view updates with it.
Search for Custom Views in Settings → Community plugins → Browse, install it, and enable it.
To try the latest beta, install BRAT and add anupchavan/obsidian-custom-views as a beta plugin.
Custom Views uses Obsidian's Bases filters for its rules, so turn on Bases in Settings → Core plugins.
The first matching view wins, so put specific views above broad ones. Changes save automatically.
Templates are HTML with placeholders for the note's properties:
<div class="movie">
<img src="{{poster}}" alt="{{title}}">
<h1>{{title}} <span>{{released | date:"YYYY"}}</span></h1>
{% if rating >= 8 %}<p class="badge">Favourite</p>{% endif %}
<ul>
{% for actor in cast %}<li>{{actor}}</li>{% endfor %}
</ul>
{{file.content}}
</div>
file.basename, file.folder, file.mtime and file.content (the note body, rendered as Markdown).director is [[Christopher Nolan]], then {{director[0].born}} reads a property from that note.upper, date, join, split, map, unique, round, markdown, wikilink and many more.{% if %}, {% for %} and {% set %}, with and, or, not, comparisons and ?? for fallbacks.{% base %} block, so an album view can list every song that links back to it.CSS is scoped to the view, so it won't leak into the rest of Obsidian.
Run Custom Views: Open view editor from the command palette, or open it from settings, to edit a view beside a live preview. Pick any matching note to preview against, rearrange or dock the HTML, CSS and JavaScript panels, or pop them out into their own window on desktop.
The editors check your code as you type. Unclosed tags, broken expressions, unknown filters, misspelled property names and JavaScript errors are underlined where they happen, with a message at the end of the line and a hint on how to fix it.
Views can also apply in popover previews, Canvas cards and embedded notes. Turn each on in settings. In a view's editor, Template for lets each of these contexts inherit the main template or override its HTML, CSS or JavaScript separately, for example a compact card for hover previews.
With Editable content in live preview on, {{file.content}} becomes the native editor, so you can write in the note without leaving the view.
From a note's menu you can jump to its view's editor, turn the view off everywhere, or pause it for the current tab.
Views can run JavaScript when the view renders. Scripts run inside Obsidian with full access to your vault, so only use scripts you wrote or trust. Turn off Allow JavaScript execution in settings to disable them entirely.
The wiki covers everything in depth:
Issues and pull requests are welcome. When reporting a rendering problem, include the view's rules, template, the note's frontmatter and any console error. See CONTRIBUTING.md to set up a development build.