Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr committed Jun 28, 2023
1 parent 85e3b21 commit d44e5d7
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 68 deletions.
40 changes: 12 additions & 28 deletions apps/jsii-docgen/src/docgen/render/markdown-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ export class MarkdownRenderer {
const md = new MarkdownDocument({ header: { title: "Members" } });

md.table(this.createTable(enus, false));
md.split();

for (const enu of enus) {
md.section(this.visitEnumMember(enu));
}

return md;
}
Expand Down Expand Up @@ -470,19 +475,9 @@ export class MarkdownRenderer {
}

public visitEnumMember(em: EnumMemberSchema): MarkdownDocument {
const md = new MarkdownDocument({
id: this.anchorFormatter({
id: em.id,
displayName: em.displayName,
fqn: em.fqn,
...this.metadata,
}),
header: {
title: em.displayName,
pre: true,
strike: em.docs.deprecated,
},
});
const md = new MarkdownDocument();

md.lines(MarkdownDocument.bold(MarkdownDocument.pre(em.displayName)));

if (em.docs.deprecated) {
md.bullet(
Expand Down Expand Up @@ -545,22 +540,11 @@ export class MarkdownRenderer {
}

public visitParameter(parameter: ParameterSchema): MarkdownDocument {
const optionality = parameter.optional ? "Optional" : "Required";
const md = new MarkdownDocument();

const md = new MarkdownDocument({
id: this.anchorFormatter({
id: parameter.id,
displayName: parameter.displayName,
fqn: parameter.fqn,
...this.metadata,
}),
header: {
title: parameter.displayName,
sup: optionality,
pre: true,
strike: parameter.docs.deprecated,
},
});
md.lines(
MarkdownDocument.bold(MarkdownDocument.pre(parameter.displayName))
);

if (parameter.docs.deprecated) {
md.bullet(
Expand Down
3 changes: 2 additions & 1 deletion apps/jsii-docgen/src/docgen/transpile/wing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const typeToString: TranspiledTypeReferenceToStringOptions = {

const formatStructInitialization = (type: transpile.TranspiledType) => {
const target = type.submodule ? `${type.namespace}.${type.name}` : type.name;
return `let ${type.name.toLowerCase()} = ${target} { ... }`;
let typeName = type.name[0].toLowerCase() + type.name.slice(1);
return `let ${typeName} = ${target} { ... }`;
};

const formatClassInitialization = (
Expand Down
Loading

0 comments on commit d44e5d7

Please sign in to comment.