Skip to content

Commit

Permalink
feat: Improve generated doc formatting (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpears201 committed Nov 30, 2023
1 parent db5dcc9 commit 4613281
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 22 deletions.
6 changes: 2 additions & 4 deletions languages/javascript/templates/examples/default.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ${module} } from '${package.name}'

${module}.${method.name}(${example.params})
.then(${method.result.name} => {
console.log(${method.result.name})
})
let ${method.result.name} = await ${module}.${method.name}(${example.params})
console.log(${method.result.name})
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ${module} } from '${package.name}'

${module}.${method.pulls.for}(function(parameters) {
let success = await ${module}.${method.pulls.for}(async parameters => {
console.log(parameters.entityId)
console.log(parameters.assetId)
return Promise.resolve(${originator.params[1].example.value})
}).then(success => {
console.log(success)
})
return ${originator.params[1].example.value}
})
console.log(success)
6 changes: 2 additions & 4 deletions languages/javascript/templates/examples/polymorphic-pull.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ${module} } from '${package.name}'

${module}.${method.name}(${method.params[1].example.value})
.then(success => {
console.log(success)
})
let success = await ${module}.${method.name}(${method.params[1].example.value})
console.log(success)
6 changes: 2 additions & 4 deletions languages/javascript/templates/examples/setter.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { ${module} } from '${package.name}'

${module}.${method.setter.for}(${example.params})
.then(${method.result.name} => {
console.log(${method.result.name})
})
let ${method.result.name} = await ${module}.${method.setter.for}(${example.params})
console.log(${method.result.name})
7 changes: 3 additions & 4 deletions languages/javascript/templates/examples/subscriber.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ${module} } from '${package.name}'

${method.alternative}(value => {
let listenerId = await ${method.alternative}(value => {
console.log(value)
}).then(listenerId => {
console.log(listenerId)
})
})
console.log(listenerId)
2 changes: 1 addition & 1 deletion languages/markdown/templates/codeblocks/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ${info.title} } from '${package.name}'
class My${provider} {
${provider.interface.start}
async ${provider.interface.name}(parameters, session) {
return await Promise.resolve(${provider.interface.example.result})
return ${provider.interface.example.result}
}
${provider.interface.end}
}
Expand Down

0 comments on commit 4613281

Please sign in to comment.