Csound Csound-dev Csound-tekno Search About

[Cs-dev] Manual syntax highlighting

Date2007-02-01 21:49
FromFrancois Pinot
Subject[Cs-dev] Manual syntax highlighting
Hi,

a week ago, Andres expressed the idea of having syntax highlighting for 
the manual examples. To do this I replaced the pure text inclusion in 
the manual xml files by xml tagged versions of the examples. Those xml 
versions are stored in the 'examples-xml' directory.

If you write a new csd example or modify an existing one, you'll have to 
generate the xml version using the 'csd2docbook.py' script. For instance 
if your csd file is 'examples/myfile.csd', you'll have to run the 
command 'python csd2docbook.py -f myfile.csd' to generate the 
'myfile.csd.xml' into the 'examples-xml' directory (the script is run 
from the manual directory).

To take this into account, the manual files are modified in the 
following way:

old pure text inclusion:


is replaced by new xml file inclusion:


Note that there are no more surrounding  tags (they're 
now in the xml tag version of the example) and no more parse attribute 
(default value is xml). The href attribute is modified accordingly.


For the html version of the manual, syntax colours are defined in the 
csound.css file by style rules. Here are the meanings of the class 
attributes:

csdtag    ->   tag from the Unified File Format (csd)
comment   ->   comment
ohdr      ->   orchestra header (sr, kr, ...)
oblock    ->   orchestra block delimiter (instr, endin, opcode, endop)
opc       ->   instrument opcode
op        ->   instrument operator (+, -, *, ...)
octrl     ->   instrument control
olabel    ->   instrument label
omacro    ->   orchestra macro
stamnt    ->   score statement


For the pdf version of the manual, I'll have to write rules in the 
'stylesheets/customPDF.xsl' file.

As usually you can see the result here:
http://perso.numericable.fr/~fpinotfran36/fp.carnets/csound/manual-fr/html/

(for instance the fluidAllOut opcode)

Cheers

Francois Pinot



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-02-02 00:28
FromAndres Cabrera
SubjectRe: [Cs-dev] Manual syntax highlighting
HI Francois,

Thanks very much! I like how it looks. I think it might make csound less
scary for newbies... and it also makes examples easier to read. Any
objections to this idea? I really like it.

I would only change (one looks too bright to me and the other looks too
similar to another):

pre.programlisting span.ohdr {
  color: darkred; font-weight: bold;
}
pre.programlisting span.oblock {
  color: purple; font-weight: bold;
}

 Thanks again!
Andrés


Francois Pinot wrote:
> Hi,
>
> a week ago, Andres expressed the idea of having syntax highlighting for 
> the manual examples. To do this I replaced the pure text inclusion in 
> the manual xml files by xml tagged versions of the examples. Those xml 
> versions are stored in the 'examples-xml' directory.
>
> If you write a new csd example or modify an existing one, you'll have to 
> generate the xml version using the 'csd2docbook.py' script. For instance 
> if your csd file is 'examples/myfile.csd', you'll have to run the 
> command 'python csd2docbook.py -f myfile.csd' to generate the 
> 'myfile.csd.xml' into the 'examples-xml' directory (the script is run 
> from the manual directory).
>
> To take this into account, the manual files are modified in the 
> following way:
>
> old pure text inclusion:
>  xmlns:xi="http://www.w3.org/2001/XInclude"/>
>
> is replaced by new xml file inclusion:
>  xmlns:xi="http://www.w3.org/2001/XInclude"/>
>
> Note that there are no more surrounding  tags (they're 
> now in the xml tag version of the example) and no more parse attribute 
> (default value is xml). The href attribute is modified accordingly.
>
>
> For the html version of the manual, syntax colours are defined in the 
> csound.css file by style rules. Here are the meanings of the class 
> attributes:
>
> csdtag    ->   tag from the Unified File Format (csd)
> comment   ->   comment
> ohdr      ->   orchestra header (sr, kr, ...)
> oblock    ->   orchestra block delimiter (instr, endin, opcode, endop)
> opc       ->   instrument opcode
> op        ->   instrument operator (+, -, *, ...)
> octrl     ->   instrument control
> olabel    ->   instrument label
> omacro    ->   orchestra macro
> stamnt    ->   score statement
>
>
> For the pdf version of the manual, I'll have to write rules in the 
> 'stylesheets/customPDF.xsl' file.
>
> As usually you can see the result here:
> http://perso.numericable.fr/~fpinotfran36/fp.carnets/csound/manual-fr/html/
>
> (for instance the fluidAllOut opcode)
>
> Cheers
>
> Francois Pinot
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-02-02 01:04
FromRory Walsh
SubjectRe: [Cs-dev] Manual syntax highlighting
I agree, this looks great. It should also make things a little less 
confusing for beginners given that so many Csound editors now use syntax 
highlighting.

