4 Richer Templating

Goals

More powerful templating features for Dendron

Details

Proposal

Use nunjucks to customize Dendron

Example

  • overriding properties in a link
{{ ![[foo]] | config(prettyRef = false) }}
  • rendering a note ref with a custom template

    {{ ![[people.john]] | template("person") }}
    
    • raw note

      ---
      title: John Snow
      homepage: https://john.dendron.wiki
      discord: @john123
      email: john@hey.me
      ---
      
    • template

      {% block content %}
      
      # [{{fm.title}}]({{fm.homepage}})
      
      
    • discord: {{fm.discord}}

    • email: {{fm.email}}

      {% endblock %}

    • output

      # [John Snow](https://john.dendron.wiki)
      
      
    • discord: @john123 (Private)

    • email: john@hey.me

Tradeoffs

  • pros
  • cons
    • slow down compilation time

People


Backlinks