Skip to content

Docs: extract Logger code snippets in separate files #1220

Closed
@dreamorosi

Description

@dreamorosi

What were you searching in the docs?

Currently the code snippets in the documentation under the Logger's section are hardcoded as part of the page's markdown.

This authoring experience, which doesn't provide linting, is error prone, which causes issues in the docs and in turns to users.

This issue is part of a larger effort being tracked at #729.

Is this related to an existing documentation section?

https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/logger/

How can we improve?

The code snippets should be extracted to their own separate files, placed under docs/snippets/logger.

So for instance, the first snippet that currently reads:

import { Logger } from '@aws-lambda-powertools/logger';

const logger = new Logger({ serviceName: 'serverlessAirline' });

export const handler = async (_event, _context): Promise<void> => {
    // ...
};

would be replaced with:

--8<-- "docs/snippets/logger/basicUsage.ts"

And the content should be placed in its own file at the path: docs/snippets/logger/basicUsage.ts.

This applies to all TypeScript code snippets of the page.

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippeddocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions