Skip to content

Commit ba55936

Browse files
committed
Auto/sync of docs/md/readme and public site
* plus minor updates/changes
1 parent d97e4fd commit ba55936

103 files changed

Lines changed: 3087 additions & 580 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1140 additions & 260 deletions
Large diffs are not rendered by default.

gh-pages.ant

Lines changed: 131 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<project default="gh-pages">
1+
<project default="gh-pages" xmlns="antlib:org.apache.tools.ant" xmlns:if="ant:if" xmlns:unless="ant:unless">
22

33
<!--
44
DON'T run this file in order to push gh-pages. Instead run:
5-
mvn site -N -P gh-pages
5+
mvn clean javadoc:javadoc -P gh-pages
6+
mvn antrun:run -N -P gh-pages
67
Javadoc will be generated and sync for sure
78
-->
89
<target name="gh-pages">
@@ -21,11 +22,7 @@
2122
<arg value="." />
2223
</exec>
2324

24-
<echo file="${workdir}/index.md" message="---&#13;&#10;layout: index&#13;&#10;---&#13;&#10;&#13;&#10;" />
25-
26-
<concat destfile="${workdir}/index.md" append="true">
27-
<fileset file="README.md" />
28-
</concat>
25+
<antcall target="md.generator" />
2926

3027
<delete dir="${workdir}/apidocs" failonerror="false" />
3128

@@ -35,9 +32,16 @@
3532
<fileset dir="target/site/apidocs" />
3633
</copy>
3734

35+
<!-- move README.md -->
36+
<move file="${workdir}/README.md" tofile="README.md" overwrite="true" />
37+
38+
<!-- Override javadoc stylesheet -->
39+
<copy file="${workdir}/stylesheets/apidoc.css" tofile="${workdir}/apidocs/stylesheet.css" overwrite="true" />
40+
41+
<!-- -->
3842
<exec executable="git" dir="${workdir}">
3943
<arg value="add" />
40-
<arg value="--all" />
44+
<arg value="-A" />
4145
</exec>
4246

4347
<exec executable="git" dir="${workdir}">
@@ -53,4 +57,123 @@
5357
</exec>
5458

5559
</target>
60+
61+
<target name="md.generator">
62+
<!-- / -->
63+
<antcall target="md.processor">
64+
<param name="inputmd" value="README.md" />
65+
</antcall>
66+
67+
<!-- /quickstart -->
68+
<antcall target="md.processor">
69+
<param name="inputmd" value="quickstart/index.md" />
70+
</antcall>
71+
72+
<!-- /doc -->
73+
<antcall target="md.processor">
74+
<param name="inputmd" value="doc/index.md" />
75+
</antcall>
76+
77+
<!-- /faq -->
78+
<antcall target="md.processor">
79+
<param name="inputmd" value="faq/index.md" />
80+
</antcall>
81+
82+
<!-- /modules -->
83+
<antcall target="md.processor">
84+
<param name="inputmd" value="modules/index.md" />
85+
</antcall>
86+
</target>
87+
88+
<!--
89+
Replace expressions like {{file.md}} from an input file. The expression: {{file.md}} is replaced
90+
by the content of the file.md, so file.md must exists.
91+
92+
A table of content (toc) is generated too using the content of the generated file.
93+
94+
@param inputmd The file to process
95+
-->
96+
<target name="md.processor">
97+
98+
<antcall target="md.merger">
99+
<param name="inputmd" value="${inputmd}" />
100+
</antcall>
101+
102+
<script language="javascript" src="md/toc.js" />
103+
</target>
104+
105+
<!--
106+
Replace expressions like {{file.md}} from an input file. The expression: {{file.md}} is replaced
107+
by the content of the file.md, so file.md must exists.
108+
109+
@param inputmd The file to process
110+
-->
111+
<target name="md.merger">
112+
<macrodef name="iterate">
113+
<attribute name="list" />
114+
<element name="call" implicit="yes" />
115+
<sequential>
116+
<local name="md" />
117+
<local name="md.value" />
118+
<local name="tail" />
119+
<local name="hasMoreElements" />
120+
121+
<!-- unless to not get a error on empty lists -->
122+
<loadresource property="md" unless:blank="@{list}">
123+
<concat>@{list}</concat>
124+
<filterchain>
125+
<replaceregex pattern="([^;]*).*" replace="\1" />
126+
</filterchain>
127+
</loadresource>
128+
129+
<loadfile property="md.value" srcfile="target/md/${md}" />
130+
131+
<!-- recursion -->
132+
<condition property="hasMoreElements">
133+
<contains string="@{list}" substring=";" />
134+
</condition>
135+
136+
<loadresource property="tail" if:true="${hasMoreElements}">
137+
<concat>@{list}</concat>
138+
<filterchain>
139+
<replaceregex pattern="[^;]*;(.*)" replace="\1" />
140+
</filterchain>
141+
</loadresource>
142+
143+
<call />
144+
145+
<sequential if:true="${hasMoreElements}">
146+
<iterate list="${tail}">
147+
<call />
148+
</iterate>
149+
</sequential>
150+
</sequential>
151+
</macrodef>
152+
153+
<copy todir="target/md">
154+
<fileset dir="md">
155+
<include name="**/*.md" />
156+
</fileset>
157+
</copy>
158+
159+
<fileset id="docfiles" dir="target/md">
160+
<include name="*.md" />
161+
</fileset>
162+
163+
<pathconvert property="docfiles" refid="docfiles" pathsep=";">
164+
<mapper>
165+
<flattenmapper />
166+
</mapper>
167+
</pathconvert>
168+
169+
<property name="finmd" value="target/gh-pages/${inputmd}" />
170+
<copy file="target/md/${inputmd}" tofile="${finmd}" overwrite="true" />
171+
172+
<echo message="processing: ${finmd}" />
173+
<iterate list="${docfiles}">
174+
<echo message=" replacing: {{${md}}}" />
175+
<replace file="${finmd}" token="{{${md}}}" value="${md.value}" />
176+
</iterate>
177+
</target>
178+
56179
</project>

