Skip to content

Latest commit

Β 

History

History
256 lines (220 loc) Β· 13.1 KB

File metadata and controls

256 lines (220 loc) Β· 13.1 KB

fastn.com Documentation & Specification Plan

Overview

Transform fastn.com into the comprehensive hub for all fastn development, specifications, and design decisions. Primary focus: Complete comprehensive fastn 0.4 documentation before moving to v0.5 content. This ensures the current stable release is thoroughly documented for developers and the community.

Current State Analysis

Existing Documentation Structure

fastn.com/
β”œβ”€β”€ ftd/                    # FTD Language docs (needs major updates)
β”œβ”€β”€ docs/                   # General documentation  
β”œβ”€β”€ get-started/           # Onboarding (needs review)
β”œβ”€β”€ examples/              # Code examples (expand)
β”œβ”€β”€ best-practices/        # Development practices (expand)  
β”œβ”€β”€ tutorial/              # Learning materials (update)
└── book/                  # fastn book (comprehensive review needed)

Issues Identified

  1. Outdated Content: Many .ftd files reference old syntax/features
  2. Incomplete Coverage: Missing comprehensive language specification
  3. Scattered Information: Design decisions not centralized
  4. Limited Examples: Need more practical, real-world examples
  5. Missing v0.5 Content: No documentation of new architecture

Proposed New Structure

1. Add v0.5 Development Hub

fastn.com/
β”œβ”€β”€ v0.5/                           # NEW: v0.5 development documentation
β”‚   β”œβ”€β”€ architecture/               # System architecture documents
β”‚   β”‚   β”œβ”€β”€ compiler-pipeline.ftd   # fastn-section β†’ fastn-unresolved β†’ fastn-resolved β†’ fastn-compiler flow
β”‚   β”‚   β”œβ”€β”€ rendering-engine.ftd    # fastn-runtime architecture
β”‚   β”‚   β”œβ”€β”€ terminal-rendering.ftd  # Terminal rendering design & specs
β”‚   β”‚   β”œβ”€β”€ css-semantics.ftd       # CSS-like property system
β”‚   β”‚   └── continuation-system.ftd # fastn-continuation architecture
β”‚   β”œβ”€β”€ design-decisions/           # Major design choices and rationale
β”‚   β”‚   β”œβ”€β”€ ssl-design.ftd          # SSL/TLS integration design
β”‚   β”‚   β”œβ”€β”€ automerge-integration.ftd # Automerge design decisions
β”‚   β”‚   β”œβ”€β”€ p2p-architecture.ftd    # P2P networking design
β”‚   β”‚   └── breaking-changes.ftd    # v0.4 β†’ v0.5 breaking changes
β”‚   β”œβ”€β”€ implementation-status/      # Current development status
β”‚   β”‚   β”œβ”€β”€ compiler-status.ftd     # What's implemented in compiler
β”‚   β”‚   β”œβ”€β”€ runtime-status.ftd      # Runtime implementation status
β”‚   β”‚   └── roadmap.ftd            # Development roadmap
β”‚   └── specifications/             # Technical specifications
β”‚       β”œβ”€β”€ terminal-rendering-spec.ftd # Comprehensive terminal rendering spec
β”‚       β”œβ”€β”€ css-property-mapping.ftd    # CSS property to terminal mapping
β”‚       └── component-behavior.ftd      # Component behavior specifications

2. Complete FTD 0.4 Language Specification (PRIORITY)

