Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add funding links to package data, READMEs, and playground #116

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jtbandes
Copy link
Contributor

@jtbandes jtbandes commented Jan 25, 2025

Proposal to implement the first part of shikijs/shiki#906:

  • Fetch /repos/{owner}/{repo}/contents/.github/FUNDING.yml
  • If that doesn't exist, fetch /repos/{owner}/.github/contents/FUNDING.yml
  • Add .funding to GrammarInfo/ThemeInfo
  • Add funding links to package READMEs
  • Add funding links to playground app

If you wanted to display the same links on shiki.style, is there a better place to put the formatting code so it can be reused?

Example:

image image

@@ -1,10 +1,27 @@
/** https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository */
export interface FundingInfo {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any shared dependency for these packages, so I had to copy/paste the type definition. Let me know if there's a preferred alternative.

Copy link

netlify bot commented Jan 25, 2025

Deploy Preview for textmate-grammars-themes ready!

Name Link
🔨 Latest commit bf33b4b
🔍 Latest deploy log https://app.netlify.com/sites/textmate-grammars-themes/deploys/679e74a16363b20008ed61f0
😎 Deploy Preview https://deploy-preview-116--textmate-grammars-themes.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -3913,6 +4015,9 @@ export const injections = [
embeddedIn: [
'ts-tags',
],
funding: {
ko_fi: 26,
Copy link
Contributor Author

@jtbandes jtbandes Jan 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These numbers are due to an error in the upstream YAML file. I submitted a PR to fix: 0x00000001A/es6-string-html#66

I could consider manually excluding these for now

playground/src/App.vue Outdated Show resolved Hide resolved
@jtbandes jtbandes changed the title Add funding links to package data and READMEs Add funding links to package data, READMEs, and playground Jan 25, 2025
@@ -18,6 +24,7 @@ export interface GrammarInfo {
aliases?: string[]
licenseUrl?: string
license?: string
funding?: FundingLink[]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouldn't ever be undefined, except the custom source function for ts-tags is causing it to be undefined sometimes so I just adjusted the type definition since I wasn't sure how to fix that properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants