@@ -124,7 +124,8 @@ private static void processModule(Asciidoctor asciidoctor, Path basedir, Path mo
124124 }
125125 }
126126
127- private static Options createOptions (Path basedir , Path outdir , String version , String title ) {
127+ private static Options createOptions (Path basedir , Path outdir , String version , String title )
128+ throws IOException {
128129 Attributes attributes = new Attributes ();
129130 attributes .setAttribute ("joobyVersion" , version );
130131 attributes .setAttribute ("love" , "♡" );
@@ -151,6 +152,12 @@ private static Options createOptions(Path basedir, Path outdir, String version,
151152 attributes .setAttribute ("highlightjs-theme" , "agate" );
152153 attributes .setAttribute ("favicon" , "images/favicon96.png" );
153154
155+ // versions:
156+ Document pom = Jsoup
157+ .parse (DocGenerator .basedir ().getParent ().resolve ("pom.xml" ).toFile (), "UTF-8" );
158+ pom .select ("properties > *" ).stream ()
159+ .forEach (tag -> attributes .setAttribute (toJavaName (tag .tagName ()), tag .text ().trim ()));
160+
154161 Options options = new Options ();
155162 options .setBackend ("html" );
156163
@@ -164,6 +171,26 @@ private static Options createOptions(Path basedir, Path outdir, String version,
164171 return options ;
165172 }
166173
174+ private static String toJavaName (String tagName ) {
175+ StringBuilder name = new StringBuilder ();
176+ name .append (tagName .charAt (0 ));
177+ boolean up = false ;
178+ for (int i = 1 ; i < tagName .length (); i ++) {
179+ char ch = tagName .charAt (i );
180+ if (Character .isJavaIdentifierPart (ch )) {
181+ if (up ) {
182+ name .append (Character .toUpperCase (ch ));
183+ up = false ;
184+ } else {
185+ name .append (ch );
186+ }
187+ } else {
188+ up = true ;
189+ }
190+ }
191+ return name .toString ();
192+ }
193+
167194 private static String document (Path index ) {
168195 try {
169196 Document doc = Jsoup .parse (index .toFile (), "UTF-8" );
0 commit comments