GithubHelp home page GithubHelp logo

Curly brackets and % about atom HOT 3 CLOSED

mkschulze avatar mkschulze commented on June 12, 2024
Curly brackets and %

from atom.

Comments (3)

mikemcbride avatar mikemcbride commented on June 12, 2024 1

Thanks for the feedback and the screenshots! Super helpful.

There's only so much I can do from a syntax-theming perspective, and I've run into the same thing with other HTML templating languages. What you probably want to do is install a package that adds support for a new grammar, which is what the editor uses to add the syntax highlighting classes to your code. For the HTML templating, something like the django-templates package is probably what you need. Here is a snippet of your same code above after installing that package:

image

As is the case with any grammar package like that, you'll either have to do some configuration in the settings to tell it when to apply Django template syntax vs regular HTML syntax, or you'll have to manually set the syntax per-file.


Re: the Python syntax highlighting... this is unfortunately not something I have control over. Upon inspecting the code elements, those strings of text are not differentiated in the python language grammar, so it won't add separate classes to them. That would likely involve a PR in the language-python repo.

However, the = operator I do have control over. I actually style it differently for JavaScript files, but it appears they have added a class (syntax--assignment) that gives me more control over the style of that operator in all languages. I'll dig into that and do some testing to make sure it all looks solid, but that would be a super quick enhancement and definitely something I'd like to add in. Look for a PR shortly!

If you think that works, let me know and I'll close this issue when I merge that PR 😄

Thanks again for the feedback!

from atom.

mikemcbride avatar mikemcbride commented on June 12, 2024

Hey @Lucid-Network - what language specifically is missing this? Could you provide a screenshot? I'd be happy to get that in.

from atom.

mkschulze avatar mkschulze commented on June 12, 2024

Hi!

So i am working with the web framework django and whenever i want to do some string substitution i have to include this:

{% something %}
and
{{ block.super }}

So if that is even possible it would be really awesome to make Atom color these, whenever it is written {% and {{ .

Here is a screenshot from a HTML document.
bildschirmfoto 2017-10-23 um 06 29 50

Also there is some room for further coloring in python, like:

bildschirmfoto 2017-10-23 um 06 30 31

Maybe here it would make sense to color the = symbol and also what is written after a . like

name = models.CharField(max_length=120)

Thanks a lot!
Mark

from atom.

Related Issues (7)

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.