Skip to content

Commit 94cb141

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 0d6a8ca + 75ae19f commit 94cb141

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# TextMU
2-
A small, Markdown inspired syntax for SpongeAPI
3-
_This is a library, not a standalone plugin!_
2+
A simple markup syntax for Sponge
3+
4+
[![](https://jitpack.io/v/dags-/TextMU.svg)](https://jitpack.io/#dags-/TextMU)
45

56
## Syntax
67
The syntax is similar to Markdown links:
@@ -24,5 +25,34 @@ Text actions are supported:
2425
- HoverText - any other string that does not match the above (can include the MU syntax)
2526
`[Mouse over me](this is a [hidden](italic) message!)`
2627

27-
## Example Code
28+
## Templates
29+
TextMU incorporates a simple string templating engine which it can render to text.
30+
You can read more about the template syntax and usage [here](https://github.com/dags-/Template/blob/master/README.md)
31+
32+
## Usage/Code Examples
33+
#### Dependency:
34+
```
35+
repositories {
36+
maven { url "https://jitpack.io" }
37+
}
38+
39+
dependencies {
40+
compile "com.github.dags-:TextMU:0.3.0"
41+
}
42+
```
43+
44+
#### Basic text rendering:
45+
```
46+
Text text = MUSpec.global().render("Hello [World](blue)");
47+
Sponge.getServer().getBroadcastChannel().send(text);
48+
```
49+
50+
#### Permission-based text rendering:
51+
```
52+
Text text = MUSpec.global().render(player, "Hello [World!](green)");
53+
Sponge.getServer().getBroadcastChannel().send(text);
54+
```
55+
_Here, the output text will only include colors/styles/actions that the player has permission to use_
56+
57+
#### Further examples
2858
See the [example plugin](https://github.com/dags-/TextMU/blob/master/src/test/java/ExamplePlugin.java)

0 commit comments

Comments
 (0)