Add README.md generator
This commit is contained in:
27
build.gradle
27
build.gradle
@@ -128,25 +128,26 @@ allprojects {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
task collectScreenshots {
|
task collectScreenshots {
|
||||||
doFirst {
|
doFirst {
|
||||||
def demoProjects = project.subprojects.findAll { it.sourceSets.hasProperty("demo") }
|
def demoProjects = project.subprojects.findAll { it.sourceSets.hasProperty("demo") }
|
||||||
|
|
||||||
for (sub in demoProjects) {
|
for (sub in demoProjects) {
|
||||||
if (sub.name == "orx-rabbit-control")
|
if (sub.name == "orx-rabbit-control")
|
||||||
continue
|
continue
|
||||||
if (sub.name == "orx-runway")
|
if (sub.name == "orx-runway")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
def set = sub.sourceSets.demo
|
def set = sub.sourceSets.demo
|
||||||
def ucl = new URLClassLoader(set.runtimeClasspath.collect { it.toURI().toURL() } as URL[])
|
def ucl = new URLClassLoader(set.runtimeClasspath.collect { it.toURI().toURL() } as URL[])
|
||||||
|
|
||||||
|
def runDemos = []
|
||||||
|
|
||||||
for (x in set.output) {
|
for (x in set.output) {
|
||||||
if (x.exists()) {
|
if (x.exists()) {
|
||||||
for (y in x.listFiles()) {
|
for (y in x.listFiles()) {
|
||||||
def name = y.name
|
def name = y.name
|
||||||
if (!name.contains('$') && name.contains(".class")) {
|
if (!name.contains('$') && name.contains(".class")) {
|
||||||
def klass = ucl.loadClass(y.name.replace(".class", ""))
|
def klassName = y.name.replace(".class", "")
|
||||||
|
def klass = ucl.loadClass(klassName)
|
||||||
try {
|
try {
|
||||||
def mainMethod = klass.getMethod("main")
|
def mainMethod = klass.getMethod("main")
|
||||||
javaexec {
|
javaexec {
|
||||||
@@ -158,6 +159,7 @@ task collectScreenshots {
|
|||||||
jvmArgs += "-Dorg.openrndr.exceptions=JVM"
|
jvmArgs += "-Dorg.openrndr.exceptions=JVM"
|
||||||
executable = "./build-tools/xvfb-java.sh"
|
executable = "./build-tools/xvfb-java.sh"
|
||||||
}
|
}
|
||||||
|
runDemos.add(klassName)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// skip?
|
// skip?
|
||||||
}
|
}
|
||||||
@@ -165,6 +167,23 @@ task collectScreenshots {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
runDemos = runDemos.sort()
|
||||||
|
def readme = sub.file("README.md")
|
||||||
|
if (readme.exists()) {
|
||||||
|
def lines = readme.readLines()
|
||||||
|
def screenshotsLine = lines.findIndexOf { it == "<!-- __demos__ -->" }
|
||||||
|
if (screenshotsLine != -1) {
|
||||||
|
lines = lines.subList(0, screenshotsLine)
|
||||||
|
}
|
||||||
|
lines.add("<!-- __demos__ -->")
|
||||||
|
lines.add("## Demos")
|
||||||
|
for (demo in runDemos) {
|
||||||
|
lines.add("[${demo}](src/demo/kotlin/${demo}.kt)")
|
||||||
|
lines.add("")
|
||||||
|
}
|
||||||
|
readme.delete()
|
||||||
|
readme.write(lines.join("\n"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ Using the `Easing` enumeration
|
|||||||
val et = Easing.QuadIn.function(t, 0.0, 1.0, 1.0)
|
val et = Easing.QuadIn.function(t, 0.0, 1.0, 1.0)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Demos
|
<!-- __demos__ -->
|
||||||
[DemoEasings01Kt](src/demo/kotlin/DemoEasings01.kt)
|
# Demos
|
||||||

|
[DemoEasings01Kt](src/demo/kotlin/DemoEasings01Kt.kt)
|
||||||
|

|
||||||
@@ -95,3 +95,11 @@ All distortion effects are opacity preserving
|
|||||||
- `FlipVertically` - flips the source input vertically.
|
- `FlipVertically` - flips the source input vertically.
|
||||||
|
|
||||||
|
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoFluidDistort01Kt](src/demo/kotlin/DemoFluidDistort01Kt.kt
|
||||||
|

|
||||||
|

|
||||||
@@ -161,3 +161,15 @@ import org.openrndr.extra.parameters.DoubleParameter
|
|||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
`orx-gui` is based on a proof-of-concept by [Ricardo Matias](https://github.com/ricardomatias/)
|
`orx-gui` is based on a proof-of-concept by [Ricardo Matias](https://github.com/ricardomatias/)
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoOptions01Kt](src/demo/kotlin/DemoOptions01Kt.kt
|
||||||
|

|
||||||
|

|
||||||
|
[DemoSimple01Kt](src/demo/kotlin/DemoSimple01Kt.kt)
|
||||||
|

|
||||||
@@ -133,3 +133,31 @@ Supported functions in expressions:
|
|||||||
|
|
||||||
[Parameters and prototypes](src/demo/resources/demo-full-01.json)
|
[Parameters and prototypes](src/demo/resources/demo-full-01.json)
|
||||||
|
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoFull01Kt](src/demo/kotlin/DemoFull01Kt.kt
|
||||||
|

|
||||||
|

|
||||||
|
[DemoScrub01Kt](src/demo/kotlin/DemoScrub01Kt.kt)
|
||||||
|

|
||||||
|
[DemoSimple01Kt](src/demo/kotlin/DemoSimple01Kt.kt)
|
||||||
|

|
||||||
|
[DemoSimple02Kt](src/demo/kotlin/DemoSimple02Kt.kt)
|
||||||
|

|
||||||
|
[DemoSimpleExpressions01Kt](src/demo/kotlin/DemoSimpleExpressions01Kt.kt)
|
||||||
|

|
||||||
|
[DemoSimpleRepetitions01Kt](src/demo/kotlin/DemoSimpleRepetitions01Kt.kt)
|
||||||
|

|
||||||
@@ -43,3 +43,31 @@ fun boxMesh(
|
|||||||
depthSegments: Int = 1,
|
depthSegments: Int = 1,
|
||||||
invert: Boolean = false): VertexBuffer
|
invert: Boolean = false): VertexBuffer
|
||||||
```
|
```
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoBoxKt](src/demo/kotlin/DemoBoxKt.kt
|
||||||
|

|
||||||
|

|
||||||
|
[DemoComplex01Kt](src/demo/kotlin/DemoComplex01Kt.kt)
|
||||||
|

|
||||||
|
[DemoComplex02Kt](src/demo/kotlin/DemoComplex02Kt.kt)
|
||||||
|

|
||||||
|
[DemoComplex03Kt](src/demo/kotlin/DemoComplex03Kt.kt)
|
||||||
|

|
||||||
|
[DemoComplex04Kt](src/demo/kotlin/DemoComplex04Kt.kt)
|
||||||
|

|
||||||
|
[DemoComplex05Kt](src/demo/kotlin/DemoComplex05Kt.kt)
|
||||||
|

|
||||||
@@ -159,3 +159,19 @@ val v6 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
|||||||
val v7 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
val v7 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
||||||
val v8 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
val v8 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
|
||||||
```
|
```
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoGradientPerturb2DKt](src/demo/kotlin/DemoGradientPerturb2DKt.kt
|
||||||
|

|
||||||
|

|
||||||
|
[DemoGradientPerturb3DKt](src/demo/kotlin/DemoGradientPerturb3DKt.kt)
|
||||||
|

|
||||||
|
[DemoPoissonDiskSamplingKt](src/demo/kotlin/DemoPoissonDiskSamplingKt.kt)
|
||||||
|

|
||||||
9
orx-shade-styles/README.md
Normal file
9
orx-shade-styles/README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# orx-shade-styles
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoRadialGradient01Kt](src/demo/kotlin/DemoRadialGradient01Kt.kt
|
||||||
|

|
||||||
|

|
||||||
@@ -40,3 +40,15 @@ drawer.circle(0.0, 0.0, size.sine(freq, phase))
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoEnvelopeKt](src/demo/kotlin/DemoEnvelopeKt.kt
|
||||||
|

|
||||||
|

|
||||||
|
[DemoLFOKt](src/demo/kotlin/DemoLFOKt.kt)
|
||||||
|

|
||||||
@@ -37,3 +37,19 @@ Note that drawing inside the `repeat` action has no effect. Have a look at the d
|
|||||||
* [Simple `repeat` demonstration](src/demo/kotlin/DemoRepeat01.kt)
|
* [Simple `repeat` demonstration](src/demo/kotlin/DemoRepeat01.kt)
|
||||||
* [A `repeat` demonstration with drawing](src/demo/kotlin/DemoRepeat02.kt)
|
* [A `repeat` demonstration with drawing](src/demo/kotlin/DemoRepeat02.kt)
|
||||||
* [Simple `timeOut` demonstration](src/demo/kotlin/DemoTimeOut01.kt)
|
* [Simple `timeOut` demonstration](src/demo/kotlin/DemoTimeOut01.kt)
|
||||||
|
<!-- __demos__ >
|
||||||
|
# Demos
|
||||||
|
[DemoRepeat01Kt](src/demo/kotlin/DemoRepeat01Kt.kt
|
||||||
|

|
||||||
|

|
||||||
|
[DemoRepeat02Kt](src/demo/kotlin/DemoRepeat02Kt.kt)
|
||||||
|

|
||||||
|
[DemoTimeOut01Kt](src/demo/kotlin/DemoTimeOut01Kt.kt)
|
||||||
|

|
||||||
Reference in New Issue
Block a user