My templates for the Templater Obsidian.md plugin.

Overview

Christian's Templater Templates

Found a template your like? Make sure you copy the raw file - not what Github renders. Click this button to see the raw file: image

Scripts

You will have to define a folder for your userscripts in Templater. Do this in your Templater settings under "Script files folder location". Remember, the scripts are called like this: tp.user.QuickAdd(tp, choices);, where QuickAdd is the case-sensitive name of thie file. So, if you change the file name, change it in the markdown template as well.

Installation of Scripts

  1. Grab both the .md and .js file. Make sure it is the raw markdown file.
  2. Make sure you've set a file path to "Script files folder location" as well as a "Template folder location" in your Templater settings.
  3. Add the .md file ot the folder you've set as your "Template folder location".
  4. Add the .js file ot the folder you've set as your "Script files folder location".

IMPORTANT: If you are inserting a template that has more than text (templater commands, etc), then you need to enable Trigger Templater on file creation.

iyeaguTouz.mp4

QuickAdd v2

Quickly add new pages or content to your vault. Powerful and customizable Templater 'plugin'.

In the default markdown file (QuickAdd.md), there is an array assigned to choices. Every element (choice) in this array must have an option name and a path to the template to insert. Choices should be separated by commas. The choices found in the default markdown file (QuickAdd.md) are my own settings. You might draw inspiration from them.

Choices are written in JavaScript object format, which consists of key-value pairs. They should be separated by commas. Like this: {key1: value1, key2: value2}. There are two main contexts to be aware of. Adding from a template, and quick capture. I'll illustrate them by example.

Add from Template

Property Required Type Description
Option Yes String The string shown in the suggester
Path Yes String Path to the template you want to add a new file with.
startSymbol No String A symbol which will be added, with a space, before the file name.
folder No String or string array The folder to which the file will be added. If an array of strings is added, you will be prompted to select one.
format No String The format of the filename. See format table for more info. Note: if no {{NAME}} or {{VALUE}} is in the format, you will not be prompted to add one.
appendLink No Boolean If true, a link to the file you've added is written to your cursor position.
incrementFileName No Boolean If true, and if a file with the given name is found, it will add 1 to the file name. Like, untitled, untitled1, untitled2, and so on.
noOpen No Boolean If true, the created file is not opened
newTab No "vertical" or "horizontal" Can only be used if noOpen is false. Must be a string that is either equal to horizontal or vertical - this signifies how the active tab will be split.

Quick Capture

Property Required Type Description
Option Yes String The string shown in the suggester. You can use the same syntax as format to create other filenames, which act as quickcapture files. For example, you could write captureTo: "daily/{{DATE}}.md", and it will capture to a file with the current date as it's name in the daily folder.
captureTo Yes String The file values are written to.
format No String The format of the filename. See format table for more info. Note: if no {{NAME}} or {{VALUE}} is in the format, you will not be prompted to add one.
prepend No Boolean If true, value will be added to the bottom of the file. Default is false.
appendLink No Boolean If true, a link to the file you've captured to is written to your cursor position.
task No Boolean If true, the value will be preceded by a - [ ].
insertAfter No String The value entered will be added on the line below a line matching the given string.

format syntax

