Skip to content

Commit

Permalink
feat: remove underlines
Browse files Browse the repository at this point in the history
They are not rendered in GitHub anyway
  • Loading branch information
Elad Ben-Israel committed Jun 15, 2020
1 parent e71af42 commit 0f0e36f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npx projen@0.1.22
- run: npx projen@0.1.23
- run: yarn install --frozen-lockfile
- run: yarn build
- name: Anti-tamper check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npx projen@0.1.22
- run: npx projen@0.1.23
- run: yarn install --frozen-lockfile
- run: yarn build
- name: Anti-tamper check
Expand Down
19 changes: 8 additions & 11 deletions lib/render/klass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class Base extends Page {
if (!c.base) { return []; }

return [
`${this.underline('Extends')}: ${this.typeLink(c.base)}`,
`${this.strong('Extends')}: ${this.typeLink(c.base)}`,
];
}

Expand All @@ -57,13 +57,13 @@ abstract class Base extends Page {
if (implementors.length === 0) { return []; }

return [
`${this.underline('Implemented by')}: ${implementors.map(x => this.typeLink(x)).join(', ')}`,
`${this.strong('Implemented by')}: ${implementors.map(x => this.typeLink(x)).join(', ')}`,
];
}

protected renderMethods(methods: jsiiReflect.Callable[], caption = 'Methods') {
if (methods.length === 0) { return []; }

methods.sort(compareByKeys(methodOrder));

return [
Expand Down Expand Up @@ -99,22 +99,19 @@ abstract class Base extends Page {
? this.renderDefault(prop.docs.docs.default)
: '',
]

keywordArguments.push(kwarg.join(' '));
}
}

return [
includeHeader ? this.headingC(`${this.methodSignature(method)}${this.renderStability(method)} ${elementAnchor(method)}`) : '',
method.docs.toString(),
'',
this.underline('Usage:'),
'',
'```ts',
`${this.methodSignature(method, { long: true, verbatim: true })}`,
'```',
'',
this.underline('Parameters:'),
...method.parameters.map(p => [
'*',
this.renderElementName(p.name),
Expand All @@ -124,7 +121,7 @@ abstract class Base extends Page {
...keywordArguments,
'',
...method instanceof jsiiReflect.Method ? [
!method.returns.type.void ? this.underline('Returns') + ':' : '',
!method.returns.type.void ? this.strong('Returns') + ':' : '',
!method.returns.type.void ? '* ' + this.typeReferenceLink(method.returns.type) : '',
] : [],
'',
Expand All @@ -148,7 +145,7 @@ abstract class Base extends Page {
if (factories.length === 0) { return []; }

return [
`${this.underline('Obtainable from')}: ${factories.map(x => this.methodLink(x)).join(', ')}`,
`${this.strong('Obtainable from')}: ${factories.map(x => this.methodLink(x)).join(', ')}`,
];
}
}
Expand Down Expand Up @@ -190,7 +187,7 @@ export class ClassPage extends Base {
if (ifaces.length === 0) { return []; }

return [
`${this.underline('Implements')}: ${ifaces.map(x => this.typeLink(x)).join(', ')}`,
`${this.strong('Implements')}: ${ifaces.map(x => this.typeLink(x)).join(', ')}`,
];
}

Expand Down
8 changes: 4 additions & 4 deletions lib/render/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export abstract class Page {
x = x.trim();

if (x) {
return this.underline(this.italic('Default')) + ': ' + x;
return this.strong(this.italic('Default')) + ': ' + x;
} else {
return this.underline(this.italic('Optional'));
return this.strong(this.italic('Optional'));
}
}

Expand Down Expand Up @@ -91,8 +91,8 @@ export abstract class Page {
return `${heading} ${caption}\n`;
}

protected underline(text: string) {
return `<span style="text-decoration: underline">${text}</span>`;
protected strong(text: string) {
return `__${text}__`;
}

protected italic(text: string) {
Expand Down

0 comments on commit 0f0e36f

Please sign in to comment.