Skip to content

Commit b9ad777

Browse files
committed
#1: Fix docs issues with formatting and links
1 parent f727b60 commit b9ad777

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

readme.md

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ Get the latest version [here](https://github.com/dgroup/term4j/releases):
3737

3838
Java version required: 1.8+.
3939

40-
Interface | Purpose | Implementations
41-
----------------|-----------------------------------------------------------------------|-------------------------------------------------
42-
[Arg\<T>]() | Allows to fetch the application arguments | [StringOf](), [NumberOf](), [PathOf](), [FileOf](), [EnvOf](), [PropOf](), [Alt](), [Unchecked](), [etc]() |
43-
[Std]() | Wrap the raw manipulation with `std out` | [StdOf](), [Inmem](), [etc]()
44-
[Highlighted]() | The colored extension of [Text](https://goo.gl/2ZYC83) for `std out` | [Green](), [Red](), [Yellow](), [etc]()
45-
[Runtime]() | Wrap the raw manipulation with JVM runtime | [RuntimeOf](), [FakeRuntime]()
40+
Interface | Purpose | Implementations / Related
41+
----------------------------|-----------------------------------------------------------------------|-------------------------------------------------
42+
[Arg\<T>](#argt) | Allows to fetch the application arguments | [StringOf](#stringof--textof), [NumberOf](#numberof), [PathOf](), [FileOf](), [EnvOf](#envof), [PropOf](#propof), [Alt](#alt), [Unchecked](), [etc](src/main/java/io/github/dgroup/term4j/arg/) |
43+
[Std](#std) | Wrap the raw manipulation with `std out` | [StdOf](#stdof), [Inmem](), [etc](src/main/java/io/github/dgroup/term4j/std)
44+
[Highlighted](#highlighted) | The colored extension of [Text](https://goo.gl/2ZYC83) for `std out` | [Green](src/main/java/io/github/dgroup/term4j/highlighted/Green.java), [Red](src/main/java/io/github/dgroup/term4j/highlighted/Red.java), [Yellow](src/main/java/io/github/dgroup/term4j/highlighted/Yellow.java), [etc](src/main/java/io/github/dgroup/term4j/highlighted)
45+
[Runtime](#runtimeof) | Wrap the raw manipulation with JVM runtime | [RuntimeOf](src/main/java/io/github/dgroup/term4j/runtime/RuntimeOf.java), [FakeRuntime](src/main/java/io/github/dgroup/term4j/runtime/FakeRuntime.java), [AppException](src/main/java/io/github/dgroup/term4j/AppException.java), [etc](src/main/java/io/github/dgroup/term4j/runtime)
4646

4747
All examples below are using the following frameworks/libs:
4848
- [Hamcrest](https://github.com/hamcrest/JavaHamcrest) - Library of matchers, which can be combined in to create flexible expressions of intent in tests.
4949
- [cactoos](https://github.com/yegor256/cactoos) - Object-Oriented Java primitives, as an alternative to Google Guava and Apache Commons.
5050
- [cactoos-matchers](https://github.com/yegor256/cactoos) - Object-Oriented Hamcrest matchers
5151

52-
### [Arg\<T>](./src/main/java/io/github/dgroup/term4j/Arg.java)
53-
#### [StringOf](./src/main/java/io/github/dgroup/term4j/arg/StringOf.java) / [TextOf](./src/main/java/io/github/dgroup/term4j/arg/TextOf.java)
54-
Fetch the string/[Text](https://github.com/yegor256/cactoos/blob/master/src/main/java/org/cactoos/Text.java) argument:
52+
### [Arg\<T>](src/main/java/io/github/dgroup/term4j/Arg.java)
53+
#### [StringOf](src/main/java/io/github/dgroup/term4j/arg/StringOf.java) / [TextOf](src/main/java/io/github/dgroup/term4j/arg/TextOf.java)
54+
Fetch the string/[Text](https://goo.gl/2ZYC83) argument:
5555
```bash
5656
$ java -jar app.jar --key vOIkv7mzQV2UkV1
5757
```
@@ -67,7 +67,7 @@ public static void main(String[] cargs) {
6767
final Arg<String> key = new StringOf("--key", args);
6868
}
6969
```
70-
#### [NumberOf]()
70+
#### [NumberOf](src/main/java/io/github/dgroup/term4j/arg/NumberOf.java)
7171
Fetch the numeric argument:
7272
```bash
7373
$ java -jar app.jar -t 10
@@ -84,7 +84,7 @@ public static void main(String[] cargs) throws ArgNotFoundException {
8484
final int threads = new NumberOf("-t", args).toInt();
8585
}
8686
```
87-
#### [PathOf]() / [FileOf]()
87+
#### [PathOf](src/main/java/io/github/dgroup/term4j/arg/PathOf.java) / [FileOf](src/main/java/io/github/dgroup/term4j/arg/FileOf.java)
8888
Fetch the argument as a `java.nio.file.Path` or `java.io.File`:
8989
```bash
9090
$ java -jar app.jar -f ./readme.md
@@ -101,7 +101,7 @@ public static void main(String[] cargs) throws ArgNotFoundException {
101101
final Arg<Path> src = new PathOf("-f", args);
102102
}
103103
```
104-
#### [EnvOf]()
104+
#### [EnvOf](src/main/java/io/github/dgroup/term4j/arg/EnvOf.java)
105105
Fetch the environment variable:
106106
```bash
107107
$ echo $JAVA_HOME
@@ -119,7 +119,7 @@ public static void main(String[] cargs) throws ArgNotFoundException {
119119
final Arg<String> jhome = new EnvOf("JAVA_HOME");
120120
}
121121
```
122-
#### [PropOf]()
122+
#### [PropOf](src/main/java/io/github/dgroup/term4j/arg/PropOf.java)
123123
Fetch the application property:
124124
```bash
125125
$ java -Dlevel=debug -jar app.jar
@@ -136,7 +136,7 @@ public static void main(String[] cargs) throws ArgNotFoundException {
136136
final Arg<String> verbose = new PropOf("level");
137137
}
138138
```
139-
#### [Alt]()
139+
#### [Alt](src/main/java/io/github/dgroup/term4j/arg/Alt.java)
140140
The alternative value in case if the argument wasn't specified:
141141
```bash
142142
$ java -jar app.jar
@@ -158,8 +158,8 @@ public static void main(String[] cargs) {
158158
);
159159
}
160160
```
161-
### [Std]()
162-
#### [StdOf]()
161+
### [Std](src/main/java/io/github/dgroup/term4j/Std.java)
162+
#### [StdOf](src/main/java/io/github/dgroup/term4j/std/StdOf.java)
163163
Wrap the std out, for example for unit testing purposes:
164164
```java
165165
/**
@@ -190,5 +190,19 @@ public static void main(String[] cargs) {
190190
);
191191
}
192192
```
193+
<img src=".docs/highlighted-red-green.png" height=40% width=40% alt='Colored message'/>
193194

194-
<img src=".docs/highlighted-red-green.png" height=25px width=80px alt='Colored message'/>
195+
See [more](src/main/java/io/github/dgroup/term4j/highlighted/).
196+
### RuntimeOf
197+
Exit from application using particular exit code:
198+
```java
199+
public static void main(String[] cargs) {
200+
try {
201+
// application exception happens
202+
} catch (final AppException cause) {
203+
new RuntimeOf().shutdownWith(
204+
cause.exitCode()
205+
);
206+
}
207+
}
208+
```

src/main/java/io/github/dgroup/term4j/runtime/Fake.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* Fake implementation of {@link Runtime} for unit-testing purposes.
3030
*
3131
* @since 0.1.0
32+
* @todo #/DEV Rename fakes considering type
3233
*/
3334
public final class Fake implements Runtime {
3435

0 commit comments

Comments
 (0)