Skip to content

Commit

Permalink
fix(annotations): correct @Parser parameter description
Browse files Browse the repository at this point in the history
  • Loading branch information
Citymonstret committed Sep 1, 2024
1 parent df5c692 commit 8249152
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion docs/annotations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ annotation.
If no value is passed to the annotation then the parser will become the default parser for the method return type.
You may also pass a suggestion provider name to the annotation to bind the parser to a specific suggestion provider.

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

Example:

```java
// Named parser: @Parser("parserName")
Expand Down
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ def dependency_listing(name: str, version: str = None) -> str:
""".format(name=name, version=env.variables.version[version])

@env.macro
def javadoc(link: str, title: str = None) -> str:
def javadoc(link: str, title: str = None, code: bool = True) -> str:
if title is None:
split = link.split("/")
title = split[len(split) - 1].replace(".html", "")
if link.startswith("<"):
link = link[1: len(link) - 1]
if code:
title = f'`{title}`'

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

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

0 comments on commit 8249152

Please sign in to comment.