Skip to content

Commit

Permalink
generate supported site doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfriesen committed Aug 25, 2024
1 parent 7be1f70 commit 3308636
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 28 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
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 3308636

Please sign in to comment.