-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7be1f70
commit 3dcca01
Showing
6 changed files
with
118 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!-- DO NOT EDIT; FILE IS GENERATED --> | ||
|
||
# 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 | | ||
|
||
|
||
- Domain: `instagram.com` | ||
- Default Prefix: 📸 | ||
|
||
| Page Type | Description | | ||
|-----------|-------------| | ||
| Profile | Supports profile pages | | ||
|
||
|
||
- 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 | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import fs from 'fs/promises' | ||
import path from 'path' | ||
import siteConfigs from '../src/content/config.js' | ||
|
||
async function generateSupportedSitesMarkdown() { | ||
let markdownContent = '<!-- DO NOT EDIT; FILE IS GENERATED -->\n\n' | ||
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() |