Documentation > Developers
Get ready 🔗
You will need the following tools to design your plugin: The first step is to clone the github repository for OpenMOLE :git clone https://gitlab.openmole.org/openmole/openmole.git
In order to generate documentation, openMOLE need some libraries.
Into your recently cloned openmole folder, call these three commands to compile libraries:
git lfs fetch
(cd build-system && sbt publishLocal)
(cd libraries && sbt publishLocal)
Compiling documentation 🔗
You're now ready to compile the actual documentation. Move into the nested openmole folder and run sbt to generate the website:cd openmole
sbt buildSite
The generated site is visible by opening openmole/openmole/bin/org.openmole.site/jvm/target/site/index.html
in your browser !
Adding a new page 🔗
Scala documentation file are located into the bin folderbin/org.openmole.site/jvm/src/main/scala/org/openmole/site/content
:
cd openmole/openmole/bin/org.openmole.site/jvm/src/main/scala/org/openmole/site/content
For this example, we try to add this current page "Documentation Generation" to Developers.
Into your favorite IDE :
- open
/org/openmole/site/Pages.scala
and search thedef developersPages
entry - add this new
compileDocumentation
variable
lazy val compileDocumentation = DocumentationPage.fromContent(name = "Documentation generation", content = org.openmole.site.content.developers.DocumentationGen)
After that, we add compileDocumentation
to the pageNode
corresponding to the "Developers" entry on the website:
def developersPages = pageNode(developers, Vector(console, pluginDevelopment, extensionAPI, restAPI, documentationGen))
Now, leave the Pages.scala
file and create a new scala content file DocumentaionGen.scala
into org/openmole/site/content/community/documentation/developers/
.
In this file you should add some headers:
//TODO Fix it after Scala 3 migration
import org.openmole.site._
import org.openmole.site.tools._
import org.openmole.site.stylesheet._
import DocumentationPages._
import org.openmole.site.content.Native._
object DocumentationGen extends PageContent(html"""
""")
We add a new link to the list of pages using:
@li{How to compile and modify the @a("documentation", href := DocumentationPages.documentationGen.file)}