Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate supported site doc
Browse files Browse the repository at this point in the history
jonfriesen committed Aug 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7be1f70 commit a387e65
Showing 6 changed files with 107 additions and 28 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -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

23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

6 changes: 1 addition & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -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?

48 changes: 48 additions & 0 deletions docs/SUPPORTED_SITES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Supported Websites and Features

This document is automatically generated based on the current configuration of QuickCite.

## 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 |
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
44 changes: 44 additions & 0 deletions scripts/generateSupportedSites.js
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit a387e65

Please sign in to comment.