lily_website

🧭 Documentation Standard

AUTHORITY: This document defines how documentation is written, structured, and maintained in this project.


1. πŸ“œ Core Philosophy

We maintain documentation in two languages to ensure international accessibility while keeping the local community engaged.

πŸ‡¬πŸ‡§ English (Primary / Source of Truth)

πŸ‡·πŸ‡Ί Russian (Secondary / Conceptual Hub)


2. ☯️ Twin Realms Principle

Documentation languages serve different purposes:

πŸ‡¬πŸ‡§ EN = Technical Truth

πŸ‡·πŸ‡Ί RU = Architect’s Mind


3. πŸ—‚οΈ Structure Mirroring Rule

Documentation structure MUST mirror code structure.

Mapping Example

Code Location Documentation Location
src/backend/features/portfolio/ docs/en_EN/architecture/backend/features/portfolio/
src/bot/handlers/commands/ docs/en_EN/architecture/bot/handlers/commands/
src/frontend/components/ docs/en_EN/architecture/frontend/components/

Why?


4. 🧭 Navigation Standard

Every documentation file must be easily navigable.

Every file MUST start with a navigation header:

[⬅️ Back](/lily_website/en_EN/infrastructure/) | [🏠 Docs Root](/lily_website/en_EN/)

File: docs/en_EN/architecture/backend/features/portfolio/data_schema.md

❌ BAD:

[Back](../) | [Home](/)

βœ… GOOD:

[⬅️ Back](/lily_website/en_EN/infrastructure/documentation/) | [🏠 Docs Root](../../../../../README.md)

Index Files (README.md)

Every directory MUST have a README.md acting as a navigation hub.

Required Structure:

  1. Header: Emoji πŸ“‚ + Section Name
  2. Navigation: Breadcrumbs
  3. Description: Short summary (2-3 sentences)
  4. Map: Table or list of files in logical reading order (not alphabetical)

Index Template:

# πŸ“‚ [Section Name]

[⬅️ Back](/lily_website/en_EN/infrastructure/) | [🏠 Docs Root](/lily_website/en_EN/)

Brief description of what this section contains.

## πŸ—ΊοΈ Module Map

| Component | Description |
|:---|:---|
| **[πŸ“„ Overview](./overview.md)** | High-level introduction |
| **[πŸ“„ Data Schema](./data_schema.md)** | Database models and DTOs |
| **[πŸ“„ API Contract](./api_contract.md)** | Endpoints and request/response formats |

5. πŸ“ File Naming & Organization

Naming Conventions

Language Folders

All documents MUST reside in:

Never create language-neutral folders like docs/shared/.


6. βœ… Markdown Linting Rules

This project enforces strict markdown standards to maintain consistency.

Required Rules

  1. MD047 (End with Newline):
    • Every file must end with exactly one newline character (\n)
    • ❌ BAD: ...end of text. (EOF)
    • βœ… GOOD: ...end of text.\n (EOF)
  2. MD032 (List Spacing):
    • Insert a blank line before and after any list
    • ❌ BAD: ```markdown Text
      • Item 1 ```
    • βœ… GOOD:
      Text
      
      * Item 1
      
      Next text
      
  3. MD007 (Indentation):
    • Use 2 spaces for nested lists (not 4 spaces or tabs)
    • ❌ BAD: ` * Nested item` (4 spaces)
    • βœ… GOOD: ` * Nested item` (2 spaces)

Validation

Run linter before committing:

python scripts/lint_docs.py

See: MARKDOWN_STANDARDS.md for full technical specification.


7. 🚫 Common Mistakes

❌ Mistake 1: Numbered Prefixes

docs/
β”œβ”€β”€ 01_introduction.md
β”œβ”€β”€ 02_setup.md
└── 03_usage.md

Why bad: Breaks when files are reordered or inserted.

Fix: Use README.md map to define reading order.

❌ Mistake 2: Duplicating Code in RU Docs

# RU: Π‘Ρ…Π΅ΠΌΠ° Π±Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ…

class User(Base):
    id = Column(Integer, primary_key=True)
    ...

Why bad: Doubles maintenance burden, creates sync issues.

Fix: Link to EN version:

# RU: Π‘Ρ…Π΅ΠΌΠ° Π±Π°Π·Ρ‹ Π΄Π°Π½Π½Ρ‹Ρ…

Π‘ΠΌΠΎΡ‚Ρ€ΠΈ [EN Schema](../../en_EN/architecture/backend/data_schema.md#user-model).

❌ Mistake 3: Missing Breadcrumbs

# My Feature

Content here...

Why bad: No way to navigate back.

Fix: Add navigation header:

# My Feature

[⬅️ Back](/lily_website/en_EN/infrastructure/documentation/) | [🏠 Docs Root](/lily_website/en_EN/)

Content here...

❌ Mistake 4: Dumping Files in Root

docs/en_EN/architecture/backend/
β”œβ”€β”€ portfolio_service.md
β”œβ”€β”€ auth_service.md
└── payment_service.md

Why bad: Violates structure mirroring rule.

Fix: Mirror code structure:

docs/en_EN/architecture/backend/
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ portfolio/
β”‚   β”‚   └── service.md
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   └── service.md
β”‚   └── payment/
β”‚       └── service.md

8. πŸ“‹ Contributor Checklist

Before submitting documentation:



Last Updated: 2025-02-07