Skip to content

Commit 6ee6a45

Browse files
committed
Fixes JSON formatting in README.md
1 parent bea6c92 commit 6ee6a45

File tree

1 file changed

+79
-67
lines changed

1 file changed

+79
-67
lines changed

README.md

Lines changed: 79 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,35 @@ The core version of Drupal to be used with the project is specified using the [C
5252
Adding the following package to the `repositories` and `requires` sections will download Drupal 7.28 to the root of the Composer project:
5353

5454
```json
55-
"repositories": [
56-
{
57-
"type": "package",
58-
"package": {
59-
"name": "drupal/drupal",
60-
"type": "non-destructive-archive-installer",
61-
"version": "7.28",
62-
"dist": {
63-
"url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
64-
"type": "zip"
65-
},
66-
"require": {
67-
"azt3k/non-destructive-archive-installer" : "*"
68-
},
69-
"extra": {
70-
"target-dir": ".",
71-
"omit-first-directory": "true"
72-
},
73-
"replace": {
74-
}
75-
}
76-
}
77-
],
78-
"require": {
79-
"azt3k/non-destructive-archive-installer" : "0.2.*",
80-
"drupal/drupal": "7.*"
81-
}
55+
{
56+
"repositories": [
57+
{
58+
"type": "package",
59+
"package": {
60+
"name": "drupal/drupal",
61+
"type": "non-destructive-archive-installer",
62+
"version": "7.28",
63+
"dist": {
64+
"url": "http://ftp.drupal.org/files/projects/drupal-7.28.zip",
65+
"type": "zip"
66+
},
67+
"require": {
68+
"azt3k/non-destructive-archive-installer" : "*"
69+
},
70+
"extra": {
71+
"target-dir": ".",
72+
"omit-first-directory": "true"
73+
},
74+
"replace": {
75+
}
76+
}
77+
}
78+
],
79+
"require": {
80+
"azt3k/non-destructive-archive-installer" : "0.2.*",
81+
"drupal/drupal": "7.*"
82+
}
83+
}
8284
```
8385

8486
Using Composer to manage Drupal projects has so far been tested with Drupal 7 projects. It may or may not work for Drupal 6 and 8.
@@ -100,9 +102,11 @@ The following will download the [Chaos tool suite (ctools)](https://drupal.org/p
100102

101103

102104
```json
103-
"require": {
104-
"drupal/ctools": "7.1.4"
105-
}
105+
{
106+
"require": {
107+
"drupal/ctools": "7.1.4"
108+
}
109+
}
106110
```
107111

108112
The module will be placed under `sites/all/modules/contrib/`.
@@ -114,12 +118,14 @@ You can also run `php composer.phar require drupal/ctools` from the command line
114118
Drupal projects are normally not available from the default Composer package repository Packagist. In order to for this to work a custom repository must be added:
115119

116120
```json
117-
"repositories": [
118-
{
119-
"type": "composer",
120-
"url": "http://packagist.drupal-composer.org"
121-
}
122-
]
121+
{
122+
"repositories": [
123+
{
124+
"type": "composer",
125+
"url": "http://packagist.drupal-composer.org"
126+
}
127+
]
128+
}
123129
```
124130

125131
This repository is generated using the [drupal-parse-composer project](https://github.com/drupal-composer/drupal-parse-composer).
@@ -138,11 +144,13 @@ In this example the following releases of Drupal 7 modules will be downloaded:
138144
* Latest development release of Views 3.x
139145

140146
```json
141-
"require": {
142-
"drupal/ctools": "7.1.*",
143-
"drupal/features": "7.*",
144-
"drupal/views": "7.3-dev"
145-
}
147+
{
148+
"require": {
149+
"drupal/ctools": "7.1.*",
150+
"drupal/features": "7.*",
151+
"drupal/views": "7.3-dev"
152+
}
153+
}
146154
```
147155

148156
#### Patch
@@ -154,6 +162,7 @@ To apply a patch to a project a `patches` section must be added to the `extras`
154162
The following will patch the Chaos tool suite version 7.1.4 with [this patch](https://drupal.org/files/issues/ctools-deleted-not-needed-element-from-array-in-node-plugin.patch):
155163

156164
```json
165+
{
157166
"repositories": [
158167
{
159168
"type": "package",
@@ -183,6 +192,7 @@ The following will patch the Chaos tool suite version 7.1.4 with [this patch](ht
183192
"netresearch/composer-patches-plugin": "~1.0",
184193
"reload/drupal-composer-project-patches": "*"
185194
}
195+
}
186196
```
187197

188198
The important parts about a package containing patches are:
@@ -206,12 +216,14 @@ The plugin does not generate a `PATCHES.txt` file for each patched project as Dr
206216
The location of projects can be changed in the `installer-paths` section of `composer.json` either by individual project or by type.
207217

208218
```json
209-
"extra": {
210-
"installer-paths": {
211-
"sites/all/modules/contrib/{$name}/": ["type:drupal-module"],
212-
"sites/all/themes/{$name}/": ["drupal/zen"]
213-
}
219+
{
220+
"extra": {
221+
"installer-paths": {
222+
"sites/all/modules/contrib/{$name}/": ["type:drupal-module"],
223+
"sites/all/themes/{$name}/": ["drupal/zen"]
214224
}
225+
}
226+
}
215227
```
216228

217229
Custom location of packages are handled by [the Composer Installers project](https://github.com/composer/installers).
@@ -263,27 +275,27 @@ Non-Drupal non-Composer libraries can be retrieved by specifying them as custom
263275
Example downloading jQuery UI 1.10.4:
264276

265277
```json
266-
{
267-
"repositories": [
268-
{
269-
"type": "package",
270-
"package": {
271-
"name": "jquery/jqueryui",
272-
"version": "1.10.4",
273-
"type": "drupal-library",
274-
"dist": {
275-
"url": "http://jqueryui.com/resources/download/jquery-ui-1.10.4.zip",
276-
"type": "zip"
277-
},
278-
"require": {
279-
"composer/installers": "~1.0"
280-
}
281-
}
282-
}
283-
],
284-
"require": {
285-
"jquery/jquery.ui": "1.10.4"
286-
}
278+
{
279+
"repositories": [
280+
{
281+
"type": "package",
282+
"package": {
283+
"name": "jquery/jqueryui",
284+
"version": "1.10.4",
285+
"type": "drupal-library",
286+
"dist": {
287+
"url": "http://jqueryui.com/resources/download/jquery-ui-1.10.4.zip",
288+
"type": "zip"
289+
},
290+
"require": {
291+
"composer/installers": "~1.0"
292+
}
293+
}
294+
}
295+
],
296+
"require": {
297+
"jquery/jquery.ui": "1.10.4"
298+
}
287299
}
288300
```
289301

0 commit comments

Comments
 (0)