Add README.md generator

This commit is contained in:
Edwin Jakobs
2020-04-27 16:10:03 +02:00
parent 493e95ce57
commit f38dc57521
10 changed files with 157 additions and 8 deletions

View File

@@ -128,25 +128,26 @@ allprojects {
}
task collectScreenshots {
doFirst {
def demoProjects = project.subprojects.findAll { it.sourceSets.hasProperty("demo") }
for (sub in demoProjects) {
if (sub.name == "orx-rabbit-control")
continue
if (sub.name == "orx-runway")
continue
def set = sub.sourceSets.demo
def ucl = new URLClassLoader(set.runtimeClasspath.collect { it.toURI().toURL() } as URL[])
def runDemos = []
for (x in set.output) {
if (x.exists()) {
for (y in x.listFiles()) {
def name = y.name
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 {
def mainMethod = klass.getMethod("main")
javaexec {
@@ -158,6 +159,7 @@ task collectScreenshots {
jvmArgs += "-Dorg.openrndr.exceptions=JVM"
executable = "./build-tools/xvfb-java.sh"
}
runDemos.add(klassName)
} catch (e) {
// 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("![${demo}](https://raw.githubusercontent.com/openrndr/orx/media/${sub.name}/images/${demo}.png)")
}
readme.delete()
readme.write(lines.join("\n"))
}
}
}
}

View File

@@ -30,6 +30,7 @@ Using the `Easing` enumeration
val et = Easing.QuadIn.function(t, 0.0, 1.0, 1.0)
```
## Demos
[DemoEasings01Kt](src/demo/kotlin/DemoEasings01.kt)
![Screenshot](images/DemoEasings01Kt.png)
<!-- __demos__ -->
# Demos
[DemoEasings01Kt](src/demo/kotlin/DemoEasings01Kt.kt)
![DemoEasings01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-easing/images/DemoEasings01Kt.png)

View File

@@ -95,3 +95,11 @@ All distortion effects are opacity preserving
- `FlipVertically` - flips the source input vertically.
<!-- __demos__ >
# Demos
[DemoFluidDistort01Kt](src/demo/kotlin/DemoFluidDistort01Kt.kt
![DemoFluidDistort01Kt](https://github.com/openrndr/orx/blob/media/orx-fx/images/DemoFluidDistort01Kt.png
<!-- __demos__ -->
# Demos
[DemoFluidDistort01Kt](src/demo/kotlin/DemoFluidDistort01Kt.kt)
![DemoFluidDistort01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-fx/images/DemoFluidDistort01Kt.png)

View File

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

View File

@@ -133,3 +133,31 @@ Supported functions in expressions:
[Parameters and prototypes](src/demo/resources/demo-full-01.json)
<!-- __demos__ >
# Demos
[DemoFull01Kt](src/demo/kotlin/DemoFull01Kt.kt
![DemoFull01Kt](https://github.com/openrndr/orx/blob/media/orx-keyframer/images/DemoFull01Kt.png
[DemoScrub01Kt](src/demo/kotlin/DemoScrub01Kt.kt
![DemoScrub01Kt](https://github.com/openrndr/orx/blob/media/orx-keyframer/images/DemoScrub01Kt.png
[DemoSimple01Kt](src/demo/kotlin/DemoSimple01Kt.kt
![DemoSimple01Kt](https://github.com/openrndr/orx/blob/media/orx-keyframer/images/DemoSimple01Kt.png
[DemoSimple02Kt](src/demo/kotlin/DemoSimple02Kt.kt
![DemoSimple02Kt](https://github.com/openrndr/orx/blob/media/orx-keyframer/images/DemoSimple02Kt.png
[DemoSimpleExpressions01Kt](src/demo/kotlin/DemoSimpleExpressions01Kt.kt
![DemoSimpleExpressions01Kt](https://github.com/openrndr/orx/blob/media/orx-keyframer/images/DemoSimpleExpressions01Kt.png
[DemoSimpleRepetitions01Kt](src/demo/kotlin/DemoSimpleRepetitions01Kt.kt
![DemoSimpleRepetitions01Kt](https://github.com/openrndr/orx/blob/media/orx-keyframer/images/DemoSimpleRepetitions01Kt.png
<!-- __demos__ -->
# Demos
[DemoFull01Kt](src/demo/kotlin/DemoFull01Kt.kt)
![DemoFull01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-keyframer/images/DemoFull01Kt.png)
[DemoScrub01Kt](src/demo/kotlin/DemoScrub01Kt.kt)
![DemoScrub01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-keyframer/images/DemoScrub01Kt.png)
[DemoSimple01Kt](src/demo/kotlin/DemoSimple01Kt.kt)
![DemoSimple01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-keyframer/images/DemoSimple01Kt.png)
[DemoSimple02Kt](src/demo/kotlin/DemoSimple02Kt.kt)
![DemoSimple02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-keyframer/images/DemoSimple02Kt.png)
[DemoSimpleExpressions01Kt](src/demo/kotlin/DemoSimpleExpressions01Kt.kt)
![DemoSimpleExpressions01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-keyframer/images/DemoSimpleExpressions01Kt.png)
[DemoSimpleRepetitions01Kt](src/demo/kotlin/DemoSimpleRepetitions01Kt.kt)
![DemoSimpleRepetitions01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-keyframer/images/DemoSimpleRepetitions01Kt.png)

View File

@@ -43,3 +43,31 @@ fun boxMesh(
depthSegments: Int = 1,
invert: Boolean = false): VertexBuffer
```
<!-- __demos__ >
# Demos
[DemoBoxKt](src/demo/kotlin/DemoBoxKt.kt
![DemoBoxKt](https://github.com/openrndr/orx/blob/media/orx-mesh-generators/images/DemoBoxKt.png
[DemoComplex01Kt](src/demo/kotlin/DemoComplex01Kt.kt
![DemoComplex01Kt](https://github.com/openrndr/orx/blob/media/orx-mesh-generators/images/DemoComplex01Kt.png
[DemoComplex02Kt](src/demo/kotlin/DemoComplex02Kt.kt
![DemoComplex02Kt](https://github.com/openrndr/orx/blob/media/orx-mesh-generators/images/DemoComplex02Kt.png
[DemoComplex03Kt](src/demo/kotlin/DemoComplex03Kt.kt
![DemoComplex03Kt](https://github.com/openrndr/orx/blob/media/orx-mesh-generators/images/DemoComplex03Kt.png
[DemoComplex04Kt](src/demo/kotlin/DemoComplex04Kt.kt
![DemoComplex04Kt](https://github.com/openrndr/orx/blob/media/orx-mesh-generators/images/DemoComplex04Kt.png
[DemoComplex05Kt](src/demo/kotlin/DemoComplex05Kt.kt
![DemoComplex05Kt](https://github.com/openrndr/orx/blob/media/orx-mesh-generators/images/DemoComplex05Kt.png
<!-- __demos__ -->
# Demos
[DemoBoxKt](src/demo/kotlin/DemoBoxKt.kt)
![DemoBoxKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoBoxKt.png)
[DemoComplex01Kt](src/demo/kotlin/DemoComplex01Kt.kt)
![DemoComplex01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex01Kt.png)
[DemoComplex02Kt](src/demo/kotlin/DemoComplex02Kt.kt)
![DemoComplex02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex02Kt.png)
[DemoComplex03Kt](src/demo/kotlin/DemoComplex03Kt.kt)
![DemoComplex03Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex03Kt.png)
[DemoComplex04Kt](src/demo/kotlin/DemoComplex04Kt.kt)
![DemoComplex04Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex04Kt.png)
[DemoComplex05Kt](src/demo/kotlin/DemoComplex05Kt.kt)
![DemoComplex05Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-mesh-generators/images/DemoComplex05Kt.png)

View File

@@ -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 v8 = billow(seed, x, y, z, ::perlinLinear, octaves, lacunarity, gain)
```
<!-- __demos__ >
# Demos
[DemoGradientPerturb2DKt](src/demo/kotlin/DemoGradientPerturb2DKt.kt
![DemoGradientPerturb2DKt](https://github.com/openrndr/orx/blob/media/orx-noise/images/DemoGradientPerturb2DKt.png
[DemoGradientPerturb3DKt](src/demo/kotlin/DemoGradientPerturb3DKt.kt
![DemoGradientPerturb3DKt](https://github.com/openrndr/orx/blob/media/orx-noise/images/DemoGradientPerturb3DKt.png
[DemoPoissonDiskSamplingKt](src/demo/kotlin/DemoPoissonDiskSamplingKt.kt
![DemoPoissonDiskSamplingKt](https://github.com/openrndr/orx/blob/media/orx-noise/images/DemoPoissonDiskSamplingKt.png
<!-- __demos__ -->
# Demos
[DemoGradientPerturb2DKt](src/demo/kotlin/DemoGradientPerturb2DKt.kt)
![DemoGradientPerturb2DKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoGradientPerturb2DKt.png)
[DemoGradientPerturb3DKt](src/demo/kotlin/DemoGradientPerturb3DKt.kt)
![DemoGradientPerturb3DKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoGradientPerturb3DKt.png)
[DemoPoissonDiskSamplingKt](src/demo/kotlin/DemoPoissonDiskSamplingKt.kt)
![DemoPoissonDiskSamplingKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-noise/images/DemoPoissonDiskSamplingKt.png)

View File

@@ -0,0 +1,9 @@
# orx-shade-styles
<!-- __demos__ >
# Demos
[DemoRadialGradient01Kt](src/demo/kotlin/DemoRadialGradient01Kt.kt
![DemoRadialGradient01Kt](https://github.com/openrndr/orx/blob/media/orx-shade-styles/images/DemoRadialGradient01Kt.png
<!-- __demos__ -->
# Demos
[DemoRadialGradient01Kt](src/demo/kotlin/DemoRadialGradient01Kt.kt)
![DemoRadialGradient01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-shade-styles/images/DemoRadialGradient01Kt.png)

View File

@@ -40,3 +40,15 @@ drawer.circle(0.0, 0.0, size.sine(freq, phase))
```
<!-- __demos__ >
# Demos
[DemoEnvelopeKt](src/demo/kotlin/DemoEnvelopeKt.kt
![DemoEnvelopeKt](https://github.com/openrndr/orx/blob/media/orx-time-operators/images/DemoEnvelopeKt.png
[DemoLFOKt](src/demo/kotlin/DemoLFOKt.kt
![DemoLFOKt](https://github.com/openrndr/orx/blob/media/orx-time-operators/images/DemoLFOKt.png
<!-- __demos__ -->
# Demos
[DemoEnvelopeKt](src/demo/kotlin/DemoEnvelopeKt.kt)
![DemoEnvelopeKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-time-operators/images/DemoEnvelopeKt.png)
[DemoLFOKt](src/demo/kotlin/DemoLFOKt.kt)
![DemoLFOKt](https://raw.githubusercontent.com/openrndr/orx/media/orx-time-operators/images/DemoLFOKt.png)

View File

@@ -36,4 +36,20 @@ Note that drawing inside the `repeat` action has no effect. Have a look at the d
* [Simple `repeat` demonstration](src/demo/kotlin/DemoRepeat01.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
![DemoRepeat01Kt](https://github.com/openrndr/orx/blob/media/orx-timer/images/DemoRepeat01Kt.png
[DemoRepeat02Kt](src/demo/kotlin/DemoRepeat02Kt.kt
![DemoRepeat02Kt](https://github.com/openrndr/orx/blob/media/orx-timer/images/DemoRepeat02Kt.png
[DemoTimeOut01Kt](src/demo/kotlin/DemoTimeOut01Kt.kt
![DemoTimeOut01Kt](https://github.com/openrndr/orx/blob/media/orx-timer/images/DemoTimeOut01Kt.png
<!-- __demos__ -->
# Demos
[DemoRepeat01Kt](src/demo/kotlin/DemoRepeat01Kt.kt)
![DemoRepeat01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat01Kt.png)
[DemoRepeat02Kt](src/demo/kotlin/DemoRepeat02Kt.kt)
![DemoRepeat02Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoRepeat02Kt.png)
[DemoTimeOut01Kt](src/demo/kotlin/DemoTimeOut01Kt.kt)
![DemoTimeOut01Kt](https://raw.githubusercontent.com/openrndr/orx/media/orx-timer/images/DemoTimeOut01Kt.png)