Rory.


Andres Cabrera wrote:
> HI Francois,
> 
> Thanks very much! I like how it looks. I think it might make csound less
> scary for newbies... and it also makes examples easier to read. Any
> objections to this idea? I really like it.
> 
> I would only change (one looks too bright to me and the other looks too
> similar to another):
> 
> pre.programlisting span.ohdr {
>   color: darkred; font-weight: bold;
> }
> pre.programlisting span.oblock {
>   color: purple; font-weight: bold;
> }
> 
>  Thanks again!
> Andrés
> 
> 
> Francois Pinot wrote:
>> Hi,
>>
>> a week ago, Andres expressed the idea of having syntax highlighting for 
>> the manual examples. To do this I replaced the pure text inclusion in 
>> the manual xml files by xml tagged versions of the examples. Those xml 
>> versions are stored in the 'examples-xml' directory.
>>
>> If you write a new csd example or modify an existing one, you'll have to 
>> generate the xml version using the 'csd2docbook.py' script. For instance 
>> if your csd file is 'examples/myfile.csd', you'll have to run the 
>> command 'python csd2docbook.py -f myfile.csd' to generate the 
>> 'myfile.csd.xml' into the 'examples-xml' directory (the script is run 
>> from the manual directory).
>>
>> To take this into account, the manual files are modified in the 
>> following way:
>>
>> old pure text inclusion:
>> > xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>
>> is replaced by new xml file inclusion:
>> > xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>
>> Note that there are no more surrounding  tags (they're 
>> now in the xml tag version of the example) and no more parse attribute 
>> (default value is xml). The href attribute is modified accordingly.
>>
>>
>> For the html version of the manual, syntax colours are defined in the 
>> csound.css file by style rules. Here are the meanings of the class 
>> attributes:
>>
>> csdtag    ->   tag from the Unified File Format (csd)
>> comment   ->   comment
>> ohdr      ->   orchestra header (sr, kr, ...)
>> oblock    ->   orchestra block delimiter (instr, endin, opcode, endop)
>> opc       ->   instrument opcode
>> op        ->   instrument operator (+, -, *, ...)
>> octrl     ->   instrument control
>> olabel    ->   instrument label
>> omacro    ->   orchestra macro
>> stamnt    ->   score statement
>>
>>
>> For the pdf version of the manual, I'll have to write rules in the 
>> 'stylesheets/customPDF.xsl' file.
>>
>> As usually you can see the result here:
>> http://perso.numericable.fr/~fpinotfran36/fp.carnets/csound/manual-fr/html/
>>
>> (for instance the fluidAllOut opcode)
>>
>> Cheers
>>
>> Francois Pinot
>>
>>
>>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job easier.
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>   
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-02-02 03:38
FromAnthony Kozar
SubjectRe: [Cs-dev] Manual syntax highlighting
The syntax coloring does look very nice, Francois.

I just have one question about this:  I am editing a few of the manual pages
(on Cscore) and they have several C code listings.  Is the 
tag still OK for this use?

Anthony

Francois Pinot wrote on 2/1/07 4:49 PM:

> Note that there are no more surrounding  tags (they're
> now in the xml tag version of the example) and no more parse attribute
> (default value is xml). The href attribute is modified accordingly.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-02-02 12:59
FromAndres Cabrera
SubjectRe: [Cs-dev] Manual syntax highlighting
Hi Anthony,

Yes, it is OK.  Anything you put in , will just appear
as before.

I'm glad people like the idea, and that Francois was able to do it!

Cheers,
Andrés

Anthony Kozar wrote:
> The syntax coloring does look very nice, Francois.
>
> I just have one question about this:  I am editing a few of the manual pages
> (on Cscore) and they have several C code listings.  Is the 
> tag still OK for this use?
>
> Anthony
>
> Francois Pinot wrote on 2/1/07 4:49 PM:
>
>   
>> Note that there are no more surrounding  tags (they're
>> now in the xml tag version of the example) and no more parse attribute
>> (default value is xml). The href attribute is modified accordingly.
>>     
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net