(issueNumber)
| 397 | } |
| 398 | |
| 399 | async getCssArticle(issueNumber) { |
| 400 | debugLog(`📖 Getting article #${issueNumber}`); |
| 401 | |
| 402 | return new Promise((resolve, reject) => { |
| 403 | this.db.get( |
| 404 | 'SELECT * FROM issues WHERE number = ?', |
| 405 | [issueNumber], |
| 406 | (err, row) => { |
| 407 | if (err) { |
| 408 | debugLog(`❌ Database error for article #${issueNumber}:`, err); |
| 409 | reject(err); |
| 410 | return; |
| 411 | } |
| 412 | |
| 413 | if (!row) { |
| 414 | debugLog(`❌ Article #${issueNumber} not found`); |
| 415 | reject(new Error(`Article with issue number ${issueNumber} not found`)); |
| 416 | return; |
| 417 | } |
| 418 | |
| 419 | debugLog(`✅ Found article #${issueNumber}: "${row.title}"`); |
| 420 | |
| 421 | const htmlContent = marked(row.body || ''); |
| 422 | const labels = row.labels ? JSON.parse(row.labels) : []; |
| 423 | |
| 424 | resolve({ |
| 425 | content: [ |
| 426 | { |
| 427 | type: 'text', |
| 428 | text: `# ${row.title}\n\n` + |
| 429 | `**Issue #${row.number}** | **Updated:** ${new Date(row.updated_at).toLocaleDateString()}\n\n` + |
| 430 | `**Tags:** ${labels.join(', ')}\n\n` + |
| 431 | `**GitHub Link:** ${row.html_url}\n\n` + |
| 432 | `---\n\n${row.body}` |
| 433 | } |
| 434 | ] |
| 435 | }); |
| 436 | } |
| 437 | ); |
| 438 | }); |
| 439 | } |
| 440 | |
| 441 | async searchCssDemos(query, category, difficulty, limit = 5) { |
| 442 | debugLog(`🎨 Searching CSS demos with query: "${query}"`); |
no test coverage detected