ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Project​Tree​Templater

A simple templater for your project: manage the tree with a simple script!

Details

Installs

  • Total 2K
  • Win 1K
  • Mac 495
  • Linux 515
Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2
Windows 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Project Tree Templater - Bring templates to your project!

Introduction

This is a simple plugin for Sublime Text 3 to create a template for your project. Imagine that you're creating your project literally from zero. You first have to create a folder called “css” where you will put all your CSS files in. Like before, you'll do a “js” folder, where you'll put your Javascript files in. And finally you'll create also an index.html where you will put your HTML inside of it.

Of course, this could be the probably not-common case of work, but in fact, sometimes happenes, from creating templates to starting little projects.

Today, with this plugin you can automate all your work, with only a few line of meta declarations, and everytime your project file will be saved, it will be reflected to your project folder. Simple as it should be.

How it works

The only thing you have to do is creating a my_project_name_here.stprj file wherever you want, remember that EVERYTHING will be created in the same place where, that file, will be saved.

After that, what you have to do is declaring your project structure as likely you're used to do manually. For example, the project mentioned in the Introduction before, could be written as the following:

css/
js/
index.html

Yes, that's it. Pretty simple and clean! Does it sound familiar? Yeah, Unix path declaration. Nothing more, you have all the basis you would need to use this plugin. Nothing new.

Reference

  • To simply place a comment in your source script use the # character as the first character of your line. An example of use would be:

    # Example of comment
    
  • To simply remove any file from your project everytime you save place the - character as the first character of your line. An example of use would be:

    -css/style.css
    

    but let we suppose we're going to remove all files inside the folder (and the folder itself), then we have to write:

    -css/*
    

    or you can also write

    -css
    

    since it will autodetect if it's a folder. Notice that this is just the same syntax as -css/*.

  • To place a default template for every file which will be created with that extension we will use the ? character as the first character of your line. An example of use would be:

    ?css:path/to/tpl.css
    ...
    css/style.css
    

    remember that global templates MUST be declared before ANY path declaration.

  • To place a single template for a single file, overriding also the global template (if it exists), we have to write the : character AFTER the path declaration. An example of use would be:

    css/style.css:path/to/tpl.css
    
  • You can now use URLs (http or https) to download resources (even in templates or in single files). Just put your URL after the : charater. An example of use would be:

    js/jquery-latest.min.js:http://code.jquery.com/jquery-latest.min.js
    
  • NEW! You can use Groups! It's nothing special, it's just a parent directory that will contain any path inside of it. An example of use woud be:

    foo (
        css/
        js/
        index.html
    )
    

or also

foo/bar (
        css/
        js/
        index.html
    )

And remember!

If you place a / character at the beginning of any path (template or not), the path will be always considered RELATIVE to the project file.

How to install

Soon it will be available to Sublime Package Control. So what you have to do is: press code>Ctrl+Shift+P, type install, press Enter then type ProjectTreeTemplater and finally press again the Enter key.

In the meanwhile, to install it you just have to download a copy of this folder, and copy it to the one of your already existing packages. To find it, simply open Sublime Text and then do

Preferences -> Browse Packages...

and place it inside that folder.

License

See LICENSE.

Last but not least

This plugin is far from perfect, so if you find any bug you're free to contribute :)