Bases: add a "Copy view source" option to easily copy a specific view's source/syntax

I know it’s still early days and there are many changes to come, but thought I would put this out there.

Use case or problem

I’d like to be able to easily copy the source of a specific Base view, so it can be pasted into a ```base code block. This would be convenient and helpful for those learning the Bases syntax, creating their own queries, troubleshooting, and understanding how Obsidian structures everything (if the view was originally made with the query builder UI).

Proposed solution

Add a “Copy view source” (or similar) option to the view sub-menu that copies the name, layout type, filters, properties, etc., for that view only.

Current workaround (optional)

Open the .base file in an external editor to inspect and grab the specific view you are looking for.

Additional

I know we can embed a view in a note using ![[third.base#no outs]] easily, but this FR is about getting the source of a specific view for use in Base code blocks.

4 Likes