must be unique and does not match a other tag syntax
Parameters vs Arguments
Parameters are the names used in the function definition.
Arguments are the actual values passed when calling the function.
Parameters:
A function can have zero or more parameters
Parameters are defined as either mandatory or optional
Optional parameters can have a default value
Arguments:
Multiple arguments are separated with a comma, e.g. single argument: cos(pi) multiple arguments: volume(10,20,30)
There are different types of arguments
Positional Arguments: These are passed in the order the function defines them. e.g.: volume(10, 20, 30)
Named Arguments: You can specify which parameter you're assigning a value to, regardless of order. e.g.: volume(l=30, h=10, w=20)
Arguments can set a parameter only once
You can mix positional arguments and named arguments, but positional arguments must come first
Named arguments remove ambiguity: If you want to skip an optional argument or specify one out of order, you must name it explicitly
Argument values:
must match the expected parameter type. e.g. area(length='hello', width='world') will result in a failure
may be a tag expression such as a variable, constant, operation, function, or combination. e.g. cos(2*pi)
Custom Functions
You can use prepackaged [template_engine] functions or add your own custom functions by manipulating the TemplateEngine.functionGroups field.
See Example.
Year of the copyright. It wil use the current year if not defined
tableOfContents Function
description:
Markdown table of content with links to all markdown chapters (e.g. # chapter, ## paragraph, ## sub paragraph) of a template file or all template files in a folder.
return type:
Object
expression example:
{{ tableOfContents('path value') }}
parameter:
path
String
mandatory
A relative project path (always with slash forward) to a template file (e.g.: doc/template/README.md.template) or a folder with template files (e.g.: doc/template/doc/wiki)
parameter:
includeFileLink
boolean
optional (default=true)
If the title links should be preceded with a link to the file
parameter:
gitHubWiki
boolean
optional (default=false)
Will remove the .md extension from the links so that they work correctly inside gitHub wiki pages
gitHubMileStones Function
description:
A markdown text of milestones on GitHub. You could use this for the CHANGELOG.md file.
a package name on pub.dev, e.g.: 'documentation_builder'
reference to a source file, e.g.: 'example/example.md' or 'lib/src/my_library.dart'
a reference to dart library member, e.g.: 'lib/src/my_library.dart#MyClass.myField'
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubLink Function
description:
Returns a markdown hyperlink of a web page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubWikiLink Function
description:
Returns a markdown hyperlink of a wiki page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubWikiLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubStarsLink Function
description:
Returns a markdown hyperlink of a stars page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubStarsLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubIssuesLink Function
description:
Returns a markdown hyperlink of an issue page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubIssuesLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubMilestonesLink Function
description:
Returns a markdown hyperlink of a milestone page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubMilestonesLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubReleasesLink Function
description:
Returns a markdown hyperlink of a releases page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubReleasesLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubPullRequestsLink Function
description:
Returns a markdown hyperlink of a pull request page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubPullRequestsLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
gitHubRawLink Function
description:
Returns a markdown hyperlink of a raw code page of your project on github.com
return type:
MarkDownLink
expression example:
{{ gitHubRawLink('suffix value') }}
parameter:
suffix
String
mandatory
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevLink Function
description:
Returns a markdown hyperlink of the home page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevChangeLogLink Function
description:
Returns a markdown hyperlink of the change log page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevChangeLogLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevVersionsLink Function
description:
Returns a markdown hyperlink of the version page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevVersionsLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevExampleLink Function
description:
Returns a markdown hyperlink of the example page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevExampleLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevInstallLink Function
description:
Returns a markdown hyperlink of the install page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevInstallLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevScoreLink Function
description:
Returns a markdown hyperlink of the score page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevScoreLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
pubDevLicenseLink Function
description:
Returns a markdown hyperlink of the license page of your project on pub.dev
return type:
MarkDownLink
expression example:
{{ pubDevLicenseLink() }}
parameter:
suffix
String
optional
A suffix to append to the URI (e.g. path, query, fragment, etc)
parameter:
text
String
optional
The text of the hyperlink. An appropriate text will be provided if no text is defined
Badge Functions
customBadge Function
description:
Creates markdown for a customizable badge image
return type:
String
expression example:
{{customBadge(tooltip='GitHub License' label='license' message='MIT' link='https://github.com/domain-centric/documentation_builder/blob/main/LICENSE')}} should render: [](https://github.com/domain-centric/documentation_builder/blob/main/LICENSE)
parameter:
toolTip
String
optional
This text becomes visible when hoovering over a badge
parameter:
label
String
mandatory
The label is the left text of the badge and is often lower case text
parameter:
message
String
mandatory
The label is the left message is the right text of the badge and can have a fill color
parameter:
color
String
optional (default="informational")
The message is the right text of the [Badge] and can have fill color.
The color can be defined in different ways:
As color name:
brightgreen
green
yellowgreen
yellow
orange
red
blue
lightgrey
blueviolet
As name
success
important
critical
informational (=default)
inactive
As code:
ff69b4
9cf
parameter:
link
String
mandatory
A Uri that points to a web site page.
pubPackageBadge Function
description:
Creates markdown for a badge of an existing Dart or Flutter package on pub.dev
return type:
String
expression example:
{{ pubPackageBadge() }} should render: [](https://pub.dev/packages/documentation_builder)
parameter:
toolTip
String
optional (default="Pub Package")
This text becomes visible when hoovering over a badge
pubScoresBadge Function
description:
Creates markdown for a badge of the scores on pub.dev
return type:
String
expression example:
{{ pubScoresBadge() }} should render: [
parameter:
toolTip
String
optional (default="Pub Scores")
This text becomes visible when hoovering over a badge
allPubBadges Function
description:
Creates markdown for all pub.dev badges
return type:
Object
expression example:
{{ allPubBadges() }}
gitHubBadge Function
description:
Creates markdown for a badge of a project on github.com
return type:
Object
expression example:
{{ gitHubBadge() }} should render: [](https://github.com/domain-centric/documentation_builder)
parameter:
toolTip
String
optional (default="Project on github.com")
This text becomes visible when hoovering over a badge
gitHubWikiBadge Function
description:
Creates markdown for a badge of the Wiki pages of a project on GitHub.com
return type:
Object
expression example:
{{ gitHubWikiBadge() }} should render: [](https://github.com/domain-centric/documentation_builder/wiki)
parameter:
toolTip
String
optional (default="Project Wiki pages on github.com")
This text becomes visible when hoovering over a badge
gitHubStarsBadge Function
description:
Creates markdown for a badge with the amount of stars on github.com
return type:
Object
expression example:
{{ gitHubStarsBadge() }} should render: [](https://github.com/domain-centric/documentation_builder/stargazers)
parameter:
toolTip
String
optional (default="Stars ranking on github.com")
This text becomes visible when hoovering over a badge
gitHubIssuesBadge Function
description:
Creates markdown for a badge with the amount of open issues on github.com
return type:
Object
expression example:
{{ gitHubIssuesBadge() }} should render: [](https://github.com/domain-centric/documentation_builder/issues)
parameter:
toolTip
String
optional (default="Open issues on github.com")
This text becomes visible when hoovering over a badge
gitHubPullRequestsBadge Function
description:
Creates markdown for a badge with the amount of open pull requests on github.com
return type:
Object
expression example:
{{ gitHubPullRequestsBadge() }} should render: [](https://github.com/domain-centric/documentation_builder/pull)
parameter:
toolTip
String
optional (default="Open pull requests on github.com")
This text becomes visible when hoovering over a badge
gitHubLicenseBadge Function
description:
Creates markdown for a badge with the amount of open pull requests on github.com
return type:
Object
expression example:
{{ gitHubLicenseBadge() }} should render: [](https://github.com/domain-centric/documentation_builder/blob/main/LICENSE)
parameter:
toolTip
String
optional (default="Project License")
This text becomes visible when hoovering over a badge
allGitHubBadges Function
description:
Creates markdown for all github.com badges
return type:
Object
expression example:
{{ allGitHubBadges() }}
allPubGitHubBadges Function
description:
Creates markdown for all pub.dev and github.com badges
return type:
Object
expression example:
{{ allPubGitHubBadges() }}
Math Functions
exp Function
description:
Returns the natural exponent e, to the power of the value