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

Sublime Syntax #863

Closed
TonioGela opened this issue Jun 9, 2021 · 4 comments
Closed

Sublime Syntax #863

TonioGela opened this issue Jun 9, 2021 · 4 comments

Comments

@TonioGela
Copy link
Contributor

Hello Casey, thanks for just!
I wondered whether you might want this just.sublime-syntax file I've been able to create from the the vscode tmLanguage one.
The reason I did it was to have the correct syntax highlighting for my blog that uses Zola as static site generator and that accepts this format of syntax-highlight files. If you want an example of how it works, here is it.

%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: Just
scope: source.just
contexts:
  main:
    - include: interpolate
    - include: comments
    - include: scripts
    - include: strings
    - include: assignments
    - include: recipeDefinition
    - include: keywords
  assignments:
    - match: '^(export[\s]?)?([a-zA-Z_][a-zA-Z0-9_-]*)='
      captures:
        1: storage.type.just
        2: variable.name.just
  comments:
    - match: '^#[^!].*'
      scope: comment.line.just
  interpolate:
    - match: '\{\{'
      push:
        - meta_scope: string.interpolated.just
        - match: '\}\}'
          pop: true
  keywords:
    - match: \b(arch|os|os_family|env_var|env_var_or_default)\b
      scope: keyword.control.just
  recipeDefinition:
    - match: '^(@)?([a-zA-Z_][a-zA-Z0-9_-]*)([a-zA-Z0-9=\s_-`''"]*):([\sa-zA-Z0-9_-]*).*$'
      captures:
        1: entity.name.function.just
        2: entity.name.function.just
        4: support.type.property-name.just
  scripts:
    - match: \s#\!
      comment: The #! lines within a recipe.
      push:
        - meta_scope: support.type.property-name.just
        - match: $
          pop: true
  strings:
    - match: '`'
      push:
        - meta_scope: string.quoted.triple.just
        - match: '`'
          pop: true
    - match: '"'
      push:
        - meta_scope: string.quoted.double.just
        - match: '"'
          pop: true
    - match: "'"
      push:
        - meta_scope: string.quoted.single.just
        - match: "'"
          pop: true
@casey
Copy link
Owner

casey commented Jun 10, 2021

Awesome blog post! You go into a lot of detail and cover lots of interesting use-cases, which is great. Do you mind if I link to it from the readme? I think it would make a great companion to the rest of the documentation.

And thanks for the Sublime Text syntax file too ^_^ I opened #864 to add it to the extras directory, and mention it in the readme.

@casey
Copy link
Owner

casey commented Jun 10, 2021

that depend on environment variables defined in the .profile of a deleted user.

😂

@TonioGela
Copy link
Contributor Author

Awesome blog post! You go into a lot of detail and cover lots of interesting use-cases, which is great. Do you mind if I link to it from the readme? I think it would make a great companion to the rest of the documentation.

Of course! I'll be honored :)

And thanks for the Sublime Text syntax file too ^_^ I opened #864 to add it to the extras directory, and mention it in the readme.

🙏🏻

@casey
Copy link
Owner

casey commented Jun 10, 2021

Added in #866. Thanks again!

@casey casey closed this as completed Jun 10, 2021
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

No branches or pull requests

2 participants