Link Search Menu Expand Document

References

Summary

Dendron allows you to reference content from other notes and embed them in your current note.

Currently, Dendron supports 4 types of references:

  • note references
  • header references
  • block references
  • range references

References have the following syntax:

![[name.of.note]]

Here's an example with a block anchor:

![[name.of.note#^important-paragraph]]

Another example with a header range:

![[name.of.note#starting-header:#ending-header]]

NOTE: When referencing headers with spaces in them, the note ref needs to use - instead of spaces within the name. This is a limitation of adopting GitHub-style slugger references. This is also useful for when multiple subheaders on a page may have the same name, which would expect something else #foo vs. #foo-1 vs. #foo-2. This can be automatically taken care of by highlighting a header, and using cmd+shift+r / ctrl+shift+r to add a properly-formatted note ref to the clipboard.

For more information:

NOTE: Dendron recently switched the note ref syntax for ((ref: [[foo]])) to ![[foo]]. The videos have not yet been updated to reflect this change.

Configuration

  • note references by default come with an outline. They are called pretty refs.

Toggle the following configuration to turn off this setting.

usePrettyRefs

  • default: true

If set to false, don't use pretty refs

Commands

You can create a ref either by hand or using the Copy Note Ref command.

Copy Note Ref

  • shortcuts:
    • key: ctrl+shift+r
    • mac: cmd+shift+r
    • when: editorFocus

Copies a reference to the current open document

This lets you quickly create a note reference to the current note.

Note Reference

A note reference will include the entire contents of a note within another note. Below is an example of a note reference.

![[dendron.demo.refs.sample]]

Note that references also respect the wildcard operator. The following example will include all child pages of sample.

![[dendron.demo.refs.sample.*]]

Header Reference

A block reference will include the entire contents of a note starting from a specified heading.

![[demo.embed.block#head1]]

Block Reference

A block reference will include the contents of a single paragraph, table, list, or a list item. What's referenced depends on where the block anchor is placed, you can find some examples at Block References.

![[example.my-note#^my-list]]

Block Range Reference

A block range reference will include the contents of a note starting from a start header or block anchor, and ending at a end header or block anchor. You can also mix headers and block anchors.

![[demo.embed.block#head1:#head3]]

![[demo.embed.block#head4:#^some-block]]

Header Reference Offset

A note reference offset is a way to skip a number of lines when using a header reference. The syntax is ,{number}. Below is an example of using a note reference offset to offset an initial heading, skipping the actual header when doing the embeding.

  • NOTE: currently, note reference offsets are limited to the first anchor inside a block reference. They must also be a positive value
![[demo.embed.block#head1,1]]

Wildcard Header Reference

When you're referencing a header by reference, sometimes you don't care what the next header is, just that the reference covers all text up to the next header. You can now specify this using the * symbol in a header reference.

For example, the following would reference the content from header1 to the next header.

![[demo.embed.block#head1:#*]]

Recursive Reference

Note references can refer to notes with references inside. Dendron current supports references two levels deep. This applies to both the local preview as well as publishing.

Wildcard Note Refs

Note references accept the * operator at the end which lets you grab all notes of a given level of hierarchy. This also works with typical note reference operation like block selection which means you can use it to grab specific blocks from every note in a level.

Publishing

When you publish a note with a note reference, Dendron will embed the content of the reference in the page. If the content is part of a published page as specified by the publishing configuration, dendron will include a link to the page. If not, Dendron will embed the content without a link. If the referenced content is not publishable (eg. published: false set on frontmatter), dendron will generate a custom 404 link.