Skip to content

Commit c09ec1e

Browse files
committed
🎨 Prettify
1 parent 5720bea commit c09ec1e

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ export const load = async () => {
613613
slug: module.slug,
614614
frontmatter: module.frontmatter,
615615
};
616-
})
616+
}),
617617
);
618618
return { content };
619619
};

‎src/headings.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ export const heading: Schema = {
110110
const render = config.nodes?.heading?.render ?? `h${level}`;
111111

112112
/**
113-
* TODO: THis doesn't work because render is a string even for custom components
114-
*
115113
* When the tag has a component as its render option,
116114
* add an attribute to collect it as a header
117115
* and also the level as a prop, not an HTML attribute.

‎src/main.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
4646
for (const key in options) {
4747
if (!validOptionKeys.includes(key as keyof Options)) {
4848
log.warn(
49-
`Invalid option "${key}" provided and ignored. Check the documentation for valid options.`
49+
`Invalid option "${key}" provided and ignored. Check the documentation for valid options.`,
5050
);
5151
}
5252
}
@@ -72,7 +72,8 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
7272
const processHeadings = options.headingIds ?? false;
7373
// If passed `true`, use the default for slugging headings
7474
// Otherwise, use the passed function
75-
const headingSlugger = typeof processHeadings === "boolean" ? slug : processHeadings;
75+
const headingSlugger =
76+
typeof processHeadings === "boolean" ? slug : processHeadings;
7677
const linkify = options.linkify ?? false;
7778
const typographer = options.typographer ?? false;
7879
const validationLevel = options.validationLevel || "error";
@@ -162,7 +163,7 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
162163
partials: { ...partialsFromSchema, ...partialsFromPartials },
163164
// Make $frontmatter available as variable
164165
variables: { ...configFromSchema.variables, ...variables, frontmatter },
165-
headingSlugger
166+
headingSlugger,
166167
};
167168

168169
// Validate Markdoc AST
@@ -184,7 +185,7 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
184185
}
185186
return [];
186187
};
187-
const headings = getHeadings()
188+
const headings = getHeadings();
188189

189190
// Render Markdoc AST to Svelte
190191
const svelteContent = render(transformedContent);
@@ -212,7 +213,7 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
212213
extractUsedSvelteComponents(transformedContent);
213214
const componentImportStatements = getComponentImports(
214215
usedSvelteComponentNames,
215-
componentsPath
216+
componentsPath,
216217
);
217218

218219
// Construct script tag content

‎src/types.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export interface MarkdocModule {
121121
headings?: Heading[];
122122
}
123123

124-
export type SluggerType = ((value: string) => string)
124+
export type SluggerType = (value: string) => string;
125125

126126
export interface MarkdocSvelteConfig extends Config {
127-
headingSlugger?: SluggerType
127+
headingSlugger?: SluggerType;
128128
}

0 commit comments

Comments
 (0)