Create template files in GNOME

Make boilerplates so you can get started on a new document faster.
59 readers like this.
Digital images of a computer desktop

Opensource.com

I just stumbled onto a new (to me) feature of the GNOME desktop that enables you to create a document template. A template is generally an empty shell of a document with certain things configured and is often referred to as boilerplate. An example might be a letterhead for a law firm, with its corporate title and address at the top. Another might be a bank or insurance carrier letter that contains certain disclaimers in the footer at the bottom of the document. Since this sort of information rarely changes, you can add it to an empty document to use as a template.

I was browsing through files on my Linux system one day and clicked on the Templates directory. I just happened to notice a message at the top of the window that stated, "Put files in this folder to use them as templates for new documents." There was also a link to Learn more… that opens the GNOME help for templates.

Create a template

Creating a template for the GNOME desktop is quite simple. There are several ways you can place a file into this folder: You can copy or move a file from another location through either the graphical user interface (GUI) or the command-line interface (CLI), or you can create an entirely new file. I chose the latter; actually, I created two files.

The first template I created is for an Opensource.com article. It provides a place to enter a title and several lines for my name and the license terms under which I am providing the content of the article. I use the Markdown document format for my articles, so I create the template as a new Markdown document—Opensource.com Article.md:

# Title    

```
An article for Opensource.com
by: Alan Formy-Duval
Creative Commons BY-SA 4.0 
```

I saved this document as a file in /home/alan/Templates. Now GNOME recognizes this file as a template and suggests it whenever I want to create a new document.

Use a template

Whenever I get a spark or epiphany for a new article, I can just right-click in the folder where I plan to organize my content and select the template from the New Document list.

You can make a template for all sorts of documents or files. I am writing this article using a template I created for my Opensource.com articles. Programmers might use templates for software code; perhaps you want a template that just contains main().

The GNOME desktop environment provides a very useful, feature-rich user interface for users of Linux and related operating systems. What are your favorite GNOME desktop features, and how do you use them? Please share in the comments!

What to read next
Tags
Alan Formy-Duval Opensource.com Correspondent
Alan has 20 years of IT experience, mostly in the Government and Financial sectors. He started as a Value Added Reseller before moving into Systems Engineering. Alan's background is in high-availability clustered apps. He wrote the 'Users and Groups' and 'Apache and the Web Stack' chapters in the Oracle Press/McGraw Hill 'Oracle Solaris 11 System Administration' book.

3 Comments

Whoa Alan! Great find, I always wondered what that Templates directory was for. Thank you.

I'd like to mention that this feature is not GNOME-specific. It's been around for years and is indeed very useful. Many file managers know how to deal with the Templates folder as long as it exists and has content. :)

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.