Add support for link types

Workarounds:
In YAML, [[name without comma or colon or brackets]] is an array containing only one element, which happens to be a again an array containing only one string “name without ... or brackets”. We could interpret YAML/JSON substructure with such properties as a link to innermost string but that would be implicit, not explicit.


Option: We can enclose each link in YAML in quotation marks to store it as quoted string "[[link]]" or '[[link]]'. Some characters like # and other need to be escaped in these.

Option: AFAIK, we can use YAML block scalar to store any text without need to escape anything.
Just introduce multiline string by pipe character and put the content on the next line. Indent the content more than the line above (by spaces, not tabs).

key: |
  # headings, 
  [[links]], #tags, {}
  C:\paths with\backslashes\
  etc
  can be used in multiline string (YAML block scalar)
  It starts on next line after pipe character indicator. 
  Just indent each line of string by more spaces than the line above string. 

Links in front-matter were also discussed in Include / show note links in yaml frontmatter (v0.8.5)

Strings stored in YAML would then need to be parsed as markdown
Alternatively, and then parse strings within parsed yaml as markdown (both, keys and values) to see if they match wiki-link syntax.


Option: we could specify custom data type before each link or hypertext. Possible results:

  • !link [[my link]]
  • !link "[[my link]]"
  • !link "my link"
  • !md "hypertext with [[my link]]."
4 Likes