fastn.com/
β”œβ”€β”€ language-spec/                  # NEW: Comprehensive language specification for fastn 0.4
β”‚   β”œβ”€β”€ index.ftd                  # Language overview
β”‚   β”œβ”€β”€ syntax/                    # Syntax specification
β”‚   β”‚   β”œβ”€β”€ sections.ftd           # Section syntax rules
β”‚   β”‚   β”œβ”€β”€ headers.ftd            # Header syntax and semantics
β”‚   β”‚   β”œβ”€β”€ comments.ftd           # Comment syntax
β”‚   β”‚   └── grammar.ftd            # Complete BNF grammar
β”‚   β”œβ”€β”€ type-system/               # Type system specification
β”‚   β”‚   β”œβ”€β”€ primitive-types.ftd    # boolean, integer, decimal, string
β”‚   β”‚   β”œβ”€β”€ derived-types.ftd      # ftd.color, ftd.length, etc.
β”‚   β”‚   β”œβ”€β”€ records.ftd            # Record type definitions
β”‚   β”‚   β”œβ”€β”€ or-types.ftd           # Or-type definitions
β”‚   β”‚   └── type-inference.ftd     # Type inference rules
β”‚   β”œβ”€β”€ components/                # Component system
β”‚   β”‚   β”œβ”€β”€ definition.ftd         # Component definition syntax
β”‚   β”‚   β”œβ”€β”€ invocation.ftd         # Component invocation rules
β”‚   β”‚   β”œβ”€β”€ arguments.ftd          # Argument passing semantics
β”‚   β”‚   β”œβ”€β”€ children.ftd           # Children handling
β”‚   β”‚   └── inheritance.ftd        # Property inheritance rules
β”‚   β”œβ”€β”€ variables/                 # Variable system
β”‚   β”‚   β”œβ”€β”€ declaration.ftd        # Variable declaration rules
β”‚   β”‚   β”œβ”€β”€ scoping.ftd           # Scoping rules
β”‚   β”‚   β”œβ”€β”€ mutability.ftd        # Mutable vs immutable
β”‚   β”‚   └── references.ftd        # Variable references
β”‚   β”œβ”€β”€ functions/                 # Function system
β”‚   β”‚   β”œβ”€β”€ definition.ftd         # Function definition
β”‚   β”‚   β”œβ”€β”€ calls.ftd             # Function calls
β”‚   β”‚   β”œβ”€β”€ expressions.ftd       # Expression evaluation
β”‚   β”‚   └── built-ins.ftd         # Built-in functions
β”‚   └── modules/                   # Module system
β”‚       β”œβ”€β”€ imports.ftd           # Import semantics
β”‚       β”œβ”€β”€ exports.ftd           # Export rules
β”‚       β”œβ”€β”€ aliases.ftd           # Alias system
β”‚       └── package-system.ftd    # Package management

3. Enhanced Component Documentation

fastn.com/ftd/
β”œβ”€β”€ kernel-components/              # ENHANCED: Comprehensive kernel docs
β”‚   β”œβ”€β”€ text.ftd                   # Enhanced with more examples
β”‚   β”œβ”€β”€ column.ftd                 # Layout behavior, CSS mapping
β”‚   β”œβ”€β”€ row.ftd                    # Flexbox semantics
β”‚   β”œβ”€β”€ container.ftd              # Box model behavior
β”‚   β”œβ”€β”€ image.ftd                  # Media handling
β”‚   β”œβ”€β”€ video.ftd                  # Video component
β”‚   β”œβ”€β”€ audio.ftd                  # NEW: Audio component docs
β”‚   β”œβ”€β”€ checkbox.ftd               # Form controls
β”‚   β”œβ”€β”€ text-input.ftd             # Input handling
β”‚   β”œβ”€β”€ iframe.ftd                 # Embedded content
β”‚   β”œβ”€β”€ code.ftd                   # Code display
β”‚   β”œβ”€β”€ rive.ftd                   # Animation support
β”‚   β”œβ”€β”€ document.ftd               # Document root
β”‚   β”œβ”€β”€ desktop.ftd                # Device-specific rendering
β”‚   └── mobile.ftd                 # Mobile-specific behavior
β”œβ”€β”€ terminal-rendering/             # NEW: Terminal-specific documentation
β”‚   β”œβ”€β”€ overview.ftd               # Terminal rendering principles
β”‚   β”œβ”€β”€ ascii-art-layouts.ftd      # ASCII box-drawing specifications
β”‚   β”œβ”€β”€ ansi-color-support.ftd     # Color handling in terminals
β”‚   β”œβ”€β”€ responsive-terminal.ftd    # Adapting to terminal width
β”‚   └── interactive-elements.ftd   # Terminal interaction patterns

4. Comprehensive Examples & Tutorials

fastn.com/
β”œβ”€β”€ examples/                       # EXPANDED: Real-world examples
β”‚   β”œβ”€β”€ basic/                     # Simple component usage
β”‚   β”œβ”€β”€ layouts/                   # Layout patterns
β”‚   β”œβ”€β”€ forms/                     # Form building
β”‚   β”œβ”€β”€ interactive/               # Interactive components
β”‚   β”œβ”€β”€ responsive/                # Responsive design
β”‚   β”œβ”€β”€ terminal-apps/             # NEW: Terminal application examples
β”‚   └── full-applications/         # Complete application examples
β”œβ”€β”€ cookbook/                       # NEW: Common patterns and solutions
β”‚   β”œβ”€β”€ component-patterns/        # Reusable component patterns
β”‚   β”œβ”€β”€ layout-recipes/            # Common layout solutions
β”‚   β”œβ”€β”€ styling-techniques/        # Advanced styling
β”‚   └── performance-tips/          # Optimization techniques

Implementation Phases

Priority Order: Complete fastn 0.4 documentation first, then move to v0.5

Phase 1: fastn 0.4 Documentation Foundation (Week 1-2)

  1. βœ… Audit existing content - Identified outdated information in current fastn.com
  2. βœ… Write documentation standards - Established testing guidelines and debug cheat sheet in CLAUDE.md
  3. 🚧 Begin comprehensive FTD 0.4 language specification - PR READY: Complete framework at /spec/ with all 6 major sections
  4. βœ… Update existing kernel component docs - COMPLETED: Added missing ftd.audio component documentation

