Skip to content

Docs: extract Tracer code snippets in separate files #1219

Closed
@dreamorosi

Description

@dreamorosi

What were you searching in the docs?

Currently the code snippets in the documentation under the Tracer'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/tracer/

How can we improve?

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

So for instance, the first snippet that currently reads:

import { Tracer } from '@aws-lambda-powertools/tracer';

const tracer = new Tracer({ serviceName: 'serverlessAirline' });

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

would be replaced with:

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

And the content should be placed in its own file at the path: docs/snippets/tracer/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