Skip navigation.

exploreopera

| Help

Sign up | Help

Linux for Designers

a blog by Eckhard M. Jäger

gEdit Template plugin

, , , ,

For SweeTS i needed the possibilty to create a document based on a template file (the normal "New from template"). gEdit didn't ship with that and so i tried to create it. I was lucky to find a start in the familiar plugin by Rob Miller.
I heavily modified it and this is how it works:
* Copy the files of the Template plugin into ~/.gnome2/gedit/plugins
* create a folder "templates" in ~/.gnome2/gedit
* copy your templates files into it (example default.html)
* Start gEdit and enable the plugin "New File From a Template" in the preferences
* After a restart the plugin appears in the File menu
* Assign the typical shortcut "Shift+Ctrl+N" to it
* the new created files will get the mimetype of the template files

This is a first version and the code needs a small clean up but it works well.

Other gEdit plugins i wrote:
http://my.opera.com/area42/blog/gedit-language-reference-plugin
http://my.opera.com/area42/blog/gedit-browser-preview-plugin

A lot of other gEdit plugins can be found here.

Second Life WindLight First Look ViewerGimp 2.4.2

Comments

avatar
engel writes:

Great template! I've just released a basic template set for this: http://hansengel.wordpress.com/2007/11/27/gedit-template-plugin-basic-templates/

It includes most templates that web developers would need.

By anonymous user, # 28. November 2007, 04:02:42

avatar
Hello Engel,

very cool, i will check it out!

By area42, # 28. November 2007, 07:47:42

avatar
engel writes:

I have a suggestion for this plugin....

Why not make support for "variables", like the current user logged in? Then, we could reference the variables from our templates through brackets (ex. "{user}"). The plugin would process the template, and replace the variables with their values.

By anonymous user, # 28. November 2007, 13:37:10

avatar
a possibel way, i will think about that.

By area42, # 28. November 2007, 18:10:45

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

Please type this security code : 1e1157

Smilies