Skip to content

Commit

Permalink
update documentation and set new contribute section
Browse files Browse the repository at this point in the history
  • Loading branch information
jalogut committed Oct 12, 2016
1 parent 69dedc9 commit 0df896d
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 57 deletions.
59 changes: 2 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ All other templates are custom ones with a naming prefix `2m` in order to make t

## Installation

You can install this project in 2 different ways:

### Using PHPStorm .jar

0. Just download the `.jar` file and import it in your PHPStorm `File -> Import`

* `https://github.com/staempfli/magento2-phpstorm-templates/releases/<version>/settings.jar`
Expand All @@ -22,44 +18,6 @@ You can install this project in 2 different ways:

![Comments settings](docs/img/comments_settings.png)

### Cloning this project

**IMPORTANT:** Before you do this, make sure PhpStorm is not running, or it will overwrite the changed files before shutting down.

1.- Clone this repo.

```bash
git clone https://github.com/staempfli/magento2-phpstorm-templates.git
```

2.- Personal Comments configuration

```bash
$ cd magento2-phpstorm-templates
$ cp Preferences/fileTemplates/includes/stmpfl_variables.txt.dist Preferences/fileTemplates/includes/stmpfl_variables.txt
$ vim Preferences/fileTemplates/includes/stmpfl_variables.txt
```

3.- Set Symlinks to new templates:

**OS X**

```bash
$ ln -s $(PWD)/magento2-phpstorm-templates/Preferences/templates/* ~/Library/Preferences/<product name><version number>/templates/
$ ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/* ~/Library/Preferences/<product name><version number>/fileTemplates/
```

**Linux**

```bash
$ ln -s $(PWD)/magento2-phpstorm-templates/Preferences/templates/* ~/.<product name><version number>/config/templates/
$ ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/* ~/.<product name><version number>/config/fileTemplates/
```

**Windows**

As symlinks do not work by default in Windows, it is better to use the `.jar installation.

## Available Templates

* [File Templates](docs/fileTemplates.md)
Expand All @@ -72,19 +30,6 @@ We need to use the default `PHP Class.php` because automatic Namespace only work

## Contribute

### Live templates:

0. Fork this project
0. Add new live templates on PHPStorm within the ***StmpflMagento2*** group.
0. Commit, push and create PR

### File Template:

0. Fork this project
0. Create new File template on PHPStorm
0. Copy this template from your local PHPStorm preferences into this project `Preferences/fileTemplates`
0. Commit, push and create PR

### Update Live templates Documentation
You can contribute with new templates following this manual:

`cd magento2-phpstorm-templates/Preferences/templates && echo 'cat //templateSet/template/@name' | xmllint --shell "StmpflMagento2.xml"`
* [Contribute manual](./docs/contribute.md)
56 changes: 56 additions & 0 deletions docs/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Contribute

## Fork and Install this project

**IMPORTANT:** Before you do this, make sure PhpStorm is not running, or it will overwrite the changed files before shutting down.

1.- Clone this repo.

```
git clone https://github.com/staempfli/magento2-phpstorm-templates.git
```

2.- Personal Comments configuration

```
cd magento2-phpstorm-templates
cp Preferences/fileTemplates/includes/stmpfl_variables.txt.dist Preferences/fileTemplates/includes/stmpfl_variables.txt
vim Preferences/fileTemplates/includes/stmpfl_variables.txt
```

3.- Set Symlinks to new templates:

**OS X**

```
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/templates/* ~/Library/Preferences/<product name><version number>/templates/
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/2M* ~/Library/Preferences/<product name><version number>/fileTemplates/
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/includes/* ~/Library/Preferences/<product name><version number>/fileTemplates/includes/
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/internal/* ~/Library/Preferences/<product name><version number>/fileTemplates/internal/
```

**Linux**

```
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/templates/* ~/.<product name><version number>/config/templates/
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/2M* ~/.<product name><version number>/config/fileTemplates/
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/includes/* ~/.<product name><version number>/config/fileTemplates/includes/
ln -s $(PWD)/magento2-phpstorm-templates/Preferences/fileTemplates/internal/* ~/.<product name><version number>/config/fileTemplates/internal/
```

## Create new Templates

### Live templates:

0. Add new live templates on PHPStorm within the ***StmpflMagento2*** group.
0. Commit, push and create PR

### File Template:

0. Create new File template on PHPStorm
0. Copy this template from your local PHPStorm preferences into this project `Preferences/fileTemplates`
0. Commit, push and create PR

### Update Live templates Documentation

`cd magento2-phpstorm-templates/Preferences/templates && echo 'cat //templateSet/template/@name' | xmllint --shell "StmpflMagento2.xml"`

0 comments on commit 0df896d

Please sign in to comment.