diff --git a/docs/annotations/index.md b/docs/annotations/index.md index fc6d693..b1f4c1c 100644 --- a/docs/annotations/index.md +++ b/docs/annotations/index.md @@ -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") diff --git a/main.py b/main.py index 613a5d2..7840048 100644 --- a/main.py +++ b/main.py @@ -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: