Skip to content

Commit

Permalink
refactor(provider): Output provider results in Markdown format #112
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Sep 30, 2024
1 parent 1dfd2a9 commit 03c3878
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,23 @@ class ShireToolchainFunctionProvider : ToolchainFunctionProvider {
val type = args.first() as String
return when (ShireProvideType.fromString(type)) {
ShireProvideType.Variables -> {
CompositeVariableProvider.all()
/// name and description to markdown table
var result = "| Name | Description |"
CompositeVariableProvider.all().forEach {
result += "\n| ${it.name} | ${it.description} |"
}

result
}

ShireProvideType.Functions -> {
PatternActionFunc.all()
/// funcName and example to markdown table
var result = "| Function | Description | Example |"
PatternActionFunc.all().forEach {
result += "\n| ${it.funcName} | ${it.description} | ${it.example} |"
}

result
}

ShireProvideType.Lifecycle -> {
Expand Down

0 comments on commit 03c3878

Please sign in to comment.