Home Download Buy Blog Forum Support

Code coloring for html tags like TABLE and INPUT

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Tue Dec 10, 2013 2:32 am

Anyone?
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby subhaze on Tue Dec 10, 2013 2:57 pm

For OS X they're in Application/Sublime \Text/Contents/MacOS/Packages/*.sublime-package

From there you need to rename to *.zip and them you can open them up.
subhaze
 
Posts: 239
Joined: Tue Apr 09, 2013 3:22 am

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Wed Dec 18, 2013 7:40 pm

Thanks for that. I'm using Windows, but the instructions were the same. Named the file HTML.sublime-package file with .zip and then extracted it and low and behold there is the HTML.tmLanguage file.

I added my definitions the same as I did in Sublime Text 2, saved it, but nothing happened, the syntax coloring is't working. I put an underscore in front of the HTML.sublime-package file and tried again, this time getting an error when I tried to open an HTML file:

Error loading syntax file "Packages/HTML/HTML.tmLanguage": Unable to open Packages/HTML.tmLanguage


Not sure what to do here. Do I need to recompile my changes back into the HTML.sublime-package file? Or? What am I missing here?
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Wed Dec 18, 2013 7:59 pm

I tried adding the modified HTML.tmLanguage file back to the HTML.sublime-package.zip file and then removed the .zip and it loads fine now, but my colors aren't being applied :(

The scope for the tags using ScopeHunter looks the same in Sublime 3 as it does in 2 so I'm completely lost as to why it's not working.

So much agro for something that should be so simple.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Mon Dec 23, 2013 2:52 pm

Anyone know how to get this working? I'm trying to uniquely colour IMG, FORM and TABLE tags in Sublime Text 3 but the same technique I used successfully in Sublime 2 isn't working.

As always, any help would be greatly appreciated!
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby jellyalex978 on Wed Dec 25, 2013 6:04 pm

ST3 still beta , i dont like beta , in my work XD
so ~ sorry , i can not help you

but ...

in ST3
Sublime Text 3/Packages/HTML.sublime-package
you can open it , use the zip app like 7-zip

then you can see the "HTML.tmLanguage"

but i am not sure , we can change this XD
so good luck

XD
jellyalex978
 
Posts: 3
Joined: Fri Nov 15, 2013 2:09 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Sun Feb 02, 2014 4:43 pm

Yeah, I did that as I described above, but no love. It just doesn't work. Is it a bug? A beta issue? Kind of strange. I really would like to use 3 for the added features, but I'm quite happy with, and have got used to, my syntax colouring in 2, so I'm conflicted. I just really wish I could get this working.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby skuroda on Sun Feb 02, 2014 6:30 pm

If you create a file with the same name, and the same package in the Packages directory, it'll override the sublime-package file. I wrote https://github.com/skuroda/PackageResourceViewer to assist with the tasks. Simply use the plugin to open the file, make your changes, and save. It'll place the file in the proper location to override the existing file.
skuroda
 
Posts: 687
Joined: Fri Oct 05, 2012 8:11 am

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Mon Mar 03, 2014 7:36 pm

I really need to check back here more often. Thanks for the info skuroda. I'll give it a try.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

Re: Code coloring for html tags like TABLE and INPUT

Postby Fatbat on Mon Mar 03, 2014 7:54 pm

Still not working for me. This is the code I have in my HTML.tmLanguage file to define the scope for adding custom colours to img, form and table tags...

