docs: generate + configure js sdk reference (#9714)

Manually generate the JS SDK reference + add it to the sidebar
This commit is contained in:
Shahed Nasser
2024-10-22 17:31:32 +00:00
committed by GitHub
parent af3c6b0d93
commit a1190b7208
476 changed files with 76450 additions and 189 deletions
File diff suppressed because it is too large Load Diff
@@ -14,6 +14,7 @@ const baseSectionsOptions: Sections = {
member_signature_returns: false,
title_reflectionPath: false,
member_declaration_children: false,
member_force_title: false,
}
export default baseSectionsOptions
@@ -59,6 +59,12 @@ const jsSdkOptions: FormattingOptionsType = {
},
reflectionDescription:
"This documentation provides a reference to the `sdk.admin.{{alias}}` set of methods used to send requests to Medusa's Admin API routes.",
sections: {
...baseSectionsOptions,
member_declaration_title: false,
member_declaration_children: true,
member_force_title: true,
},
},
"^js_sdk/auth/classes/.*Auth": {
frontmatterData: {
@@ -74,6 +74,7 @@ import workflowInputHelper from "./resources/helpers/workflow-input"
import workflowOutputHelper from "./resources/helpers/workflow-output"
import workflowDiagramHelper from "./resources/helpers/workflow-diagram"
import workflowHooksHelper from "./resources/helpers/workflow-hooks"
import ifMemberShowTitleHelper from "./resources/helpers/if-member-show-title"
import { MarkdownTheme } from "./theme"
const TEMPLATE_PATH = path.join(__dirname, "resources", "templates")
@@ -176,4 +177,5 @@ export function registerHelpers(theme: MarkdownTheme) {
workflowOutputHelper(theme)
workflowDiagramHelper(theme)
workflowHooksHelper(theme)
ifMemberShowTitleHelper(theme)
}
@@ -0,0 +1,16 @@
import * as Handlebars from "handlebars"
import { DeclarationReflection } from "typedoc"
import { MarkdownTheme } from "../../theme"
export default function (theme: MarkdownTheme) {
Handlebars.registerHelper(
"ifMemberShowTitle",
function (this: DeclarationReflection, options: Handlebars.HelperOptions) {
return !this.hasOwnDocument ||
(Handlebars.helpers.sectionEnabled("member_force_title") &&
theme.location !== this.url)
? options.fn(this)
: options.inverse(this)
}
)
}
@@ -1,4 +1,4 @@
{{#unless hasOwnDocument}}
{{#ifMemberShowTitle}}
{{#if name}}
@@ -8,7 +8,7 @@
{{/if}}
{{/unless}}
{{/ifMemberShowTitle}}
{{#if signatures}}
@@ -64,7 +64,7 @@
{{/if}}
{{#unless hasOwnDocument}}
{{#ifMemberShowTitle}}
{{#if name}}
@@ -72,14 +72,14 @@
{{/if}}
{{/unless}}
{{/ifMemberShowTitle}}
{{#ifShowSeparatorForTitleLevel}}
{{#unless @last}}
{{#unless hasOwnDocument}}
{{#ifMemberShowTitle}}
{{#unless removeSeparator}}
___
{{/unless}}
{{/unless}}
{{/ifMemberShowTitle}}
{{/unless}}
{{/ifShowSeparatorForTitleLevel}}
+1
View File
@@ -30,6 +30,7 @@ export type SectionKey =
| "members_group_categories"
| "members_categories"
| "member_returns"
| "member_force_title"
| "title_reflectionPath"
| "reflection_comment"
| "reflection_typeParameters"