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

feat: add hjson #471

Merged
merged 3 commits into from May 22, 2023
Merged

feat: add hjson #471

merged 3 commits into from May 22, 2023

Conversation

AkaraChen
Copy link
Contributor

  • Add a test if possible

  • Format all commit messages with Conventional Commits

  • I have read docs for adding a language.

  • I have searched around and this is the most up-to-date, actively maintained version of the language grammar.

  • I have added a sample file that includes a variety of language syntaxes and succinctly captures the idiosyncrasy of a language. See docs for requirement.

@netlify
Copy link

netlify bot commented May 15, 2023

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit bd5fd48
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/646b0aae8d1e2400082df7bf
😎 Deploy Preview https://deploy-preview-471--shiki-matsu.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 settings.

Copy link
Collaborator

@octref octref left a comment

Choose a reason for hiding this comment

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

Just a small change needed. Thanks for your contribution!

@@ -165,6 +165,7 @@ export const githubGrammarSources: [string, string][] = [
['haml', 'https://github.com/karuna/haml-vscode/blob/master/syntaxes/haml.json'],
['haskell', 'https://github.com/octref/language-haskell/blob/master/syntaxes/haskell.json'],
['hcl', 'https://github.com/hashicorp/syntax/blob/main/syntaxes/hcl.tmGrammar.json'],
['hjson', 'https://raw.githubusercontent.com/hjson/textmate-hjson/master/Syntaxes/Hjson.tmLanguage'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Because of this:

export function convertGHURLToDownloadURL(ghURL: string) {
const oldPath = url.parse(ghURL).path
return 'https://raw.githubusercontent.com' + oldPath.replace('/blob/', '/')
}

You can use the URL directly:

https://github.com/textmate/json.tmbundle/blob/master/Syntaxes/JSON.tmLanguage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Edited.

@AkaraChen AkaraChen requested a review from octref May 22, 2023 06:25
@octref octref merged commit 91ceac7 into shikijs:main May 22, 2023
3 checks passed
@octref
Copy link
Collaborator

octref commented May 22, 2023

Looks great. Thanks!

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.

None yet

2 participants