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 file extensions support for major languages #1478

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

ybiquitous
Copy link
Contributor

@ybiquitous ybiquitous commented Jul 13, 2018

This adds aliases for file extensions of some major languages.

  • .coffee -> .coffeescript
  • .md -> .markdown
  • .py -> .python
  • .rb -> .ruby
  • .yml -> .yaml

Such as:

Prism.languages.js = Prism.languages.javascript;

Copy link
Member

@mAAdhaTTah mAAdhaTTah left a comment

Choose a reason for hiding this comment

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

Seems reasonable. @LeaVerou @Golmote any objections?

@mAAdhaTTah
Copy link
Member

@ybiquitous If you resolve this conflict, I'm good to merge this.

@ybiquitous ybiquitous force-pushed the add-extensions branch 2 times, most recently from 0a56232 to 4d76640 Compare December 3, 2018 01:54
@ybiquitous
Copy link
Contributor Author

@mAAdhaTTah Sorry late reply. 🙇

I merged right now, please check it when you have a time!

@RunDevelopment
Copy link
Member

@ybiquitous
Please also run gulp to generate the minified files.

This adds aliases for file extensions of some major languages.

- `.coffee` -> `.coffee`
- `.md` -> `.markdown`
- `.py` -> `.python`
- `.rb` -> `.ruby`
- `.yml` -> `.yaml`
@ybiquitous
Copy link
Contributor Author

@RunDevelopment Sorry, I pushed now minified version via gulp. 👍

@ybiquitous
Copy link
Contributor Author

By the way, what about thinking about auto-minification?

For example, Using lint-staged and husky can force to generate and commit minified files before commiting *.js files.

// package.json
{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged",
    }
  },
  "lint-staged": {
    "*.js": ["gulp", "git add"]
  }
}

@RunDevelopment RunDevelopment merged commit 0c8f650 into PrismJS:master Dec 3, 2018
@RunDevelopment
Copy link
Member

This certainly is an interesting option.

@mAAdhaTTah What do you think?

@ybiquitous ybiquitous deleted the add-extensions branch December 3, 2018 12:50
@mAAdhaTTah
Copy link
Member

@RunDevelopment I'm into it. We use that combo @ work without issues. We had also talked about introducing ESLint (#1483); might be worth bundling that together.

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

Successfully merging this pull request may close these issues.

3 participants