Giter Site home page Giter Site logo

singularityhub / language-singularity Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 93 KB

Singularity syntax highlighting support for Atom

License: GNU Affero General Public License v3.0

JavaScript 100.00%
singularity-container atom editor syntax highlighter

language-singularity's Introduction

Singularity Language

This repository provides a small package to help with syntax highlighting of Singularity recipe files in the Atom editor. The package is published on apm and can be updated as needed.

  • Grammars: contains the definition of rules and highlights, with details provided below.
  • Settings: additional settings

Note that for files that are named Singularity.* (with a Singularity prefix and a custom extension to indicate a tag) the highlighter is activated on save, or on change of the title. The others that are named just Singularity or end in .def are rendered on load. Thus, if you open a file called Singularity.<extension> and it doesn't highlight right away, just save it and it will trigger the event. The syntax is fairly simple thus far, and looks like this:

img/example-singularity.png

Please contribute by issuing a pull request to this repository!

How to develop

The package itself, as an "official package," should be published, but you can easily clone this repository and put it in your $HOME/.atom/packages folder (and maintain the name starting with language- to have it be discovered. You should likely restart your editor, and then save a file that ends in def or has Singularity.

Acknowledgements

Most of the guidance for the regular expressions is taken from language-docker that has very similar syntax highlighting.

language-singularity's People

Contributors

tsnowlan avatar vsoch avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tsnowlan

language-singularity's Issues

Cannot read property 'getBuffer' of undefined

Hello there,
I just want to report an error I have once installed language singularity on my atom.

[Enter steps to reproduce:]

Atom: 1.53.0 x64
Electron: 6.1.12
OS: macOS 11.0.1
Thrown From: language-singularity package 2.1.0

Stack Trace

TypeError: Cannot read property 'getBuffer' of undefined

At Cannot read property 'getBuffer' of undefined

TypeError: Cannot read property 'getBuffer' of undefined
    at Object.setGrammar (/packages/language-singularity/lib/main.js:36:29)
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1190051)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1191492)
    at Workspace.open (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:433138)
    at ao (/packages/markdown-preview-plus/dist/main.js:1:209821)

Commands

     -0:18.1.0 markdown-preview-plus:toggle (input.hidden-input)

Non-Core Packages

atom-language-r 1.4.8 
ftp-remote-edit-plus 1.2.0 
language-singularity 2.1.0 
markdown-preview-plus 4.8.4 

recognize all filetypes as a singularity file

Hi there !

Great package, except it recognize all filetypes as a singularity file after making a save action (ctrl-s for exemple). Everything's correct with package disabled.

I'll be happy to debug on my own but I don't know how.
Thank you !

Add support for Singularity.* filetypes.

I tend to name my recipes files as Singularity.foo so would be good to get the grammar to detect these files. I tried adding Singularity. and also Singularity.* to the fileTypes array but didn't work.
I will keep trying to see if I can get this working.
Happy to give this up though if that naming convention is considered bad form?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.