55
66import java .io .IOException ;
77import java .io .StringWriter ;
8- import java .util .Comparator ;
9- import java .util .Map ;
10- import java .util .TreeMap ;
8+ import java .util .*;
119import java .util .function .Supplier ;
10+ import java .util .stream .Collectors ;
11+
12+ import de .uka .ilkd .key .util .KeYConstants ;
13+ import de .uka .ilkd .key .util .KeYResourceManager ;
1214
1315import freemarker .core .HTMLOutputFormat ;
1416import freemarker .ext .beans .ZeroArgumentNonVoidMethodPolicy ;
@@ -38,6 +40,7 @@ public String get() {
3840 var cfg = new Configuration (Configuration .VERSION_2_3_32 );
3941 cfg .setClassForTemplateLoading (DocGen .class , "/templates" ); // classpath
4042 cfg .setDefaultEncoding ("UTF-8" );
43+ cfg .setAutoEscapingPolicy (Configuration .DISABLE_AUTO_ESCAPING_POLICY );
4144 cfg .setTemplateExceptionHandler (TemplateExceptionHandler .HTML_DEBUG_HANDLER );
4245 cfg .setLogTemplateExceptions (false );
4346 cfg .setWrapUncheckedExceptions (true );
@@ -64,11 +67,22 @@ public String get() {
6467 .stream ().sorted (Comparator .comparing (Metamodel .Endpoint ::name ))
6568 .toList ());
6669
70+ final Map <String , List <Metamodel .Endpoint >> collect = metamodel .endpoints ()
71+ .stream ().sorted (Comparator .comparing (Metamodel .Endpoint ::name ))
72+ .collect (Collectors .groupingBy (Metamodel .Endpoint ::segment , TreeMap ::new ,
73+ Collectors .toList ()));
74+
75+ model .put ("endpointsBySegment" , collect );
76+
6777 model .put ("types" ,
6878 metamodel .types ().values ()
6979 .stream ().sorted (Comparator .comparing (Metamodel .Type ::name ))
7080 .toList ());
7181
82+ model .put ("version" ,
83+ KeYResourceManager .getManager ().getVersion () +
84+ " (" + KeYConstants .INTERNAL_VERSION .substring (0 , 8 ) + ")" );
85+ model .put ("date" , new Date ());
7286
7387 // 3) Get template
7488 var tpl = cfg .getTemplate ("docs.ftl" );
0 commit comments