Documentation Requirements for Developers
To ensure high quality and consistency of documentation in the Nrgy.js project, all developers must follow these rules when adding or changing functionality.
General Rules
- Documentation Placement: Source code documentation files should be placed in the same folder as the source file itself.
- Example:
packages/core/src/reactivity.ts->packages/core/src/reactivity.md.
- Localization: Documentation must be translated into English and Russian. AI translation is acceptable.
- The translation should be placed in a separate file with the locale as a suffix.
- Example:
packages/core/src/reactivity.ru.md.
Format: Documentation is written in Markdown format.
No
index.tsFile Articles: Do not create standalone documentation files forindex.tssource files.
- Public package entry points such as
index.tsmust be documented in the package-levelREADME.mdor other package-level documentation instead.
Article Structure for a File (Module)
Each article should contain the following sections:
- Purpose: A brief description of what problem the file/module solves.
- Overview: A more detailed description of the logic and context of use.
- Conceptual Architecture: Description of internal mechanisms and relationships with other parts of the system.
- Public API Description: A list of exported functions, classes, and types with descriptions of parameters and return values.
- Usage Examples: Practical code examples (Code Blocks) demonstrating API usage.
Article Structure for a Package
Each package should have a README.md file in its root (usually next to index.ts or in the root of the package folder) or an index.md file in the general docs folder, containing:
- Package Purpose: Why this package is needed.
- Overview: Main ideas and principles.
- Package Installation: Commands for installation (npm/yarn/pnpm).
- Conceptual Architecture: How the package is organized internally.
- Feature Documentation: Links to key modules or a summary description.
- Usage Examples: Integration examples.
Writing Style
- Use clear and concise technical language.
- Code in examples must be functional and follow project standards.
- Use
inline codeformatting for API function and parameter names.