-
Notifications
You must be signed in to change notification settings - Fork 8
New module
PR's and new modules are welcome!
The current structure is done by hand. In the future modules will be loaded with a macro.
A module can consist of 4 things:
- Database proc
- HTML (*.tmpl file)
- WWW routes
- Custom proc's
If a module needs to create a table in the database:
Filename:
<module>_database.nim
Folder:
nimhapkg/resources/database/modules/
The proc shall be named <module>Database
.
The file needs to be imported by nimha.nim
. Insert the filepath at the top of file, where the other database imports are located.
The proc is runned on each start. Insert the proc at the bottom of the proc proc createDbTables() =
located in nimha.nim
.
If the plugin needs HTML, this shall be created in a *.tmpl file.
Filename:
<module>.tmpl
Folder:
nimhapkg/tmpl/
The main HTML generator shall be named gen<Module>
.
The file needs to be include in nimha_webinterface.nim
. Insert include "../tmpl/<module>.tmpl
where the other tmpl-files are located.
If the plugin needs routes. These should be added at the bottom of nimha_webinterface.nim
.
If the plugin needs custom proc's, create a new folder and create a Nim file within.
Filename: There is no specific requirement, but if possible include the modules name. If there is a need for more information than the modules name in the filename, then append this information.
Folder:
nimhapkg/resources/<module>
Modules might need integration with existing modules such as the alarm. No current procedure for this is available. Please add an issue with your suggestion.
- Home
- Requirements
- Install NimHA
- Optional
- Modules
- Tutorials (helpers, etc.)
- Development