Page 1 of 1

cobra -highlight <files>

PostPosted: Wed Mar 18, 2009 9:48 pm
by Charles
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.

Re: cobra -highlight <files>

PostPosted: Wed Apr 08, 2009 1:20 pm
by arisawa
Hi, Chuck
small issue report.

Please add a head for a 2byte character.

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

Re: cobra -highlight <files>

PostPosted: Wed Apr 08, 2009 9:45 pm
by Charles
Done for both -highlight and -doc. Thanks.

Re: cobra -highlight <files>

PostPosted: Sun Oct 11, 2009 2:56 pm
by arisawa
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
      

Re: cobra -highlight <files>

PostPosted: Sun Oct 11, 2009 10:46 pm
by Charles
Fixed and fixed. Thanks for the report.