A general format for specifying links to a part of note (multiple paragraphs, ranges) / Embedding Multiple Consecutive Headings Or Blocks

Related syntax suggestion:
Add support for relative offsets from header/block anchors.

[[filename#header{0}]]
  • refers to the header block only, no following content
[[filename#header{2}]]
  • second block after header
[[filename#^block{-3}]]
  • also works with block ids
  • also supports negative offsets
[[filename#^block{-3;7}]]
  • two values separated with semicolon denote inclusive interval relative to one anchor
  • negative and positive offsets allow to capture context around the linked block
[[filename#header:#header2]]
[[filename#header..#header2]]
[[filename#header~#header2]]
  • two anchors separated by the separator symbol denote interval between different anchors
  • colon or two dots or tilda or whatever - I’ll take any option
  • second header anchor default offset behavior is up for debate
[[filename#header{1}..#header2{-1}]]
  • combine two anchors and relative offsets
  • semicolon in curly braces is disallowed here
  • this allows to capture content between anchors without the anchored lines
[[filename#header{1}~#$header]]
  • a symbol to refer to the last block of the header contents
  • dollar sign is my suggestion that reflects its common usage to denote the end of something
  • this should address the situation when the next header is unknown/inconsistent
  • (solves common request - how to embed section content without the heading)
[[filename#header{1}~#$header{-2}]]
  • also combinable with offsets
  • allows to skip templated content such as a separator line before next section
[[filename#header{1;$}]]
[[filename#header{1;$-2}]]
  • putting last block symbol into curly braces
[[filename#{0;$}]]
[[filename#{0}..#{$}]]
[[filename{0;$}]]
[[filename{$-10;$}]]
  • offsets computed from the beginning and the end of file when no anchors
  • I don’t know if # is mandatory - I’ll take any option
4 Likes