Skip to content

Commit ce7cc4a

Browse files
author
notactuallyfinn
committed
renamed plugin tutorial to plugin reference
1 parent c5f1e34 commit ce7cc4a

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

docs/source/tutorials/writing-a-plugin-for-hermes.md renamed to docs/source/dev/plugin_structure.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ SPDX-FileContributor: Nitai Heeb
1111
SPDX-FileContributor: Oliver Bertuch
1212
-->
1313

14-
# Write a plugin for HERMES
15-
14+
# HERMES plugins
1615

17-
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).
1818

1919
The full code and structure of a harvest plugin is available at [hermes-plugin-git](https://github.com/softwarepub/hermes-plugin-git).
2020
This plugin extracts information from the local git history.
2121
The hermes-plugin-git will help to gather contribution and branch metadata.
2222

2323
```{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).
2626
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.
2828
And uses the [schema.org](https://schema.org/) (with prefix "schema") and the [CodeMeta](https://codemeta.github.io/) (without prefix) context.
2929
```
3030

@@ -81,7 +81,7 @@ class YourHarvestPlugin(HermesHarvestPlugin):
8181
```
8282

8383
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).
8585

8686
### Process plugin
8787
The class structure of a process plugin should look like this:
@@ -111,6 +111,9 @@ class YourProcessPlugin(HermesProcessPlugin):
111111
```
112112

113113
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+
114117
If `strategies` looked like this (where {py:class}`~hermes.model.merge.action.Reject` is imported from {py:mod}`hermes.model.merge.action`)
115118
```{code-block} python
116119
strategies = {
@@ -158,7 +161,7 @@ class YourCuratePlugin(HermesCuratePlugin):
158161
```
159162

160163
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).
162165
The returned object may be the object `metadata` passed to `__call__`.
163166

164167
### Deposit plugin
@@ -308,7 +311,7 @@ We will discuss the exact step after showing the other `pyproject.toml` configur
308311
You have to run poetry install to add and install all entrypoints declared in the pyproject.toml.
309312
```
310313

311-
### Write Plugin to be included in HERMES
314+
### Include Plugin into HERMES
312315
This variant is used to contribute to the HERMES community or adapt the HERMES workflow for own purposes.
313316
If you want to contribute, see the [Contribution Guidelines](https://docs.software-metadata.pub/en/latest/dev/contribute.html).
314317
After cloning the HERMES workflow repository you can adapt the pyproject.toml.

docs/source/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ tutorials/*
7676
Tutorial: Get started w/ development <dev/start>
7777
dev/contribute
7878
dev/data_model
79+
dev/plugin_structure
7980
adr/index
8081
api/index
8182
dev/releasing

0 commit comments

Comments
 (0)