Initial ideas for a proposed solution:
- Creation of blocks is done by {{curly braces}}. When you create a block, you don’t need to make a title/id, though you can by doing {{id|curly braces}}.
- Linking/embedding blocks is done using ((parentheses)). If you attempt to link to a block without an id, it auto-generates an ID (modifying both your link and the block in the file).
We also ideally want to make it easy to turn a block into a file. Perhaps we can use Obsidian’s inbuilt “what should the next new file be called” for the block id - so e.g. {{Untitled 1|block content}} when autogenerated. Or, if the user has the zettelkasten note prefixer on, it’ll have the timestamp.
In that case, we might be able to get away with the standard [[link|display]] syntax - the link would be the block id. It would be easier to only introduce one new kind of syntax, rather than two!
So, as a summary of an iterated idea for this:
- Blocks are made by surrounding text in ((parentheses)), and optionally prepending a title via ((title|content)).
- The title would either be auto-generated when linking to a block for the first time, or auto-generated when creating a block.
- We might be able to have it so that blocks without a pipe have the content as the title by default. This is a little harder, since then block changes have to be reflected everywhere the block exists, in the actual link.
- Blocks can be referenced like any other content via [[link|display]] syntax. This will show a clickable link with the text “display”, that links to the block.
- Blocks can be embedded via ![[link]].
- When viewed in preview mode on their original file, only the content of the block displays, not the title - similar idea to the ‘piped’ part of the link showing in regular internal links.
- We might re-use the syntax for headers to extend to arbitrary blocks, so [[file#blocktitle|display]].
- Since we’re using the above syntax, blocks could be simply numbered sequentially on a page (when initially generating the title), so Block 1, Block 2 etc
- Searching for a block would have to be by title with how current search works, unless Obsidian implements searching via content (in which case we might be able to have blocks without a title work).
- You can turn a block into a header and preserve links. Turning a block into a file would follow the same process as turning a header into a file would - this might become a part of core Obsidian functionality rather than something handled by a block referencing plugin.
- Blocks can be nested in a similar way to how headers can be nested.