Skip to content

Commit

Permalink
Subsume CodeTaylor's documentation system.
Browse files Browse the repository at this point in the history
  • Loading branch information
noobanidus committed Jul 27, 2019
1 parent 107bb4e commit a761721
Show file tree
Hide file tree
Showing 9 changed files with 438 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ Nether Chest code for extended slot sizes used with permission by the author, Ma
Ender Core code for range particles used with permission (from two contributors) but also with license compatibility (EnderCore & Ender IO are both Public Domain):

- [EnderCore](https://github.com/SleepyTrousers/EnderCore)
- [EnderIO](https://github.com/SleepyTrousers/EnderIO/)
- [EnderIO](https://github.com/SleepyTrousers/EnderIO/)

# CodeTaylor's ZenScript Documentation

Used with compatible Apache License and permission from CodeTaylor.
31 changes: 31 additions & 0 deletions src/main/java/com/aranaira/arcanearchives/ExportDocumentation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.aranaira.arcanearchives;

import com.aranaira.arcanearchives.integration.crafttweaker.GCTTweaker;
import epicsquid.roots.util.zen.ZenDocExporter;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class ExportDocumentation {

public static void main (String[] args) {

String targetPath = "docs/zs/";
Class[] classes = {
GCTTweaker.class
};

ZenDocExporter export = new ZenDocExporter();
Path path = Paths.get(targetPath);

try {
Files.createDirectories(path);
export.export(path, classes);

} catch (IOException e) {
e.printStackTrace();
}
}
}
37 changes: 37 additions & 0 deletions src/main/java/com/aranaira/arcanearchives/util/StringHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package epicsquid.roots.util;

// Copied with permission from Athenaeum by CodeTaylor, Apache License
// https://github.com/codetaylor/athenaeum/blob/master/src/main/java/com/codetaylor/mc/athenaeum/util/StringHelper.java

public class StringHelper {

public static String capitalizeFirstLetter(String input) {

return input.substring(0, 1).toUpperCase() + input.substring(1);
}

public static String lowercaseFirstLetter(String input) {

return input.substring(0, 1).toLowerCase() + input.substring(1);
}

public static String ticksToHMS(int ticks) {

int totalSecs = ticks / 20;
int hours = totalSecs / 3600;
int minutes = (totalSecs % 3600) / 60;
int seconds = totalSecs % 60;

if (hours > 0) {
return String.format("%02d:%02d:%02d", hours, minutes, seconds);

} else {
return String.format("%02d:%02d", minutes, seconds);
}
}

private StringHelper() {
//
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.aranaira.arcanearchives.util.zen;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

// This file and all others in this directory taken from Athenaeeum by CodeTaylor
// Licensed with the Apache License and used with permission
// https://github.com/codetaylor/athenaeum/tree/master/src/main/java/com/codetaylor/mc/athenaeum/tools

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface ZenDocAppend {

String[] value ();
}
16 changes: 16 additions & 0 deletions src/main/java/com/aranaira/arcanearchives/util/zen/ZenDocArg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.aranaira.arcanearchives.util.zen;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ZenDocArg {

String arg ();

String info () default "";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.aranaira.arcanearchives.util.zen;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface ZenDocClass {

String value ();

String[] description () default {};
}
Loading

0 comments on commit a761721

Please sign in to comment.