◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
1 change: 0 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: scijava-docs
channels:
- conda-forge
- defaults
dependencies:
- myst-nb
- openjdk=11
Expand Down
12 changes: 12 additions & 0 deletions docs/ops/doc/WritingYourOwnOpPackage.md
Original file line number Diff line number Diff line change
@@ -467,6 +467,7 @@ Assuming your project is following Maven's [standard directory layout](https://m
```yaml
- op:
names: [your.op.name1, your.op.name2, ...] # Array of Strings
description: 'your Op description' # String
source: yourOpSource # String - see below
priority: 0.0 # Number
Expand All @@ -493,6 +494,17 @@ Assuming your project is following Maven's [standard directory layout](https://m

Of particular note are the following sections:

#### Source

For **java objects**, the `source` will start with one of the following prefix, followed by a `:/`, followed by a [percent-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding) stringification of the Op (i.e. calling `toString()` on the object). Examples are shown below:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,16 @@ public void testYAMLDescription() {
Assertions.assertEquals(expected, actual);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@

package org.scijava.ops.indexer;

import static org.scijava.ops.indexer.ProcessingUtils.blockSeparator;
import static org.scijava.ops.indexer.ProcessingUtils.tagElementSeparator;

import java.net.URI;
import java.util.*;
import java.util.stream.Collectors;

import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.Element;

/**
* A data structure containing all the metadata needed to define an Op
*
Expand Down Expand Up @@ -89,6 +88,11 @@ abstract class OpImplData {
*/
protected final List<String> authors = new ArrayList<>();

protected final ProcessingEnvironment env;

/**
Expand Up @@ -186,6 +190,10 @@ private void parseImplNote(String implTag) {
else if ("names".equals(kv[0]) || "name".equals(kv[0])) {
names.addAll(Arrays.asList(value.split("\\s*,\\s*")));
}
else {
if (value.contains(",")) {
tags.put(kv[0], value.split(","));
Expand Down Expand Up @@ -216,6 +224,7 @@ public Map<String, Object> dumpData() {
map.put("description", description);
map.put("priority", priority);
map.put("authors", authors.toArray(String[]::new));
var foo = params.stream() //
.map(OpParameter::data) //
.collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ final class ProcessingUtils {
* tags.
*/
public static final Pattern tagElementSeparator = Pattern.compile(
"\\s*[,\\s]+(?=(?:[^']*'[^']*')*[^']*$)");

private ProcessingUtils() {
throw new AssertionError("not instantiable");
Expand Down
Toggle all file notes Toggle all file annotations