Template Description
{{DATE}} Outputs the current date in YYYY-MM-DD format.
{{DATE:<DATEFORMAT>}} Replace <DATEFORMAT> with a Moment.js date format.
{{VDATE:<variable name>, <date format>}} You'll get prompted to enter a date, and it'll be parsed to the given date format. You could write 'today' or 'in two weeks' and it'll give you the date for that. Works like variables, so you can use the date in multiple places. REQUIRES THE NATURAL LANGUAGE DATES PLUGIN!
{{VALUE}} or {{NAME}} Interchangeable. Represents the value given in an input prompt.
{{VALUE:<variable name> You can now use variable names in values. They'll get saved and inserted just like values, but the difference is that you can have as many of them as you want. Use comma separation to get a suggester rather than a prompt.
{{LINKCURRENT}} A link to the file from which the template is activated from. [[link]] format.

Multi-Choice

const choices = [
	{option: "🌀 Task Manager", multi: [
		{option: "✔ Add a Task", startSymbol: "", path: "bins/templates/New Task.md", folder: "tasks"},
		{option: "✔ Quick Capture Task", captureTo: "inbox/tasks.md", task: true, format: "{{VALUE}} 📆 {{DATE}}\n"},
		{option: "✔ MetaEdit Backlog Task", captureTo: "MetaEdit Board.md", task: true, insertAfter: "## Backlog", format: "{{VALUE}}\n"},
	]},
	// ...
]

// ...

You can categorize choices under a single, multi-choice. These can also be nested, meaning that you can have multi-choices within multi-choices.

Variables

const choices = [
	{
		option: "💸 Add Purchase", 
		captureTo: "workbench.md", 
		format:`|{{VALUE:Item}} | {{VALUE:💸 Cost}} | [[{{DATE:gggg-MM-DD - ddd MMM D}}]] | {{VALUE:Entertainment, Car, Groceries, Apartment}} |`,
		prepend: true
	},
	// ...
]

// ...

You can have as many variables as you want. They work in the same places as {{VALUE}} does.

Add from Template 1

Below is an example object representing one choice in the array.

const choices = [
	{
		option: "💭 Add a Thought", 
		path: "bins/templates/Inputs/Thought.md",
		startSymbol: "~", // optional
		folder: "thoughts" // optional
	},
	// ...
]

// ...

This choice would be displayed as 💭 Add a Thought in the choice suggester. If selected, it would add a new file using the template found in bins/templates/Inputs/Thought.md. It prompts for a value, which is the name of the file.

There are two optional keys: startSymbol and folder.

The start symbol is prepended to the name you enter when running the script. For example, if you write "Meditations", and your start symbol is {, the file name will be { Meditations.

The folder key represents which folder your item will be created in. If it does not exist, it will be made. folder can be either a single string, like: folder: "folderName", or an array of strings: folder: ["projects/one", "projects/two", "projects/three"].

Add from Template 2

const choices = [
	 {
	 	option: "📥 Add an Inbox item",
		path: "bins/templates/Inbox Template.md"},
		format: `{{DATE:gggg-MM-DD-HH-MM-SS}} - {{NAME}}`,
		folder: "inbox",
	},
	// ...
]

// ...

This example is much like the one above. The main difference is the format property. This formats the file name with the format defined in the string.

Format has three 'template' values. {{DATE}}, {{LINKCURRENT}} and {{NAME}}. Name has an alias, {VALUE}}, which you can use interchangeably. I'll explain {{LINKCURRENT}} in the Quick Capture 1 example.

If you write {{DATE}}, it'll give today's date in the yyyy-mm-dd format. You can pass in another date format - like the one shown in the example - but you will have to add a colon between DATE and the specified format. Example: {{DATE:gggg-MM-DD-HH-MM-SS}}. The one in the example would set the value to 2021-05-27-04-08-14. The date format is the Momentjs format, and relies on Templater to parse it.

Besides this, the format is a simple string, so you can pass in any string value you want. Because Templater allows for Javascript execution, you can make some creative formats using template literals.

Quick Capture 1

const choices = [
	 {
	 	option: "✍ Quick Capture", 
		captureTo: "inbox/appendToInbox.md", 
		format: "# [[{{DATE:gggg-MM-DD - ddd MMM D}}]] {{DATE:hh:mm}}\n{{LINKCURRENT}}: {{VALUE}}\n\n",
		prepend: false,
		appendLink: false
	}
	// ...
]

// ...

Now, quick captures are defined by the captureTo property. It should be given the path to a file which you would like to write to. By default, what you're trying to do a quick capture of will be written to the top of the document. You can use prepend: true to make it go to the bottom of the document. Another notable property is appendLink. If you set this property to true, the template will drop a link to the file you captured to.

Selecting this choice, a value corrresponding to the format will be added to the inbox/appendToInbox.md file. Running this, I added the following to my file:

# [[2021-05-27 - Thu May 27]] 03:57
[[bins/templates/QuickAdd.md]]: this is an example


Quick Capture 2

const choices = [
	 {
	 	option: "✔ Quick Capture Task", 
		captureTo: "inbox/tasks.md", 
		task: true, 
		format: "{{VALUE}} 📆 {{DATE}}"
	}
	// ...
]

// ...

This choice is a little simpler, and primarily demonstrates the task property. If task is set to true, then - [ ] will be prepended to the value - no matter the format.

Using this choice, I added - [ ] a new task 📆 2021-05-27 to my inbox/tasks.md file. This is what's used to denote a task date in the Obsidian Tasks plugin. 😉

Quick Capture 3

const choices = [
	 {
		option: "🚶‍♂️ Add journal item", 
	 	captureTo: "bins/daily/{{DATE:gggg-MM-DD - ddd MMM D}}", // My daily journal file name format and folder
		insertAfter: "## What did I do today?", // Looks for this line and inserts the text below it
		format: "- {{DATE:HH:mm}} {{VALUE}}\n"}, // Format of the entry
	// ...
]

// ...

This quick capture choice lets me quickly add journal entry points to my daily journal. It'll be in this format: - 18:05 Cooked dinner.

BR2Rdt4jDn

Main menu

image

Add

image

Start symbol (~)

image

https://github.com/chhoumann/Templater_Templates/tree/master/readwise

Insert anything from your Readwise account. You will need your Readwise token - which you can get here. It should be able to fetch anything from any time.

To get the main menu, use the readwise.md template. If you want to have a quote fetched from your "supplementals", you can use readwisedaily.md. I use that one in my daily note to show me a quote from one of the books I've marked as "supplemental".

Main menu

Obsidian_UfeK41i3zb

Books

image

Book selected

image

Write one highlight (select highlight)

image

Books (dataview)

This is a dataview query. image

Templates

Simple markdown templates that augment workflow.

Installation

  1. Make sure you've set a path to "Template folder location" in your Templater settings.
  2. Add the .md file ot the folder you've set as your "Template folder location". Make sure this is the raw markdown file. See instructions at the top of the page.
L2qAeDiULk.mp4

https://github.com/chhoumann/Templater_Templates/blob/master/code.md

Insert a codebox with the language specifed. Has two predefined languages. image

Example:

```CSharp

```

https://github.com/chhoumann/Templater_Templates/blob/master/latex_colors.md

Insert a LaTeX color with any predefined color. image

Example: \color{black}

https://github.com/chhoumann/Templater_Templates/blob/master/latex_environment.md

Insert a LaTeX environment (without $$$$ - I assume this is already done). image

Example:

$$
	\begin{gather} 
        // cursor will be set here
  \end{gather}
$$

https://github.com/chhoumann/Templater_Templates/blob/master/dataview/copy_links_in_query.md

This allows you to copy links to files found in a Dataviewjs query. You can customize the format however you want.

DEMO (and my use case): p19qk7DGAX

You might also like...

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Dec 26, 2022

A set a periodic note templates for Obsidian.md.

A set a periodic note templates for Obsidian.md.

MK's Periodic Note Templates A set of periodic note templates for Obsidian.md. Before You Start... Please note that these templates generally suit my

Dec 30, 2022

This repo contains the templates used in my automated obsidian weekly review video and also an accompanying vault with the folder structure expected and plugins

This repo contains the templates used in my automated obsidian weekly review video and also an accompanying vault with the folder structure expected and plugins

This repo contains the templates used in my automated obsidian weekly review video and also an accompanying vault with the folder structure expected and plugins (periodic note settings etc)

Dec 21, 2022

An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor.

An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor.

Obsidian Excel to Markdown Table An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor. Demo You can paste the copied Excel d

Jan 4, 2023

This is a plugin for Obsidian (https://obsidian.md). Can open document with `.html` and `.htm` file extensions.

Obsidian HTML reader Plugin This is a plugin for Obsidian (https://obsidian.md). Can open document with .html and .htm file extensions. Obsidian HTML

Dec 27, 2022

An Obsidian plugin that lets you browse the web within Obsidian.

An Obsidian plugin that lets you browse the web within Obsidian.

Obsidian Web Browser An Obsidian plugin that allows you to browse the web within Obsidian using v1.0 tabs. The core functionality of the plugin, rende

Dec 28, 2022

Obsidian To HTML, A template for building obsidian style notes to a static site

oth (Obsidian To HTML) This is a template for publishing obsidian notes as a static site. The goal of the project is to stay minimal, since this is a

Nov 4, 2022

Obsidian-dataview-table-filter-menu - Dynamically created filter menu for dataview tables in obsidian

Dataview table Filter Menu for Obsidian Dynamically created filter menu for data

Sep 24, 2022

Obsidian-Snippet-collection - A collection of snippet to customize obsidian

Obsidian-Snippet-collection - A collection of snippet to customize obsidian

This repo is a collection of CSS snippets for Obsidian.md. To install them on PC

Dec 22, 2022

Obsidian Web: Connect your browser with your Obsidian notes

 Obsidian Web: Connect your browser with your Obsidian notes

Obsidian Web: Connect your browser with your Obsidian notes This is an unofficial Chrome extension for Obsidian that lets you send content from the we

Jan 3, 2023

A mojo.js plugin that adds support for ejs templates.

A mojo.js plugin that adds support for ejs templates.

A mojo.js plugin that adds support for ejs templates. The code of this plugin is a good example for learning to build new plugins, you're welcome to fork it.

Jun 9, 2022

⚡️🌱 Vite plugin for Twig, transforms twig templates into HTML

⚡️ 🌱 ViteTwig import twig from '@vituum/vite-plugin-twig' export default { plugins: [ twig({ reload: true, root: null, filte

Dec 15, 2022

A tool to get plugin statistics of Obsidian plugin ecosystem.

A tool to get plugin statistics of Obsidian plugin ecosystem.

Obsidian Plugin Stats A tool to get plugin statistics of Obsidian plugin ecosystem. Usage You can use this tool to see the plugins that has hit commun

Dec 25, 2022

An obsidian toolbar plugin, modified from the Cmenu plugin

An obsidian toolbar plugin, modified from the Cmenu plugin

obsidian-editing-toolbar Plugin Thanks to the cmenu plugin, which gave me a lot of inspiration, but this plugin has not been maintained for more than

Dec 29, 2022

Create front end projects from templates, add dependencies, and automate the resulting projects

volo Create browser-based, front-end projects from project templates, and add dependencies by fetching them from GitHub. Once your project is set up,

Jan 2, 2023

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

Cerberus Responsive Email Patterns Coding regular emails is hard enough by itself. Making them responsive shouldn’t add to the headache. A few simple,

Dec 28, 2022

Embedded CoffeeScript templates

Eco: Embedded CoffeeScript templates Eco lets you embed CoffeeScript logic in your markup. It's like EJS and ERB, but with CoffeeScript inside the %

Dec 17, 2022

Embedded JavaScript templates -- http://ejs.co

Embedded JavaScript templates Installation $ npm install ejs Features Control flow with % % Escaped output with %= % (escape function configurable

Dec 30, 2022

A simpler static site generator. An alternative to Jekyll. Transforms a directory of templates (of varying types) into HTML.

A simpler static site generator. An alternative to Jekyll. Transforms a directory of templates (of varying types) into HTML.

eleventy 🕚 ⚡️ A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types

Jan 4, 2023
Comments
  • How to tell if more than text (eg templater commands)?

    How to tell if more than text (eg templater commands)?

    Thanks so much for these templates & your clear explanations Christian! I didn't understand what your comment here means: "IMPORTANT: If you are inserting a template that has more than text (templater commands, etc), then you need to enable Trigger Templater on file creation."

    What is more than text and how can a noob like me tell when it exists?

    opened by kenanmike 1
Owner
Christian Bager Bach Houmann
Christian Bager Bach Houmann
Obsidian To HTML, A template for building obsidian style notes to a static site

oth (Obsidian To HTML) This is a template for publishing obsidian notes as a static site. The goal of the project is to stay minimal, since this is a

Ulisse mini 11 Nov 4, 2022
Embedded CoffeeScript templates

Eco: Embedded CoffeeScript templates Eco lets you embed CoffeeScript logic in your markup. It's like EJS and ERB, but with CoffeeScript inside the <%

Sam Stephenson 1.7k Dec 17, 2022
Embedded JavaScript templates -- http://ejs.co

Embedded JavaScript templates Installation $ npm install ejs Features Control flow with <% %> Escaped output with <%= %> (escape function configurable

Matthew Eernisse 6.8k Dec 30, 2022
A simpler static site generator. An alternative to Jekyll. Transforms a directory of templates (of varying types) into HTML.

eleventy ?? ⚡️ A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types

Eleventy 13.4k Jan 4, 2023
Embedded CoffeeScript templates

Eco: Embedded CoffeeScript templates Eco lets you embed CoffeeScript logic in your markup. It's like EJS and ERB, but with CoffeeScript inside the <%

Sam Stephenson 1.7k Jan 2, 2023
Browser In The Browser (BITB) Templates

BITB Browser templates for Browser In The Browser (BITB) attack. More information: https://mrd0x.com/browser-in-the-browser-phishing-attack/ Usage Eac

mrd0x 2.5k Jan 5, 2023
⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

⚡️Blitz 12.5k Jan 4, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023