Skip to content

[FR] GitHub syntax highlighting for .prompt files #507

@yesudeep

Description

@yesudeep

Adding Official GitHub Syntax Highlighting for .prompt Files

To get native syntax highlighting for .prompt files on GitHub (beyond the current YAML fallback), you need to submit a Pull Request to the GitHub Linguist repository.

1. Information for languages.yml

Add the following entry to lib/linguist/languages.yml in the Linguist repository:

Dotprompt:
  type: programming
  color: "#ff5a00"
  extensions:
    - .prompt
  tm_scope: source.dotprompt
  ace_mode: text
  language_id: <NEW_ID> # Linguist maintainers will provide or you can pick a high random number

2. Grammar Reference

Linguist uses TextMate grammars. Point them to the grammar already defined in this repository:
packages/vscode/syntaxes/dotprompt.tmLanguage.json

3. Sample Files

Linguist requires sample files for testing. You should include 2-3 files from the examples/ directory in this repo, such as:

  • examples/basic.prompt
  • examples/history.prompt

These should be placed in samples/Dotprompt/ in the Linguist repository.

4. PR Process

  1. Fork github-linguist/linguist.
  2. Add the language definition to lib/linguist/languages.yml.
  3. Add the sample files to samples/Dotprompt/.
  4. Run their test suite (usually bundle exec rake test) to ensure the samples are correctly identified.
  5. Submit the PR.

Once the PR is merged and deployed by GitHub, you can remove the *.prompt linguist-language=yaml line from the root .gitattributes file in this repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions