docs: add sidebar item for helper reference + examples fix (#8365)
This commit is contained in:
1 parent
6f973d9f2b
commit
22a629670b
3 files changed
+53
-3
No files matched your search
@@ -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 * as Handlebars from "handlebars"
|
||||||
import { Reflection } from "typedoc"
|
import { Reflection, SignatureReflection } from "typedoc"
|
||||||
|
import { isWorkflowStep } from "../../utils/step-utils"
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
Handlebars.registerHelper("example", function (reflection: Reflection) {
|
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"
|
(tag) => tag.tag === "@example"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -11,6 +17,6 @@ export default function () {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return Handlebars.helpers.commentTag(exampleTag, reflection)
|
return Handlebars.helpers.commentTag(exampleTag, targetReflection)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user