docs: add sidebar item for helper reference + examples fix (#8365)
This commit is contained in:
@@ -7531,6 +7531,44 @@ export const generatedSidebar = [
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"path": "/references/helper-steps",
|
||||
"title": "Helper Steps Reference",
|
||||
"isChildSidebar": true,
|
||||
"autogenerate_path": "/references/helper_steps/functions",
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"path": "/references/helper-steps/createRemoteLinkStep",
|
||||
"title": "createRemoteLinkStep",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"path": "/references/helper-steps/dismissRemoteLinkStep",
|
||||
"title": "dismissRemoteLinkStep",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"path": "/references/helper-steps/removeRemoteLinkStep",
|
||||
"title": "removeRemoteLinkStep",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"path": "/references/helper-steps/useRemoteQueryStep",
|
||||
"title": "useRemoteQueryStep",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1860,6 +1860,12 @@ export const sidebar = sidebarAttachHrefCommonOptions([
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/references/helper-steps",
|
||||
title: "Helper Steps Reference",
|
||||
isChildSidebar: true,
|
||||
autogenerate_path: "/references/helper_steps/functions",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import * as Handlebars from "handlebars"
|
||||
import { Reflection } from "typedoc"
|
||||
import { Reflection, SignatureReflection } from "typedoc"
|
||||
import { isWorkflowStep } from "../../utils/step-utils"
|
||||
|
||||
export default function () {
|
||||
Handlebars.registerHelper("example", function (reflection: Reflection) {
|
||||
const exampleTag = reflection.comment?.blockTags.find(
|
||||
const isStep =
|
||||
reflection.variant === "signature" &&
|
||||
isWorkflowStep(reflection as SignatureReflection)
|
||||
const targetReflection =
|
||||
isStep && reflection.parent ? reflection.parent : reflection
|
||||
const exampleTag = targetReflection.comment?.blockTags.find(
|
||||
(tag) => tag.tag === "@example"
|
||||
)
|
||||
|
||||
@@ -11,6 +17,6 @@ export default function () {
|
||||
return ""
|
||||
}
|
||||
|
||||
return Handlebars.helpers.commentTag(exampleTag, reflection)
|
||||
return Handlebars.helpers.commentTag(exampleTag, targetReflection)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user