All files / coherent.js/website/src/pages DocsPage.js

0% Statements 0/316
0% Branches 0/1
0% Functions 0/1
0% Lines 0/316

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
// DocsPage.js - Enhanced documentation page with search and navigation
export function DocsPage({ title, html }) {
  return {
    section: {
      className: 'docs-page',
      children: [
        // Header
        { 
          div: { 
            className: 'docs-header', 
            children: [
              { h1: { className: 'docs-title', text: title || 'Documentation' } }
            ]
          }
        },
        
        // Main content
        { 
          div: { 
            className: 'docs-content',
            children: [
              // We inject pre-rendered, trusted HTML from our markdown renderer  
              { div: { className: 'markdown-body', innerHTML: () => html } }
            ]
          }
        }
      ]
    }
  };
}
 
// Enhanced DocsIndexPage for the main documentation landing page
export function DocsIndexPage() {
  return {
    section: {
      className: 'docs-index-page',
      children: [
        // Hero section
        {
          div: {
            className: 'docs-hero',
            children: [
              { h1: { className: 'docs-hero-title', text: 'Documentation' } },
              { 
                div: { 
                  className: 'docs-hero-description', 
                  children: [
                    {
                      p: {
                        text: 'Coherent.js is a high-performance server-side rendering framework that lets you build components using pure JavaScript objects. No JSX, no complex build stepsβ€”just clean, readable code that renders blazingly fast.'
                      }
                    },
                    {
                      p: {
                        text: 'This documentation will guide you through everything from basic concepts to advanced patterns. Use the search above to quickly find what you need, or explore the sections below to learn systematically.'
                      }
                    }
                  ]
                } 
              }
            ]
          }
        },
 
        // Quick start section
        {
          section: {
            className: 'docs-section',
            children: [
              { h2: { text: 'πŸš€ Getting Started' } },
              { p: { text: 'New to Coherent.js? Start here to get up and running quickly.' } },
              {
                div: {
                  className: 'docs-cards',
                  children: [
                    {
                      a: {
                        href: 'docs/getting-started',
                        className: 'docs-card docs-card-primary',
                        children: [
                          { h3: { text: '⚑ Quick Start' } },
                          { p: { text: 'Get up and running in 5 minutes with our quick start guide.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/getting-started/installation',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ“¦ Installation' } },
                          { p: { text: 'Detailed setup instructions for all environments.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/migration-guide',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ”„ Migration Guide' } },
                          { p: { text: 'Coming from React, Vue, or another framework? Start here.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
 
        // Core concepts section
        {
          section: {
            className: 'docs-section',
            children: [
              { h2: { text: '🧩 Core Concepts' } },
              { p: { text: 'Master the fundamentals of building components with Coherent.js.' } },
              {
                div: {
                  className: 'docs-cards',
                  children: [
                    {
                      a: {
                        href: 'docs/components/basic-components',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ—οΈ Basic Components' } },
                          { p: { text: 'Learn the object syntax and component fundamentals.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/components/state-management',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ”„ State Management' } },
                          { p: { text: 'Reactive components with the withState HOC.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/client-side-hydration-guide',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ’§ Hydration' } },
                          { p: { text: 'Make your components interactive on the client.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
 
        // Advanced topics section  
        {
          section: {
            className: 'docs-section',
            children: [
              { h2: { text: '⚑ Advanced Topics' } },
              { p: { text: 'Deep dive into advanced patterns and production-ready features.' } },
              {
                div: {
                  className: 'docs-cards',
                  children: [
                    {
                      a: {
                        href: 'docs/components/advanced-components',
                        className: 'docs-card',
                        children: [
                          { h3: { text: '🎯 Advanced Components' } },
                          { p: { text: 'HOCs, composition patterns, and complex architectures.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/performance-optimizations',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸš€ Performance' } },
                          { p: { text: 'Optimization strategies and caching techniques.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/deployment-guide',
                        className: 'docs-card',
                        children: [
                          { h3: { text: '☁️ Deployment' } },
                          { p: { text: 'Production deployment with Docker, Kubernetes, and more.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
 
        // Integration section
        {
          section: {
            className: 'docs-section',
            children: [
              { h2: { text: 'πŸ”— Integration & Frameworks' } },
              { p: { text: 'Use Coherent.js with your favorite frameworks and tools.' } },
              {
                div: {
                  className: 'docs-cards',
                  children: [
                    {
                      a: {
                        href: 'docs/framework-integrations',
                        className: 'docs-card',
                        children: [
                          { h3: { text: '🌐 Framework Integrations' } },
                          { p: { text: 'Express, Fastify, Next.js, Koa, and more.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/database-integration',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ—„οΈ Database Integration' } },
                          { p: { text: 'Work with databases and query builders.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/security-guide',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ›‘οΈ Security' } },
                          { p: { text: 'Security best practices and guidelines.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
 
        // Reference section
        {
          section: {
            className: 'docs-section',
            children: [
              { h2: { text: 'πŸ“– Reference & Examples' } },
              { p: { text: 'Complete API documentation and practical examples.' } },
              {
                div: {
                  className: 'docs-cards',
                  children: [
                    {
                      a: {
                        href: 'docs/api-reference',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ“‹ API Reference' } },
                          { p: { text: 'Complete function documentation and signatures.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'docs/DOCS_INDEX',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ“š Complete Index' } },
                          { p: { text: 'Organized access to all documentation.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    },
                    {
                      a: {
                        href: 'examples',
                        className: 'docs-card',
                        children: [
                          { h3: { text: 'πŸ’‘ Examples' } },
                          { p: { text: 'Real-world examples and code samples.' } },
                          { span: { className: 'docs-card-arrow', text: 'β†’' } }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  };
}