From c184ed05ffcf96005811cd09a6b35b29b130968e Mon Sep 17 00:00:00 2001 From: vardy Date: Thu, 22 Nov 2018 20:40:55 +0800 Subject: [PATCH 1/2] Added Java code syntax highlighting to examples in README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 13a9b24..0ae09c4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Fast examples Read paste content --- -``` +```java final PastebinFactory factory = new PastebinFactory(); final Pastebin pastebin = factory.createPastebin(DEV_KEY); final String pasteKey = "LAZD9ZCs"; @@ -26,7 +26,7 @@ System.out.println(pasteResponse.get()); Read trending pastes --- -``` +```java final PastebinFactory factory = new PastebinFactory(); final Pastebin pastebin = factory.createPastebin(DEV_KEY); final Response pasteResponse = pastebin.getTrendingPastes(); @@ -56,7 +56,7 @@ Using `Pastebin` class you can get informations from Pastebin. You can create a Pastebin object using `PastebinFactory` which will be useful to create a `Paste` object too. -``` +```java final PastebinFactory factory = new PastebinFactory(); final Pastebin pastebin = factory.createPastebin(DEV_KEY); ``` @@ -74,7 +74,7 @@ if your request has been completed with success or not. To post a Paste you will use the `PastebinFactory` to let it create a `PasteBuilder` object for you. You will use this Builder to insert Paste information -``` +```java // get a pastebuilder to build the paste I want to publish final PasteBuilder pasteBuilder = factory.createPaste(); @@ -98,13 +98,13 @@ using the syntax `text`, visibility `Public` and it will expire in ten minutes. Our `Paste` is ready. -``` +```java final Paste paste = pasteBuilder.build(); ``` using `.build()` method we create the `Paste` object which will be passed to `pastebin.post` to post it. -``` +```java final Response postResult = pastebin.post(paste); if (postResult.hasError()) { From af7be99c4e5798470d0e4b73b8499cc3817a75dd Mon Sep 17 00:00:00 2001 From: vardy Date: Thu, 22 Nov 2018 23:17:49 +0800 Subject: [PATCH 2/2] Added instructions on how to add this library to your project as a dependency through Maven and Gradle via Jitpack. This is untested, but should work fine assuming the latest release of this library is functional. --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 0ae09c4..a6d52a9 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,44 @@ for(Paste paste : pastes) { } ``` +Add to your project +== + +*Note: Replace 'VERSION' with the latest version in the 'Releases' tab. Example:* `v0.2.1` + +**Maven:** + +```xml + + + jitpack.io + https://jitpack.io + + + + + com.github.marcoacierno + pastebin-java-api + VERSION + +``` + +**Gradle:** + +```gradle +allprojects { + repositories { + ... + maven { url 'https://jitpack.io' } + } +} + +dependencies { + implementation 'com.github.marcoacierno:pastebin-java-api:VERSION' +} +``` + + Getting started ==