Phase 2: Complete fastn 0.4 Language Specification (Week 3-4)

  1. Finish comprehensive language specification - Expand existing framework with detailed content
  2. βœ… Enhanced component documentation - COMPLETED: Added ftd.audio, updated sitemap
  3. Create comprehensive examples library - Real-world usage patterns
  4. Write cookbook entries - Common patterns and solutions for 0.4

Phase 3: fastn 0.4 Polish & Community Ready (Week 5-6)

  1. Review and update all 0.4 content - Ensure consistency and accuracy
  2. Add interactive examples - Live code examples where possible
  3. Create learning paths - Guided learning sequences for fastn 0.4
  4. Community contribution guides - How to contribute to fastn documentation

Phase 4: Begin v0.5 Documentation (Week 7-8)

  1. Create v0.5 directory structure - Set up new documentation hierarchy
  2. Architecture documentation - Document v0.5 architecture decisions
  3. Design decision documentation - SSL, P2P, Automerge, terminal rendering design docs
  4. Create v0.5 specifications - Terminal rendering, CSS mapping, component behavior specs

Content Standards

Documentation Quality Standards

  1. Complete Examples - Every feature must have working examples
  2. ASCII Output Specs - Terminal rendering must show expected output
  3. Cross-References - Comprehensive linking between related concepts
  4. Version Compatibility - Clear indication of version requirements
  5. Testing Instructions - How to test/verify examples

Code Example Standards

-- ds.rendered: Example Title
  -- ds.rendered.input:
  
  \-- ftd.text: Hello World
  color: red
  
  -- ds.rendered.output:
  
    -- ftd.text: Hello World
    color: red
    
  -- end: ds.rendered.output

-- end: ds.rendered

-- ds.terminal-output: Terminal Rendering

Hello World (in red)


-- end: ds.terminal-output

File Organization Standards

  • .ftd extension for all documentation
  • Clear hierarchical structure
  • Consistent naming conventions
  • Index files for each directory
  • Cross-reference files for navigation

Success Metrics

  1. Completeness - 100% coverage of language features
  2. Accuracy - All examples tested against v0.5 codebase
  3. Usability - Clear navigation and discoverability
  4. Community Adoption - External contributions and feedback
  5. Developer Productivity - Faster onboarding and development

Progress Status (Updated 2025-09-08)

βœ… Completed

  • ftd.audio component documentation - Live at /ftd/audio/ and /book/audio/ with proper layout
  • Documentation testing standards - CLAUDE.md with build/test procedures and debugging cheat sheet
  • Language specification framework - Complete structure at /spec/ (6 sections)
  • Built-in types accuracy audit - Fixed 3 critical issues in built-in-types.ftd:
    • Corrected ftd.fetch-priority β†’ ftd.image-fetch-priority type name
    • Added 7 missing text-input-type variants (datetime, date, time, month, week, color, file)
    • Fixed vh/vw/vmin/vmax data types from integer to decimal
  • Built-in functions accuracy audit - Fixed 3 critical issues in built-in-functions.ftd:
    • Fixed insert_at function parameter order in implementation example
    • Corrected delete_at parameter name from 'v' to 'num'
    • Fixed copy-to-clipboard parameter name from 'text' to 'a'
  • Kernel component documentation audit - Systematically reviewed 12 components:
    • Added missing role attribute to ftd.text
    • Fixed fetch-priority type reference in ftd.image
    • Fixed copy-paste error in ftd.column description
    • Verified accuracy of 9 other kernel components (container, row, checkbox, text-input, video, iframe, code, desktop, mobile)

🚧 In Progress (PR Ready)

  • Language Specification - Branch: docs/language-specification-framework
    • All 6 major sections created: syntax, types, components, variables, functions, modules
    • Clean URL structure: /spec/section/
    • All pages tested and working
    • Ready for content expansion

πŸ“‹ Next Priority Tasks

Phase 1 Documentation Foundation - NEARLY COMPLETE:

  • βœ… Kernel component audit complete (12/12 components reviewed)
  • βœ… Major reference docs accurate (built-in-types, built-in-functions)
  • 🚧 Language specification framework ready for review

Phase 2 Candidates (Pick Next):

  1. Add missing built-in functions - Math/string functions found in audit but not documented
  2. Create comprehensive examples library - Real-world usage patterns
  3. Set up terminal rendering documentation structure - Prepare for v0.5 content
  4. Audit remaining documentation files - Review non-kernel components and guides

This plan transforms fastn.com into the definitive resource for fastn development, ensuring that design decisions are documented, specifications are comprehensive, and developers have the resources they need to be productive.