diff --git a/.gitignore b/.gitignore index 221415a..d7051ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vendor _site .jekyll-cache +.claude diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e9523bb --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,34 @@ +# Awesome Reviewers Repository Guidelines + +## Repository Structure & Technology Stack + +### Technology Stack +- **GitHub Pages** repository +- **Jekyll** static site generator +- **GitHub Actions** for CI/CD +- Raw HTML with Jekyll templating + +### Key Pages & Layouts +1. **Root Page** (`/`) + - Managed in `_layouts/default.html` + - Main landing page with reviewer grid + +2. **Reviewer Detail Page** (`/reviewers/{slug}/`) + - Managed in `_layouts/reviewer.html` + - Individual reviewer drawer/detail view + +### Directory Structure +- **Assets**: `assets/` + - CSS files: `assets/css/` + - Images: `assets/images/` + +- **Content**: `_reviewers/` + - Individual reviewer prompt files + - Contains all the reviewer data and prompts + +### Development Notes +- This is a Jekyll-based GitHub Pages site +- Changes to layouts, CSS, or reviewer content require Jekyll rebuild +- GitHub Actions handles the build and deployment process +- All styling should be done in the CSS files under `assets/css/` +- Reviewer content is stored as individual files in `_reviewers/` directory \ No newline at end of file diff --git a/README.md b/README.md index 1a26b25..0234ff6 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@
-πŸ“ **474** Reviewers   β€’   πŸ’¬ **Thousands** of Discussions   β€’   ⭐ Popular OSS repositories   β€’   πŸš€ **15+** Languages +πŸ“ **1K+** Reviewers   β€’   πŸ’¬ **Thousands** of Discussions   β€’   ⭐ Popular OSS repositories   β€’   πŸš€ **15+** Languages
## Features -* **🎯 Hundreds of Curated Prompts:** Over 470 specialized review prompts covering many languages and frameworks. Each prompt is distilled from actual pull request comments, ensuring practical, actionable advice grounded in real code review scenarios. +* **🎯 1K+ Curated Prompts:** Over 1,000 specialized review prompts covering many languages and frameworks. Each prompt is distilled from actual pull request comments, ensuring practical, actionable advice grounded in real code review scenarios. * **πŸ“Š Real Open-Source Insights:** Every reviewer includes context from the open-source repository it came from, including a link to the source repo and stats like how many times that feedback appeared and the repo’s popularity. This transparency helps you trust the guidance – it’s based on patterns that occurred in high-quality projects (e.g. a prompt might note **9** prior comments advocating a rule in a project with **16k⭐** on GitHub). In short, these AI prompts encapsulate community-agreed best practices. diff --git a/_layouts/default.html b/_layouts/default.html index 8e563f9..ff5fb43 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -10,6 +10,8 @@ + +
@@ -424,6 +426,10 @@ content.innerHTML = html; } drawer.classList.add('open'); + // Highlight any code blocks in the newly loaded content + if (typeof highlightNewContent === 'function') { + highlightNewContent(content); + } }); } @@ -545,13 +551,85 @@ } } + function htmlToMarkdown(element) { + let markdown = ''; + + function processNode(node) { + if (node.nodeType === Node.TEXT_NODE) { + return node.textContent; + } + + if (node.nodeType === Node.ELEMENT_NODE) { + const tagName = node.tagName.toLowerCase(); + const children = Array.from(node.childNodes).map(processNode).join(''); + + switch (tagName) { + case 'h1': return `# ${children}\n\n`; + case 'h2': return `## ${children}\n\n`; + case 'h3': return `### ${children}\n\n`; + case 'h4': return `#### ${children}\n\n`; + case 'h5': return `##### ${children}\n\n`; + case 'h6': return `###### ${children}\n\n`; + case 'p': return `${children}\n\n`; + case 'strong': case 'b': return `**${children}**`; + case 'em': case 'i': return `*${children}*`; + case 'code': + // Check if this is inline code or part of a pre block + if (node.parentElement && node.parentElement.tagName.toLowerCase() === 'pre') { + return children; + } + return `\`${children}\``; + case 'pre': + const codeElement = node.querySelector('code'); + if (codeElement) { + // Extract language from class (e.g., 'language-python' -> 'python') + const languageMatch = codeElement.className.match(/(?:language-|hljs-)(\w+)/); + const language = languageMatch ? languageMatch[1] : ''; + return `\`\`\`${language}\n${codeElement.textContent}\n\`\`\`\n\n`; + } + return `\`\`\`\n${children}\n\`\`\`\n\n`; + case 'ul': + return `${children}\n`; + case 'ol': + return `${children}\n`; + case 'li': + const parent = node.parentElement; + if (parent.tagName.toLowerCase() === 'ol') { + // For ordered lists, we'll use '1.' for simplicity + return `1. ${children}\n`; + } else { + return `- ${children}\n`; + } + case 'blockquote': + return children.split('\n').map(line => `> ${line}`).join('\n') + '\n\n'; + case 'br': + return '\n'; + default: + return children; + } + } + + return ''; + } + + markdown = processNode(element); + + // Clean up extra newlines + markdown = markdown.replace(/\n{3,}/g, '\n\n').trim(); + + return markdown; + } + function copyPrompt() { const promptContent = document.getElementById('prompt-content'); const copyButton = document.querySelector('.copy-button'); const copyText = document.getElementById('copy-text'); + // Convert HTML content back to markdown format + const markdownContent = htmlToMarkdown(promptContent); + const textarea = document.createElement('textarea'); - textarea.value = promptContent.textContent; + textarea.value = markdownContent; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); @@ -605,6 +683,8 @@ } {% include modal.html %} + + diff --git a/_layouts/reviewer.html b/_layouts/reviewer.html index bdeb268..07d7bfa 100644 --- a/_layouts/reviewer.html +++ b/_layouts/reviewer.html @@ -60,7 +60,7 @@ layout: default -
{{ content | strip }}
+
{{ content }}
@@ -80,14 +80,86 @@ layout: default