Forums

cobra -highlight <files>

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

cobra -highlight <files>

Postby Charles » Wed Mar 18, 2009 9:48 pm

The Cobra command line has a new -highlight option that will take the source files you give and emit them into gen-html\foo.cobra.html as syntax highlighted files. Here is an example.

The stylesheet is styles-cobra-shl.css (shl=syntax highlighting) in Cobra's Source\ directory.

See SyntaxHighlighter.cobra in the source if you are interested in the implementation or the remaining TODO list in the file's doc string.

Note that there is also a Pygments highlighter which will always be important because several 3rd party tools use Pygments.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: cobra -highlight <files>

Postby arisawa » Wed Apr 08, 2009 1:20 pm

Hi, Chuck
small issue report.

Please add a head for a 2byte character.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
arisawa
 
Posts: 51

Re: cobra -highlight <files>

Postby Charles » Wed Apr 08, 2009 9:45 pm

Done for both -highlight and -doc. Thanks.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: cobra -highlight <files>

Postby arisawa » Sun Oct 11, 2009 2:56 pm

is '-highlight' option there that in -help information?

also,there is a problem with the following code.
FileNotFoundException: 'MainWrapper.cobra' :?
Code: Select all
class Person
   var _name as String = "-----"
   var __address as String = "xxxx"
   var __telephone as String = "000-0000"
   var age as int = 0
   
   pro name as String
      get
         return _name
      set
         _name = value
      
   pro address as String
      get
         return __address
      set
         pass
      
   def setNameAge(n as String, a as int)
      .name = n
      .age = a
      
   def dumpData
      trace _name
      trace __address
      trace __telephone
      trace .age
      
   def main
      p = Person()
      print p.name
      p.setNameAge("john doe", 30)
      print p.name
      print p.address
      p.dumpData
      
arisawa
 
Posts: 51

Re: cobra -highlight <files>

Postby Charles » Sun Oct 11, 2009 10:46 pm

Fixed and fixed. Thanks for the report.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 45 guests