google / google/dotprompt

[FR] GitHub syntax highlighting for `.prompt` files

Open
#507 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Starlark
Stars
563
Forks
68
Avg merge
6m
Merged PRs (30d)
2

Description

# 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](https://github.com/github-linguist/linguist) repository.

## 1. Information for `languages.yml`

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

```yaml
Dotprompt:
type: programming
color: "#ff5a00"
extensions:
- .prompt
tm_scope: source.dotprompt
ace_mode: text
language_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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.