Skip to content

Commit 8249152

Browse files
committed
fix(annotations): correct @Parser parameter description
1 parent df5c692 commit 8249152

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/annotations/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ annotation.
222222
If no value is passed to the annotation then the parser will become the default parser for the method return type.
223223
You may also pass a suggestion provider name to the annotation to bind the parser to a specific suggestion provider.
224224

225-
The signature of the method must be exactly:
225+
The parameter list is flexible (see the
226+
{{ javadoc("https://javadoc.io/doc/org.incendo/cloud-annotations/latest/org/incendo/cloud/annotations/parser/Parser.html", "JavaDoc", False) }}
227+
) but the parser _must_ return the type you wish to parse. The parser will be
228+
registered to the [parser registry](../core/index.md#parser-registry).
229+
230+
Example:
226231

227232
```java
228233
// Named parser: @Parser("parserName")

main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ def dependency_listing(name: str, version: str = None) -> str:
3232
""".format(name=name, version=env.variables.version[version])
3333

3434
@env.macro
35-
def javadoc(link: str, title: str = None) -> str:
35+
def javadoc(link: str, title: str = None, code: bool = True) -> str:
3636
if title is None:
3737
split = link.split("/")
3838
title = split[len(split) - 1].replace(".html", "")
3939
if link.startswith("<"):
4040
link = link[1: len(link) - 1]
41+
if code:
42+
title = f'`{title}`'
4143

42-
return '[`{title}`](<{link}> "Click to open the JavaDoc")'.format(link=link, title=title)
44+
return '[{title}](<{link}> "Click to open the JavaDoc")'.format(link=link, title=title)
4345

4446
@env.macro
4547
def snippet(path: str, section: str = "snippet", title: str = None, indent = 0) -> str:

0 commit comments

Comments
 (0)