Skip to content

Commit

Permalink
feat(jsdocs): upper-first headings
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 6, 2024
1 parent 8f30476 commit 78e9165
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"citty": "^0.1.5",
"consola": "^3.2.3",
"magic-string": "^0.30.7",
"scule": "^1.2.0",
"untyped": "^1.4.2"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/generators/jsdocs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { resolve } from "node:path";
import { loadSchema } from "untyped/loader";
import type { Schema } from "untyped";
import { upperFirst } from "scule";
import { defineGenerator } from "../generator";

export default defineGenerator({
Expand Down Expand Up @@ -78,7 +79,7 @@ function renderSchema(schema: Schema, opts: { headingLevel: number }) {
return a.localeCompare(b);
})) {
if (group) {
lines.push(`${"#".repeat(opts.headingLevel)} ${group}`, "");
lines.push(`${"#".repeat(opts.headingLevel)} ${upperFirst(group)}`, "");
}
for (const item of sections[group].sort((i1, i2) =>
i1[0].localeCompare(i2[0]),
Expand Down

0 comments on commit 78e9165

Please sign in to comment.