jooby-archetype/src/main/resources/archetype-resources/config/logback.xml renamed to jooby-archetype/src/main/resources/archetype-resources/config/logback.dev.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<configuration>
2+
<configuration scan="true" scanPeriod="15 seconds" debug="false">
33
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
44
<encoder>
55
<pattern>%-5p [%d{ISO8601}] %msg%n</pattern>

jooby-hbm/src/main/java/org/jooby/hbm/Hbm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void configure(final Mode mode, final Config config, final Binder binder)
117117
routes.addBinding()
118118
.toInstance(new Route.Definition("*", "*", readWriteTrx(emKey)).name("hbm"));
119119

120-
Multibinder.newSetBinder(binder, Request.Module.class).addBinding().toInstance((b) -> {
120+
Multibinder.newSetBinder(binder, Request.Module.class).addBinding().toInstance(b -> {
121121
log.debug("creating entity manager");
122122
EntityManager em = emf.createEntityManager();
123123
b.bind(emKey).toInstance(em);

jooby-hbs/src/main/java/org/jooby/hbs/Hbs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import com.typesafe.config.Config;
5252
import com.typesafe.config.ConfigFactory;
5353

54-
public class Hbs extends Jooby.Module implements HelperRegistry {
54+
public class Hbs implements HelperRegistry, Jooby.Module {
5555

5656
private static class Engine implements View.Engine {
5757

jooby-jackson/src/main/java/org/jooby/jackson/Json.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import com.google.inject.multibindings.Multibinder;
4646
import com.typesafe.config.Config;
4747

48-
public class Json extends Jooby.Module {
48+
public class Json implements Jooby.Module {
4949

5050
static class Configurer {
5151

jooby-jdbc/src/main/java/org/jooby/jdbc/Jdbc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import com.zaxxer.hikari.HikariConfig;
4646
import com.zaxxer.hikari.HikariDataSource;
4747

48-
public class Jdbc extends Jooby.Module {
48+
public class Jdbc implements Jooby.Module {
4949

5050
public static final String DEFAULT_DB = "db";
5151

jooby-tests/src/main/java/org/jooby/App.java renamed to jooby-tests/src/main/java/org/jooby/test/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.jooby;
19+
package org.jooby.test;
2020

2121
import java.lang.annotation.ElementType;
2222
import java.lang.annotation.Retention;

jooby-tests/src/main/java/org/jooby/JoobyRunner.java renamed to jooby-tests/src/main/java/org/jooby/test/JoobyRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.jooby;
19+
package org.jooby.test;
2020

2121
import java.io.IOException;
2222
import java.net.ServerSocket;

jooby-tests/src/main/java/org/jooby/NoJoinServer.java renamed to jooby-tests/src/main/java/org/jooby/test/NoJoinServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.jooby;
19+
package org.jooby.test;
2020

2121
import javax.inject.Inject;
2222

0 commit comments

Comments
 (0)