

It’s important to pick scopes based on semantic meaning, rather than desired color.

Choose the same scope, or make up one that has the same base but is more “specific”. For each of the states and keywords in your syntax mode, find an analogous state from the default mode. It’s probably easiest to open one of the default syntax modes and work from that. You’ll need to do something similar to your syntax mode.
Coda2 update update#
You can see the update applied to Mustache.mode here. But how do I update a Coda 1 syntax mode to work with Coda 2? The new way is a ton better, eh? Cool story, bro. So Panic replaced it with a syntax style sheet (at least that’s what I assume. It doesn’t scale, and it’s not future-proof. That’s the equivalent to using tags to style text all over your website. With the old way, any time a any new syntax mode came along, we would have to update the theme and add a couple hundred lines of XML to color things correctly.
Coda2 update download#
If you want to see the difference, download any color scheme from this page and look at the source of the old-school. Edit it (don’t double click, or it will import) and check out all the style rules.īy using generic scopes ( ment, language.variable, etc) Panic made it so any color scheme could work with any syntax mode, provided the syntax mode uses the same basic scope names. Open Coda 2 preferences and export your current color scheme. To see all of the generic scopes available You could use scope="" as the scope for typecasting in a Java syntax mode, for example, and it would be highlighted using the most specific style available, in this case keyword.type. Your actual scopes can be more specific than this. Keyword.type // typehints, typecasting, etc

For example: constant // general case for any constantĬonstant.numeric // like an int or a floatĬ // this might be True or False or Nil or something This scope is then used by color themes to actually make your mode be colors.īecause color themes (and the preferences dialog) style generic versions of things, you want to use the same basic scope names as theĭefault themes. When you have a “state” or a “keyword” in your syntax mode, you can assign it a “scope” which is something like a CSS class. Like I said, this isn’t the perfect analogy, but it’s close enough to get the idea. Note that the examples above aren’t actually what the default syntax modes use, they’re simplified so they’re easier to grok. Now to make this pretty, you’d use CSS like this: delimiter īy using a more specific selector, we can have a general color as a base style, or a more specific color when needed. Might look something like this in our imaginary XML representation: