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 STL support and enable STAR highlighting #5924

Merged
merged 2 commits into from
May 30, 2022
Merged

Add STL support and enable STAR highlighting #5924

merged 2 commits into from
May 30, 2022

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented May 30, 2022

This pull-request combines two unrelated changes that both depend on recent changes pushed to language-etc (so it would've been a hassle to split them into separate PRs).

Description

  1. STL has been added as a recognised language.
    Technically, GitHub already supports .stl files in the form of an interactive viewer (both in the file-viewer and in fenced code-blocks). However, Linguist currently classifies these files as text. This PR adds STL as a first-class language, improving discoverability in code-search and enabling syntax highlighting in source view).

    The colour I chose, #373b5e, was averaged from a thumbnail of the cover for Automated Fabrication, which was the book that first documented the STL format.

  2. Syntax highlighting is enabled for the recently-added STAR format.
    A grammar for STAR files was added today in Alhadis/language-etc@42e30c8.

Checklist:

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories.
      For once, I didn't bother doing a code-search. I'm going on a limb and assuming that if GitHub went out of their way to add 3D viewer functionality specifically for .stl files (even when other formats are more deserving), then STL is probably plenty relevant enough already.

    • I have included a real-world usage sample.
      The various cube*.stl samples were all edited from the STL sample featured in GitHub's documentation.

    • I have included a change to the heuristics to distinguish my language from others using the same extension.
      Because .stl is a very common extension spanning a broad variety of uses, I've added it as a generic extension.

  • I am changing the source of a syntax highlighting grammar
  • I am updating a grammar submodule

GitHub already supports the rendering of `.stl` files in rendered markup
and the file-viewer. However, GitHub/Linguist currently classifies these
files as text, reducing their visibility in code searches and preventing
the "raw" mode of the file-viewer from displaying syntax highlighting.

This commit fixes that.
@Alhadis Alhadis requested a review from a team as a code owner May 30, 2022 08:40
@Alhadis Alhadis requested a review from lildude May 30, 2022 08:40
@Alhadis Alhadis merged commit 7f56617 into master May 30, 2022
@Alhadis Alhadis deleted the starry-stl branch May 30, 2022 13:37
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants