diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 6d116df..aa64269 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -22,6 +22,17 @@ jobs: - name: Run unit tests run: npm run test + - name: Generate docs and check for changes + run: | + npm run generate-docs + if git diff --exit-code docs/SUPPORTED_SITES.md; then + echo "No changes detected in SUPPORTED_SITES.md" + else + echo "SUPPORTED_SITES.md is out of date. Please run 'npm run generate-docs' and commit the changes." + git diff docs/SUPPORTED_SITES.md + exit 1 + fi + - name: Install Playwright browsers run: npx playwright install --with-deps diff --git a/README.md b/README.md index 22914d4..13a8342 100644 --- a/README.md +++ b/README.md @@ -11,28 +11,7 @@ QuickCite is a Chrome extension designed to enhance productivity by allowing use - Configurable site-specific prefixes - Enable/disable functionality for specific sites -### Supported Websites - -Want support for more sites? Please [submit an issue](https://github.com/jonfriesen/quickcite/issues) to request additional website support! - -| Website | Sub-page | -| ------------- | ----------------- | -| **GitHub** | | -| | Pull Request | -| | Issue | -| | Discussion | -| | Repository | -| | User/Organization | -| | Release | -| | Actions | -| **Instagram** | | -| | Profile | -| **LinkedIn** | | -| | Profile | -| | Company | -| | Pulse Article | -| **Trello** | | -| | Boards | +For a detailed list of supported websites and features, please see our [Supported Sites](docs/SUPPORTED_SITES.md) document. ## Installation diff --git a/docs/FAQ.md b/docs/FAQ.md index 7f911dc..b2e4b9d 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -8,11 +8,7 @@ QuickCite is a Chrome extension that allows you to quickly copy formatted inform ### Which websites does QuickCite support? -Currently, QuickCite supports: - -- GitHub (repositories, issues, pull requests, discussions, user profiles) -- LinkedIn (user profiles, company pages, articles) -- Instagram (user profiles) +See our [Supported Sites](SUPPORTED_SITES.md) document. ### How do I use QuickCite? diff --git a/docs/SUPPORTED_SITES.md b/docs/SUPPORTED_SITES.md new file mode 100644 index 0000000..b37863c --- /dev/null +++ b/docs/SUPPORTED_SITES.md @@ -0,0 +1,56 @@ +# Supported Websites and Features + +This document is automatically generated based on the current configuration of QuickCite. + +## Table of Contents + +- [Github](#github) +- [Instagram](#instagram) +- [Linkedin](#linkedin) +- [Trello](#trello) + +## Github + +- Domain: `github.com` +- Default Prefix: 🐙 + +| Page Type | Description | +|-----------|-------------| +| Pr | Supports pr pages | +| Issue | Supports issue pages | +| Discussion | Supports discussion pages | +| Repo | Supports repo pages | +| User | Supports user pages | +| Release | Supports release pages | +| Commit | Supports commit pages | +| Actions | Supports actions pages | + +## Instagram + +- Domain: `instagram.com` +- Default Prefix: 📸 + +| Page Type | Description | +|-----------|-------------| +| Profile | Supports profile pages | + +## Linkedin + +- Domain: `linkedin.com` +- Default Prefix: 💼 + +| Page Type | Description | +|-----------|-------------| +| Profile | Supports profile pages | +| Company | Supports company pages | +| Pulse | Supports pulse pages | + +## Trello + +- Domain: `trello.com` +- Default Prefix: 📋 + +| Page Type | Description | +|-----------|-------------| +| Board | Supports board pages | + diff --git a/package.json b/package.json index d4c8e8f..84ce39f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "release": "bash scripts/bump_version.sh", "release_verify": "bash scripts/prerelease_check.sh", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules node_modules/jest/bin/jest.js --testPathIgnorePatterns=\\.e2e\\.test\\.js$", - "e2e": "playwright test" + "e2e": "playwright test", + "generate-docs": "node scripts/generateSupportedSites.js" }, "keywords": [ "github", diff --git a/scripts/generateSupportedSites.js b/scripts/generateSupportedSites.js new file mode 100644 index 0000000..9384a08 --- /dev/null +++ b/scripts/generateSupportedSites.js @@ -0,0 +1,44 @@ +import fs from 'fs/promises' +import path from 'path' +import siteConfigs from '../src/content/config.js' + +async function generateSupportedSitesMarkdown() { + let markdownContent = '# Supported Websites and Features\n\n' + markdownContent += 'This document is automatically generated based on the current configuration of QuickCite.\n\n' + + // Generate table of contents + markdownContent += '## Table of Contents\n\n' + for (const siteName of Object.keys(siteConfigs)) { + markdownContent += `- [${capitalize(siteName)}](#${siteName.toLowerCase()})\n` + } + markdownContent += '\n' + + for (const [siteName, siteConfig] of Object.entries(siteConfigs)) { + markdownContent += `## ${capitalize(siteName)}\n\n` + markdownContent += `- Domain: \`${siteConfig.domain}\`\n` + markdownContent += `- Default Prefix: ${siteConfig.prefix}\n\n` + markdownContent += '| Page Type | Description |\n' + markdownContent += '|-----------|-------------|\n' + + for (const [pageType, pageConfig] of Object.entries(siteConfig.pages)) { + markdownContent += `| ${capitalize(pageType)} | ${getPageDescription(pageType, pageConfig)} |\n` + } + + markdownContent += '\n' + } + + const outputPath = path.join(process.cwd(), 'docs', 'SUPPORTED_SITES.md') + await fs.writeFile(outputPath, markdownContent, 'utf8') + console.log(`Supported sites markdown generated at ${outputPath}`) +} + +function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1) +} + +function getPageDescription(pageType, pageConfig) { + // TODO: Add descriptions that are more accurate + return `Supports ${pageType} pages` +} + +generateSupportedSitesMarkdown()