docgen: more explanation in api index

This commit is contained in:
Patrik Oldsberg
2020-07-16 15:35:48 +02:00
parent c5b2fdd846
commit 2776f735d7
3 changed files with 10 additions and 2 deletions
@@ -88,6 +88,13 @@ export default class ApiDocPrinter {
printer.header(1, 'Backstage Utility APIs');
printer.paragraph(
'The following is a list of all Utility APIs defined by `@backstage/core`.',
'They are available to use by plugins and components, and need to be provided by the app',
'They can be accessed using the `useApi` hook, also provided by `@backstage/core`.',
'For more information, see https://github.com/spotify/backstage/blob/master/docs/api/utility-apis.md.',
);
for (const api of apiDocs) {
printer.header(3, `${api.name.replace(/ApiRef$/, '')}`, api.id);
@@ -48,9 +48,10 @@ export default class MarkdownPrinter {
this.line();
}
paragraph(text: string) {
paragraph(...text: string[]) {
this.line(
text
.join('\n')
.trim()
.split('\n')
.map(line => line.trim())
+1 -1
View File
@@ -87,7 +87,7 @@ export async function generate(targetPath: string) {
[
'site_name: api-references',
'nav:',
` - Utility API Index: 'README.md'`,
` - API Index: 'README.md'`,
...apiTypes.map(({ name }) => ` - ${name}: '${name}.md'`),
'plugins:',
' - techdocs-core',