Git Product home page Git Product logo

obsidian-metatemplates's Introduction

obsidian-metatemplates

Take advantage of YAML front-matter in generating notes from templates

Disclaimer

I haven't really tested this plugin at all on any vaults but my own, and there are likely many places where the appropriate checks for null or undefined values are missing. Therefore, you may experience significant errors early on. When this happens, please open DevTools (ctrl/cmd + shift + i), save the console error output, and report it as an issue through this repository's Issues tab. This plugin shouldn't delete your files or anything, but it may just occassionally not work as expected.

Frontmatter-based templates

This plugin is more or less intended to be used as a replacement for the core templates plugin. sample template

Usage

First, refer to plugin settings and specify a template folder location as well as desired date and time formats.

Each template is distinguished by its type property in the frontmatter. You then can additionally specify a nameFormat property and a destFolder property. The nameFormat property will be used to dynamically rename other notes elsewhere in your Obsidian vault (but outside of the templates folder) that are of the same type. That is, any template with a nameFormat specified will apply to other notes that were generated using that template. The nameFormat property draws from the other frontmatter attributes for each file, and updates automatically when there are changes to the frontmatter.

The destFolder property is used along with the metatemplates: Create from template command (available in the command pallette and assignable to a hotkey via settings). When this property is specified, any notes created from that template will be automatically placed in the specified location (relative path to vault root).

The dynamically filled upon note insertion/creation values {{date}} and {{time}} are replaced by <<date>> and <<time>> when using metatemplates, in order to minimize confusion.

Sample Output

sample output

Credits

Thanks to Liam and Licat in the Discord #plugins channel for their frequent help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.