Code: Select all
<dict>
         <key>begin</key>
         <string>(&lt;/?)((?i:table|thead|tbody|tfoot|tr|th|td)\b)</string>
         <key>beginCaptures</key>
         <dict>
            <key>1</key>
            <dict>
               <key>name</key>
               <string>punctuation.definition.tag.table.begin.html</string>
            </dict>
            <key>2</key>
            <dict>
               <key>name</key>
               <string>entity.name.tag.table.html</string>
            </dict>
         </dict>
         <key>end</key>
         <string>(&gt;)</string>
         <key>endCaptures</key>
         <dict>
            <key>1</key>
            <dict>
               <key>name</key>
               <string>punctuation.definition.tag.table.end.html</string>
            </dict>
         </dict>
         <key>name</key>
         <string>meta.tag.table.html</string>
         <key>patterns</key>
         <array>
            <dict>
               <key>include</key>
               <string>#tag-stuff</string>
            </dict>
         </array>
      </dict>

      <dict>
         <key>begin</key>
         <string>(&lt;/?)((?i:img)\b)</string>
         <key>beginCaptures</key>
         <dict>
            <key>1</key>
            <dict>
               <key>name</key>
               <string>punctuation.definition.tag.img.begin.html</string>
            </dict>
            <key>2</key>
            <dict>
               <key>name</key>
               <string>entity.name.tag.img.html</string>
            </dict>
         </dict>
         <key>end</key>
         <string>(&gt;)</string>
         <key>endCaptures</key>
         <dict>
            <key>1</key>
            <dict>
               <key>name</key>
               <string>punctuation.definition.tag.img.end.html</string>
            </dict>
         </dict>
         <key>name</key>
         <string>meta.tag.img.html</string>
         <key>patterns</key>
         <array>
            <dict>
               <key>include</key>
               <string>#tag-stuff</string>
            </dict>
         </array>
      </dict>

      <dict>
         <key>begin</key>
         <string>(&lt;/?)((?i:form|fieldset|legend|label|input|textarea)\b)</string>
         <key>beginCaptures</key>
         <dict>
            <key>1</key>
            <dict>
               <key>name</key>
               <string>punctuation.definition.tag.form.begin.html</string>
            </dict>
            <key>2</key>
            <dict>
               <key>name</key>
               <string>entity.name.tag.form.html</string>
            </dict>
         </dict>
         <key>end</key>
         <string>(&gt;)</string>
         <key>endCaptures</key>
         <dict>
            <key>1</key>
            <dict>
               <key>name</key>
               <string>punctuation.definition.tag.form.end.html</string>
            </dict>
         </dict>
         <key>name</key>
         <string>meta.tag.form.html</string>
         <key>patterns</key>
         <array>
            <dict>
               <key>include</key>
               <string>#tag-stuff</string>
            </dict>
         </array>
      </dict>


And this is in my theme for defining the colours...

Code: Select all
      <dict>
         <key>name</key>
         <string>HTML Tag Table</string>
         <key>scope</key>
         <string>meta.tag.table.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#839400</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag Table</string>
         <key>scope</key>
         <string>meta.tag.table.html entity.name.tag.table.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#839400</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag IMG</string>
         <key>scope</key>
         <string>meta.tag.img.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#B64C77</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag IMG</string>
         <key>scope</key>
         <string>meta.tag.img.html entity.name.tag.img.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#B64C77</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag IMG</string>
         <key>scope</key>
         <string>meta.tag.img.html entity.other.attribute-name.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#B64C77</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag Form</string>
         <key>scope</key>
         <string>meta.tag.form.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#69B2C2</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag Form</string>
         <key>scope</key>
         <string>meta.tag.form.html entity.name.tag.form.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#69B2C2</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag Form</string>
         <key>scope</key>
         <string>meta.tag.form.html entity.other.attribute-name.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#69B2C2</string>
         </dict>
      </dict>

      <dict>
         <key>name</key>
         <string>HTML Tag Form</string>
         <key>scope</key>
         <string>meta.tag.form.html meta.attribute-with-value.id.html entity.other.attribute-name.id.html</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string></string>
            <key>foreground</key>
            <string>#69B2C2</string>
         </dict>
      </dict>


This works fine in ST2, but has no effect in ST3.
Fatbat
 
Posts: 70
Joined: Sun Feb 19, 2012 6:54 pm

PreviousNext

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 33 guests