Skip to content

Commit 51fcd43

Browse files
authored
Improved formatting of markdown
1 parent 43b5821 commit 51fcd43

File tree

1 file changed

+55
-31
lines changed

1 file changed

+55
-31
lines changed

README.md

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ For Java, Cloudinary provides a library for simplifying the integration even fur
2525

2626
The cloudinary_java library is available in [Maven Central](https://repo1.maven.org/maven2/com/cloudinary/). To use it, add the following dependency to your pom.xml :
2727

28-
<dependency>
29-
<groupId>com.cloudinary</groupId>
30-
<artifactId>cloudinary-http44</artifactId>
31-
<version>1.12.0</version>
32-
</dependency>
28+
```xml
29+
<dependency>
30+
<groupId>com.cloudinary</groupId>
31+
<artifactId>cloudinary-http44</artifactId>
32+
<version>1.12.0</version>
33+
</dependency>
34+
```
35+
3336

3437
Alternatively, download cloudinary_java from [here](https://repo1.maven.org/maven2/com/cloudinary/cloudinary-core/1.12.0/cloudinary-core-1.12.0.jar) and [here](https://repo1.maven.org/maven2/com/cloudinary/cloudinary-http44/1.12.0/cloudinary-http44-1.12.0.jar)
3538
and see [pom.xml](https://github.com/cloudinary/cloudinary_java/blob/master/cloudinary-http44/pom.xml) for library dependencies.
@@ -80,16 +83,19 @@ Setting the `cloud_name`, `api_key` and `api_secret` parameters can be done eith
8083
by when initializing the Cloudinary object, or by using the CLOUDINARY_URL environment variable / system property.
8184

8285
The entry point of the library is the Cloudinary object.
83-
84-
Cloudinary cloudinary = new Cloudinary();
86+
```java
87+
Cloudinary cloudinary = new Cloudinary();
88+
```
8589

8690
Here's an example of setting the configuration parameters programatically:
8791

88-
Map config = new HashMap();
89-
config.put("cloud_name", "n07t21i7");
90-
config.put("api_key", "123456789012345");
91-
config.put("api_secret", "abcdeghijklmnopqrstuvwxyz12");
92-
Cloudinary cloudinary = new Cloudinary(config);
92+
```java
93+
Map config = new HashMap();
94+
config.put("cloud_name", "n07t21i7");
95+
config.put("api_key", "123456789012345");
96+
config.put("api_secret", "abcdeghijklmnopqrstuvwxyz12");
97+
Cloudinary cloudinary = new Cloudinary(config);
98+
```
9399

94100
Another example of setting the configuration parameters by providing the CLOUDINARY_URL value to the constructor:
95101

@@ -101,21 +107,29 @@ Any image uploaded to Cloudinary can be transformed and embedded using powerful
101107

102108
The following example generates the url for accessing an uploaded `sample` image while transforming it to fill a 100x150 rectangle:
103109

104-
cloudinary.url().transformation(new Transformation().width(100).height(150).crop("fill")).generate("sample.jpg");
110+
```java
111+
cloudinary.url().transformation(new Transformation().width(100).height(150).crop("fill")).generate("sample.jpg");
112+
```
105113

106114
Another example, emedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:
107115

108-
cloudinary.url().transformation(new Transformation().width(90).height(90).crop("thumb").gravity("face")).generate("woman.jpg");
116+
```java
117+
cloudinary.url().transformation(new Transformation().width(90).height(90).crop("thumb").gravity("face")).generate("woman.jpg");
118+
```
109119

110120
You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.
111121

112122
Embedding a Facebook profile to match your graphic design is very simple:
113123

114-
cloudinary.url().type("facebook").transformation(new Transformation().width(130).height(130).crop("fill").gravity("north_west")).generate("billclinton.jpg");
115-
124+
```java
125+
cloudinary.url().type("facebook").transformation(new Transformation().width(130).height(130).crop("fill").gravity("north_west")).generate("billclinton.jpg");
126+
```
127+
116128
Same goes for Twitter:
117129

118-
cloudinary.url().type("twitter_name").generate("billclinton.jpg");
130+
```java
131+
cloudinary.url().type("twitter_name").generate("billclinton.jpg");
132+
```
119133

120134
![](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **See [our documentation](http://cloudinary.com/documentation/java_image_manipulation) for more information about displaying and transforming images in Java**.
121135

@@ -124,22 +138,28 @@ Same goes for Twitter:
124138
Assuming you have your Cloudinary configuration parameters defined (`cloud_name`, `api_key`, `api_secret`), uploading to Cloudinary is very simple.
125139

126140
The following example uploads a local JPG to the cloud:
127-
128-
cloudinary.uploader().upload("my_picture.jpg", ObjectUtils.emptyMap());
141+
142+
```java
143+
cloudinary.uploader().upload("my_picture.jpg", ObjectUtils.emptyMap());
144+
```
129145
130146
The uploaded image is assigned a randomly generated public ID. The image is immediately available for download through a CDN:
131147

132-
cloudinary.url().generate("abcfrmo8zul1mafopawefg.jpg");
133-
134-
# http://res.cloudinary.com/demo/image/upload/abcfrmo8zul1mafopawefg.jpg
148+
```java
149+
cloudinary.url().generate("abcfrmo8zul1mafopawefg.jpg");
150+
151+
# http://res.cloudinary.com/demo/image/upload/abcfrmo8zul1mafopawefg.jpg
152+
```
135153

136154
You can also specify your own public ID:
137-
138-
cloudinary.uploader().upload("http://www.example.com/image.jpg", ObjectUtils.asMap("public_id", "sample_remote"));
139155

140-
cloudinary.url().generate("sample_remote.jpg");
156+
```java
157+
cloudinary.uploader().upload("http://www.example.com/image.jpg", ObjectUtils.asMap("public_id", "sample_remote"));
158+
159+
cloudinary.url().generate("sample_remote.jpg");
141160

142-
# http://res.cloudinary.com/demo/image/upload/sample_remote.jpg
161+
# http://res.cloudinary.com/demo/image/upload/sample_remote.jpg
162+
```
143163

144164
![](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **See [our documentation](http://cloudinary.com/documentation/java_image_upload) for plenty more options of uploading to the cloud from your Java code**.
145165

@@ -149,19 +169,23 @@ Returns an html image tag pointing to Cloudinary.
149169

150170
Usage:
151171

152-
cloudinary.url().format("png").transformation(new Transformation().width(100).height(100).crop("fill")).imageTag("sample");
172+
```java
173+
cloudinary.url().format("png").transformation(new Transformation().width(100).height(100).crop("fill")).imageTag("sample");
153174

154-
# <img src='http://res.cloudinary.com/cloud_name/image/upload/c_fill,h_100,w_100/sample.png' height='100' width='100'/>
175+
# <img src='http://res.cloudinary.com/cloud_name/image/upload/c_fill,h_100,w_100/sample.png' height='100' width='100'/>
176+
```
155177

156178
### imageUploadTag
157179

158180
Returns an html input field for direct image upload, to be used in conjunction with [cloudinary\_js package](https://github.com/cloudinary/cloudinary_js/). It integrates [jQuery-File-Upload widget](https://github.com/blueimp/jQuery-File-Upload) and provides all the necessary parameters for a direct upload.
159181

160182
Usage:
161183

162-
Map options = ObjectUtils.asMap("resource_type", "auto");
163-
Map htmlOptions = ObjectUtils.asMap("alt", "sample");
164-
String html = cloudinary.uploader().imageUploadTag("image_id", options, htmlOptions);
184+
```java
185+
Map options = ObjectUtils.asMap("resource_type", "auto");
186+
Map htmlOptions = ObjectUtils.asMap("alt", "sample");
187+
String html = cloudinary.uploader().imageUploadTag("image_id", options, htmlOptions);
188+
```
165189

166190
![](http://res.cloudinary.com/cloudinary/image/upload/see_more_bullet.png) **See [our documentation](http://cloudinary.com/documentation/java_image_upload#direct_uploading_from_the_browser) for plenty more options of uploading directly from the browser**.
167191

0 commit comments

Comments
 (0)