Simplify adding events to TikTok Builder,

checkout `EventsBuilder`
This commit is contained in:
jacek.wolniewicz
2024-07-01 21:25:30 +02:00
parent a2082ebee3
commit 046d5f1756
7 changed files with 216 additions and 389 deletions

View File

@@ -0,0 +1,12 @@
package io.github.jwdeveloper.tiktok;
import io.github.jwdeveloper.descrabble.api.DescriptionDecorator;
import io.github.jwdeveloper.descrabble.api.elements.Element;
import io.github.jwdeveloper.descrabble.api.elements.ElementFactory;
public class EventsDecorator implements DescriptionDecorator {
@Override
public void decorate(Element root, ElementFactory factory) {
}
}

View File

@@ -0,0 +1,37 @@
package io.github.jwdeveloper.tiktok;
import io.github.jwdeveloper.descrabble.api.DescriptionGenerator;
import io.github.jwdeveloper.descrabble.framework.Descrabble;
import io.github.jwdeveloper.descrabble.plugin.github.DescrabbleGithub;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
public class Main
{
public static void main(String[] args) throws IOException {
var version = System.getenv("VERSION");
if (version == null || version.equals("")) {
version = "[Replace with current version]";
}
var inputStream = Main.class.getResourceAsStream("/readme-template.html");
var targetFile = new File("temp.file");
FileUtils.copyInputStreamToFile(inputStream, targetFile);
var output = System.getProperty("user.dir");
DescriptionGenerator generator = Descrabble.create()
.withTemplate(targetFile)
.withVariable("version", version)
.withDecorator(new EventsDecorator())
.withPlugin(DescrabbleGithub.plugin("README.md"))
.build();
generator.generate(output);
targetFile.delete();
inputStream.close();
}
}

View File

@@ -51,10 +51,6 @@ public class ReadmeGenerator {
return version == null ? "NOT_FOUND" : version;
}
public String getCodeExample(String path) {
var content = FilesUtility.loadFileContent(path);
content = content.substring(content.indexOf("*/") + 2);
return content;
}
}

View File

@@ -0,0 +1,66 @@
<container>
<image width="15%"
image="https://raw.githubusercontent.com/jwdeveloper/DepenDance/master/Tools-Readme/src/main/resources/logo.svg">
</image>
</container>
<container>
<title>TikTok Live Java</title>
<br>
<i align="center">*❤️❤️🎁 *Connect to TikTok live in 3 lines* 🎁❤️❤️*</i>
<br>
<container>
<image width="20%" image="https://jitpack.io/v/jwdeveloper/DepenDance.svg"
open="https://jitpack.io/#jwdeveloper/DepenDance"></image>
<image image="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
open="https://discord.gg/2hu6fPPeF7"></image>
<image image="https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white"></image>
</container>
</container>
<br>
<code language="xml">
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.jwdeveloper.TikTok-Live-Java</groupId>
<artifactId>Client</artifactId>
<version>{{version}}</version>
<scope>compile</scope>
</dependency>
</code>
<br>
<text>Lightweight dependency injection container that is both small and performance efficient</text>
<title>Features</title>
<br>
<text>- [x] Injecting object via constructor</text>
<br>
<text>- [x] Method object providers</text>
<br>
<text>- [x] Class Scanner to avoid manual registration [Scanner](#autoscan)</text>
<br>
<text>- [x] You need to get [List of objects](#lists) in the constructor, no problem</text>
<br>
<text>- [x] Create [object instance](#object-instances) by yourself and register it to container!</text>
<br>
<text>- [x] Object lifetimes [SINGLETON, TRANSIENT] [see](#basic)</text>
<br>
<text>- [x] [Generic types](#generic-types)</text>
<br>
<text>- [x] [Many constructors](#manyconstructors)</text>
<br>
<text>- [x] Highly customizable, adjust container with build in [events](#events) system</text>
<br>
<title>Tutorial</title>