documentation for maven plugin
@@ -50,3 +50,40 @@ Changes will be reflected in the browser.
# Deploy
See [documentation under Deployment](deployment/workflows)
+
+# Maven
+
+MDoc includes a Maven plugin which allows both preview of documentation and generation. Example plugin configuration:
+```xml
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.twosigma.td</groupId>
+ <artifactId>td-documentation-maven-plugin</artifactId>
+ <version>0.1</version>
+ <executions>
+ <execution>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <docId>mdoc</docId>
+ <deployRoot>${project.build.directory}</deployRoot>
+ <sourceRoot>${project.basedir}/documentation</sourceRoot>
+ <port>3334</port>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+```
+
+`docId` and `deployRoot` are only required for building documents while `port` is only applicable to preview and defaults
+to 3333. `sourceRoot` is the directory where `toc` exists.
+
+With the configuration above, documentation will be built as part of the `package` goal and will end up in this module's
+target directory, in a subdirectory named after the value of `docId`.
+
+In order to preview documentation, run `com.twosigma.td:td-documentation-maven-plugin:0.1:preview` in the appropriate module.
