Skip to content

Commit

Permalink
fix and extend code documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
seebi committed Sep 22, 2023
1 parent 2945f0d commit f2965cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/develop/python-plugins/development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,24 @@ Currently, the following types are supported:

- `JinjaCode`: Jinja 2 templates
- `JsonCode`: JSON
- `XmlCode`: XML
- `PythonCode`: Python
- `SparqlCode`: SPARQL queries
- `SqlCode`: SQL queries
- `TurtleCode`: Turtle
- `XmlCode`: XML
- `YamlCode`: YAML configuration

The simplest way to employ a code type is to annotate the respective parameter in the constructor:

!!! Example "Example Jinja code parameter"

```python
``` python
@Plugin(label="Code test plugin")
class TransformTestPlugin(TransformPlugin):

def __init__(self, jinja: JinjaCode = JinjaCode("default template"):
self.jinja = jinja
```

If a plugin with a code parameter is created or edited in the UI, a code editor with syntax highlighting will be shown to the user.

Expand Down

0 comments on commit f2965cf

Please sign in to comment.