include next and prev pages tocItem to page json representation
@@ -34,6 +34,15 @@ public class PageProps {
pageProps.put("type", "Page");
pageProps.put("content", ((Map<String, ?>) page.getDocElement().toMap()).get("content"));
pageProps.put("tocItem", tocItem.toMap());
+
+ if (tocItem.getNext() != null) {
+ pageProps.put("nextTocItem", tocItem.getNext().toMap());
+ }
+
+ if (tocItem.getPrev() != null) {
+ pageProps.put("prevTocItem", tocItem.toMap());
+ }
+
pageProps.put("renderContext", renderContext.toMap());
return pageProps;
