Prompt
Documentation should be clear, precise, and self-contained while following established style conventions. When writing technical documentation:
- Use precise language: Clearly describe how APIs work, including any restrictions or requirements.
// Good // The function must be synchronous, and must not throw an error. fastify.setGenReqId(function (rawReq) { return 'request-id' }) // Bad // This function can be used to set a request ID. fastify.setGenReqId(function (rawReq) { return 'request-id' }) - Make documentation self-contained: Include all necessary context within the document itself rather than relying on external links.
// Good // The `preHandler` hook allows you to specify a function that is executed before // routes' handler. // Bad // See Issue #1234 for more details on the preHandler hook. - Follow style conventions:
- Avoid using “you” in reference documentation
- Avoid contractions in formal documentation
- Use proper formatting for headers, lists, and code blocks
// Good // When request logging is enabled, request logs can be customized by // supplying a createRequestLogMessage() function. // Bad // You can customize your request logs by using a createRequestLogMessage() function. - Create accessible links: Provide meaningful context in link text rather than using generic phrases.
<!-- Good --> [TypeScript no-floating-promises configuration](https://typescript-eslint.io/rules/no-floating-promises/) <!-- Bad --> Click [here](https://typescript-eslint.io/rules/no-floating-promises/) for more information.