diff --git a/CoreHelp/src/au/gov/asd/tac/constellation/help/utilities/Generator.java b/CoreHelp/src/au/gov/asd/tac/constellation/help/utilities/Generator.java index 90778bb636..0e92ad9d7f 100644 --- a/CoreHelp/src/au/gov/asd/tac/constellation/help/utilities/Generator.java +++ b/CoreHelp/src/au/gov/asd/tac/constellation/help/utilities/Generator.java @@ -46,6 +46,7 @@ public class Generator implements Runnable { private static final Logger LOGGER = Logger.getLogger(Generator.class.getName()); private static String baseDirectory = ""; private static String tocDirectory = ""; + private static String onlineTocDirectory = ""; public static final String TOC_FILE_NAME = "toc.md"; public static final String ROOT_NODE_NAME = "Constellation Documentation"; @@ -60,10 +61,14 @@ public Generator() { public void run() { baseDirectory = getBaseDirectory(); tocDirectory = String.format("ext%1$s%2$s", File.separator, TOC_FILE_NAME); + onlineTocDirectory = getOnlineHelpTOCDirectory(baseDirectory); // Create TOCFile with the location of the resources file // Create the root node for application-wide table of contents TOCGenerator.createTOCFile(baseDirectory + tocDirectory); + + // Also create the TOCFile in the base directory for online help + TOCGenerator.createTOCFile(onlineTocDirectory); final TreeNode root = new TreeNode(new TOCItem(ROOT_NODE_NAME, "")); final List tocXMLFiles = getXMLFiles(baseDirectory); @@ -137,5 +142,15 @@ protected static String getResource() throws IllegalArgumentException { final String newPath = jarIx > -1 ? path.toString().substring(0, jarIx) : ""; return newPath != null ? newPath + File.separator + "ext" : ""; } + + protected static String getOnlineHelpTOCDirectory(final String filePath) { + final int index = filePath.indexOf("constellation"); + if (index <= 0) { + return filePath; + } else { + final String newPath = filePath.substring(0, index + 14); + return newPath + TOC_FILE_NAME; + } + } } diff --git a/CoreHelp/test/unit/src/au/gov/asd/tac/constellation/help/utilities/GeneratorNGTest.java b/CoreHelp/test/unit/src/au/gov/asd/tac/constellation/help/utilities/GeneratorNGTest.java index 65b285d80a..f413628cfd 100644 --- a/CoreHelp/test/unit/src/au/gov/asd/tac/constellation/help/utilities/GeneratorNGTest.java +++ b/CoreHelp/test/unit/src/au/gov/asd/tac/constellation/help/utilities/GeneratorNGTest.java @@ -97,7 +97,7 @@ public void testRun() { generator.run(); // verify that the toc file was called to be created, and that the xml mappings were to be converted - tocgeneratorStaticMock.verify(() -> TOCGenerator.createTOCFile(Mockito.anyString())); + tocgeneratorStaticMock.verify(() -> TOCGenerator.createTOCFile(Mockito.anyString()), times(2)); tocgeneratorStaticMock.verify(() -> TOCGenerator.convertXMLMappings(Mockito.any(), Mockito.any())); generatorStaticMock.verify(() -> Generator.getBaseDirectory(), times(2)); diff --git a/toc.md b/toc.md index 9d7c7ac151..920214d963 100644 --- a/toc.md +++ b/toc.md @@ -2,178 +2,208 @@

Constellation Documentation

-

-

-

-

-

-

-
Compare Graph
- Merge Nodes
+

-

-
Analytic View
+
Analytic View

-

-

-

-

+

-
Data Access View
- Data Access View: Options
+
Data Access View
+ Data Access View: Options

-

-

-

-

-

-

-

-
Map View
+
Map View

-

-

-

-