You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tutorial will present the basic steps for writing additional plugins that are not shipped with `HERMES` but can be made availabe for others through the [HERMES marketplace](../index.md#plugins).
16
+
17
+
This reference will present the basic structure of additional plugins that are not shipped with `HERMES` but can be made availabe for others through the [HERMES marketplace](../index.md#plugins).
18
18
19
19
The full code and structure of a harvest plugin is available at [hermes-plugin-git](https://github.com/softwarepub/hermes-plugin-git).
20
20
This plugin extracts information from the local git history.
21
21
The hermes-plugin-git will help to gather contribution and branch metadata.
22
22
23
23
```{note}
24
-
To follow this tutorial you should be familiar with HERMES.
25
-
If you never used HERMES before, you might want to check the tutorial: [Automated Publication with HERMES](./automated-publication-with-ci).
24
+
You should be familiar with HERMES before learning about how the structure of plugins.
25
+
If you never used HERMES before, you might want to check the tutorial: [Automated Publication with HERMES](./../tutorials/automated-publication-with-ci).
26
26
27
-
Also all metadata directly handled by HERMES is [JSON-LD](https://json-ld.org/) so you should be familiar with [how it is used by HERMES](../dev/data_model.md) when writing a plugin.
27
+
Also all metadata directly handled by HERMES is [JSON-LD](https://json-ld.org/) so you should be familiar with [how it is used by HERMES](./data_model.md) when writing a plugin.
28
28
And uses the [schema.org](https://schema.org/) (with prefix "schema") and the [CodeMeta](https://codemeta.github.io/) (without prefix) context.
29
29
```
30
30
@@ -81,7 +81,7 @@ class YourHarvestPlugin(HermesHarvestPlugin):
81
81
```
82
82
83
83
The {py:meth}`~hermes.commands.harvest.base.HermesHarvestPlugin.__call__` method of harvest plugins needs to return a {py:class}`~hermes.model.api.SoftwareMetadata` object containing the harvested metadata.
84
-
For more information on how to use this object see [here](../dev/data_model.md).
84
+
For more information on how to use this object see [here](./data_model.md).
85
85
86
86
### Process plugin
87
87
The class structure of a process plugin should look like this:
@@ -111,6 +111,9 @@ class YourProcessPlugin(HermesProcessPlugin):
111
111
```
112
112
113
113
The {py:meth}`~hermes.commands.process.base.HermesProcessPlugin.__call__` method of process plugins needs to return a dictionary mappings strings and/ or `None` to dictionaries mapping strings or `None` to {py:class}`~hermes.model.merge.action.MergeAction`.
114
+
Alone the data structure isn't enough to understand how this object is supposed to represent the merge strategies.
115
+
The following example will illustrate the sematics of each layer within the dictionary.
116
+
114
117
If `strategies` looked like this (where {py:class}`~hermes.model.merge.action.Reject` is imported from {py:mod}`hermes.model.merge.action`)
115
118
```{code-block} python
116
119
strategies = {
@@ -158,7 +161,7 @@ class YourCuratePlugin(HermesCuratePlugin):
158
161
```
159
162
160
163
The {py:meth}`~hermes.commands.curate.base.HermesCuratePlugin.__call__` method of curate plugins needs to return a {py:class}`~hermes.model.api.SoftwareMetadata` object containing the curated metadata.
161
-
For more information on how to use this object see [here](../dev/data_model.md).
164
+
For more information on how to use this object see [here](./data_model.md).
162
165
The returned object may be the object `metadata` passed to `__call__`.
163
166
164
167
### Deposit plugin
@@ -308,7 +311,7 @@ We will discuss the exact step after showing the other `pyproject.toml` configur
308
311
You have to run poetry install to add and install all entrypoints declared in the pyproject.toml.
309
312
```
310
313
311
-
### Write Plugin to be included in HERMES
314
+
### Include Plugin into HERMES
312
315
This variant is used to contribute to the HERMES community or adapt the HERMES workflow for own purposes.
313
316
If you want to contribute, see the [Contribution Guidelines](https://docs.software-metadata.pub/en/latest/dev/contribute.html).
314
317
After cloning the HERMES workflow repository you can adapt the pyproject.toml.
0 commit comments