Documentation
2. Edit a page
If you want to edit a Docs - Page just click on 'Edit this Page' in the upper right corner to edit the page you are currently visiting.
Edit the Page according to your ideas and commit your changes.
You will see the changes you have made after our frequent Docs - Update.
3. Add a page
To add a page, clone the OpenEMS Repository (preferably Source Tree) and open it with a Code Editor (preferably Visual Studio Code).
-
Go to doc/modules/ROOT/pages and create a .adoc file with the desired name.
-
Go to doc/modules/ROOT/nav.adoc and add your page with the correct filename to the nav file.
4. Build Docs
To build the docs, clone the OpenEMS Repository (preferably Source Tree) and open it with a Code Editor (preferably Visual Studio Code).
|
NodeJS has to be installed |
Open the integrated terminal, change to the root directory and type
gradlew buildAntoraDocs
Docs should be building.. the finished HTML Folder can be found in your local 'build' folder (inside your repository build folder )
| If you want to build your own docs with Antora see this guide |
5. Dynamic Documentation Generation
Some parts of the OpenEMS documentation are generated dynamically during the build process.
In the repository you can find includes like nature.adoc
include::pages/edge/nature.d/_nav.adoc[]
where the corresponding folder nature.d is basically empty. (It only contains a .gitignore file to keep it that way in version control.) This is, where the dynamic generation happens.
5.1. The Process
(shown at the example of Natures documentation)
-
Build-Time Generation (in
build.gradlelines 393-503)The
copyBundleReadmesGradle task runs during the documentation build process and:-
Scans all bundles in the project looking for
readme.adocfiles -
Categorizes bundles by type (nature, controller, scheduler, bridge, deviceService, timedata, backendService)
-
For each category, it:
-
Copies bundle
readme.adocfiles to the corresponding folder (e.g.,nature.d/{bundle-name}.adoc) -
Extracts the title from the first line of each
readme.adoc(the line starting with `= `) -
Creates xref entries for each bundle, sorted alphabetically by title
-
Generates a
_nav.adocfile containing all the xref links
-
-
-
The Result
The generated
nature.d/_nav.adocfile contains something like:* \xref:edge/nature.d/io.openems.edge.battery.api.adoc[Battery] * \xref:edge/nature.d/io.openems.edge.batteryinverter.api.adoc[Battery Inverter] * \xref:edge/nature.d/io.openems.edge.ess.api.adoc[Energy Storage System] * \xref:edge/nature.d/io.openems.edge.meter.api.adoc[Meter] ... -
AsciiDoc Processing
When Antora builds the documentation, it processes
nature.adocwhich includes the line:
include::nature.d/_nav.adoc[]
This includes all the xref links to the individual bundle documentation files, creating a navigable list of natures.
5.2. Why This Pattern?
-
Automatic: New bundles with
readme.adocfiles automatically appear in the documentation -
Maintainable: Each bundle documents itself in its own
readme.adoc -
DRY: No need to manually maintain a central list
-
Build artifact: The generated files are git-ignored and regenerated on each build
-
Sorted: Entries are automatically sorted alphabetically by title
You can see this in action by running:
./gradlew copyBundleReadmes
This will populate all dynamic documentation folders with individual bundle documentation files and generate _nav.adoc files with xref links for all categories (nature, controller, scheduler, bridge, deviceService, timedata, backendService).
6. Creating Bundle README Files
Each bundle in OpenEMS should include a readme.adoc file that documents the component. These files are automatically included in the generated documentation using the Dynamic Documentation Generation process.
6.1. Creating a README with AI Assistance
To simplify the creation of standardized bundle README files, use the provided helper script:
./doc/tools/standardize_bundle_readme.sh <bundle_name>
./doc/tools/standardize_bundle_readme.sh io.openems.edge.meter.weidmueller
This script will:
-
Extract component metadata from the bundle’s implementation files
-
Parse Factory-PID, component class name, and interfaces
-
Generate a template ready for AI-powered completion
-
Provide copy-paste ready instructions
You can then use the extracted metadata to prompt an AI agent (like GitHub Copilot) to generate a complete, well-structured README that follows OpenEMS conventions.
-
Run the standardization script to extract metadata
-
Copy the template and metadata to an AI agent prompt
-
Request the AI to generate a README following OpenEMS documentation standards
-
Review and refine the generated README as needed
-
Save the file to
<bundle_name>/readme.adoc -
Run
./gradlew buildAntoraDocsto verify the documentation builds correctly
For more details, see the script documentation in doc/tools/standardize_bundle_readme.sh.