Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-28 Thread Lukas Theussl


Hi Lennart,

Thanks for picking this up!

Personally I don't like either of the two solutions you propose... :p 
The APT format was above all designed to be simple, which necessarily 
implies some functional limitations. Eg it is on purpose that APT does 
not support styles [1], if any fancy layout features are required, like 
the one we are talking about here, I would always recommend to use 
something else than APT (xdoc,...).



Also, changing/enhancing a well-established format spec like APT is 
likely to cause disturbance, we did it once with the Doxia 1.1 release 
[2], and frankly, I wouldn't do it again.



See further comments in-line below.

Cheers,
-Lukas


[1] 
http://maven.apache.org/doxia/faq.html#How_to_handle_style_in_the_APT_markup_language

[2] http://maven.apache.org/doxia/references/doxia-apt.html




Lennart Jörelid wrote:

Hello Lukas,

A question here...

It seems simple enough to add the required constants conveying the choice
to provide syntax coloring or line number visibility to Doxia's
SinkEventAttributes.
It also seems simple enough to make a smallish change to the core
SinkAdapter, to recognize more properties than the boxed attribute, and
to propagate this change to all relevant doxia modules.
These changes caters for the need to convey the semantics of some extra
properties to all modules. Fair enough.

However, each module interested in interpreting these new attributes in a
meaningful way must have some means to configure them in its native markup.
According to the SunkUtils class, code of all kinds is rendered within
div or pre tags - implying Verbatim SinkEventAttributes.


Confused here what you are referring to,.. the SinkUtils class doesn't 
mention anything like that AFAICS and div and pre are html specific, so 
shouldn't occur anywhere in the generic Sink API.




While the documentation for SinkEventAttributes.DECORATION claims that
'Generally accepted values are underline, overline, line-through,
boxed', the SinkAdapter.verbatim() method in its current form only
recognizes the value boxed.
To provide the ability to set optional properties (boxed, syntaxColored,
lineNumbersVisible), one could simply create more SinkEventAttributes
values. No biggie.


Note that the SinkAdapter class is just an empty base implementation, it 
gets overridden by practically all low-level Sinks, see eg the 
XhtmlBaseSink.




But ... taking the APT module (which seems a decently frequently used one)
as an example, we have 2 choices for markup alterations:

a) Permutations of the currently available one, or
b) Mutator elements within the verbatim block

If we choose (a), we end up with several markup permutations (with/without
syntax coloring; with/without line numbers displayed).
Currently, the only two choices in the AptMarkup interface are
BOXED_VERBATIM_START_MARKUP (+--+) and HEADER_START_MARKUP ( -).
What seems the dim way to solve the problem would then be simply creating
several new markup starts along the lines of:

 /** Syntax for the boxed verbatim start, indicating syntax coloring
should be used: +c-+ */
 String BOXED_VERBATIM_WITH_SYNTAX_COLORING_START_MARKUP =
String.valueOf( PLUS )
 + StringUtils.repeat( String.valueOf( MINUS ), 6 ) +
String.valueOf( PLUS );

 /** Syntax for the boxed verbatim start, indicating line numbers should
be used: +cl+ */
 String BOXED_VERBATIM_WITH_LINE_NUMBERS_START_MARKUP = String.valueOf(
PLUS )
 + StringUtils.repeat( String.valueOf( MINUS ), 6 ) +
String.valueOf( PLUS );

If we choose (b), we would be required to introduce mutators within the
verbatim markup elements - something along the lines of:

+--+ [option: [displayLineNumbers] [useSyntaxColoring]]
... code goes here ...
+--+

I prefer the latter solution, and I hope to be able to grab the last part
of the start line within the APT module given a small tweak to
the AptSink in order for it not to use the verbatim(boolean) method. Do you
have comments or suggestions for me so far?

2011/11/26 Lukas Theusslltheu...@apache.org


There is a feature request for that:
https://jira.codehaus.org/browse/DOXIA-439

It's not implemented yet...

HTH,
-Lukas


On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
lennart.jore...@gmail.comwrote:


Hello Simone,

Looking good.

So ... given that this is a skin to maven, could you include the CSS and

JS

of the syntax highlighter (i.e.
http://alexgorbatchev.com/SyntaxHighlighter/
)?

However, I guess my question is on a more fundamental level.
What do we need to do in an APT file (or one of the other site
documentation format files) to achieve pretty-printed/syntax colored

source

snippets in Java or XML?

There seems to be no mention of exactly how to craft code snippet

examples

- as far as I can see - on the
http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
pages.

2011/11/26 Simone Tripodisimonetrip...@apache.org


Hi Lennart,
we are going to release the 

Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-27 Thread Lennart Jörelid
Hello there Simone,

You are quite right; I tested applying the maven-fluido-skin to the
jaxb2-maven-plugin, patch http://jira.codehaus.org/browse/MJAXB-55.
Feel free to checkout / patch to take a look at the skin in action.

Another question, though:

How do I disable line numbering for *some* code listings within the site?
For instance, it would be good to be able to remove line numbers for
listings intended to facilitate copy/paste for the user, while
keeping line numbering for listings intended to be used as examples (i.e.
where I want to explain what certain code lines do).

It seems that the site.xml configuration enables or disables features such
as line numbers for all listings within the entire site.
Correct?

2011/11/26 Simone Tripodi simonetrip...@apache.org

 Hi Lennart,
 what yu=ou described is something that si already working (at least
 for us), for your purposes you could just use the fluido-skin with
 that configuration in site.xml

  skin
groupIdorg.apache.maven.skins/groupId
artifactIdmaven-fluido-skin/artifactId
version1.0/version
  /skin

  custom
fluidoSkin
  sourceLineNumbersEnabledtrue/sourceLineNumbersEnabled
/fluidoSkin
  /custom

 source code snippets contained in

 source
 ...
 source

 in XDoc and

 +-+
 ...
 +-+

 in APT are auto-detected via google code prettifier and automatically
 rendered, without the pain to configure elements by yourself.
 Just wait a couple of hours that we have to release the skin, and code
 is enhanced.
 Let me know if you need help, I would more than pleased to provide my
 support!
 All the best, have a nice weekend,
 Simo

 http://people.apache.org/~simonetripodi/
 http://simonetripodi.livejournal.com/
 http://twitter.com/simonetripodi
 http://www.99soft.org/



 On Sat, Nov 26, 2011 at 1:58 PM, Lennart Jörelid
 lennart.jore...@gmail.com wrote:
  Hello Simone,
 
  First - sorry for being short on the brink of incomprehensible in my
  response above.
 
  You are correct in that Doxia prepares HTML and the skin applies the
 style.
  However, to simplify site generation for the site developer, we need to
  create a
  set of markups understandable by Doxia (or, more precisely, the Doxia APT
  enhancements)
  indicating that the content in between them should be interpreted as
 code
  in a
  particular language - such as Java or XML.
 
  Say ... (crude XML form here, but just intended as an example) ...
 
  code language=java displayLineNumbers=yes linkUrlsInCode=yes
 ... java code goes here ...
  /code
 
  That particular element would hook into the CSS or style sheets, to
 generate
  syntax highlighted code within the maven site, using something like
  the Syntax Highlighter (http://alexgorbatchev.com/SyntaxHighlighter/)
  or the Google code prettify (
 http://code.google.com/p/google-code-prettify/
  ).
 
  For example, I need this code-with-linenumbers feature for a patch to the
  jaxb2-maven-plugin to explain the correlation between annotations in java
  code,
  plugin XML configuration and resulting/generated XML schema files.
 
  However, I am at a loss regarding how to do it with the tools available
 in
  APT today,
  since there is no code element working similar to the example above -
  at least to my knowledge.
 
  I'll check out the code, file issues and such tomorrow.
  :)
 
  Fair?
 
  2011/11/26 Simone Tripodi simonetrip...@apache.org
 
  Hi all,
  apologize but I have my own difficulties on understanding the issue;
  why applying the code highlight should be a concern of the doxia
  renderer?
  I mean, Doxia has the task of generating the html code, the skin has
  the task of applying styles on elements where class/id are already
  set... I think that's why the issue has'n been fixed yet.
 
  @Lennart: do you mind filling an issue on
  https://jira.codehaus.org/browse/MSKINS/ ? TIA!
 
  All the best, have a nice WE!
  Simo
 
  http://people.apache.org/~simonetripodi/
  http://simonetripodi.livejournal.com/
  http://twitter.com/simonetripodi
  http://www.99soft.org/
 
 
 
  On Sat, Nov 26, 2011 at 9:07 AM, Lukas Theussl ltheu...@apache.org
  wrote:
   There is a feature request for that:
   https://jira.codehaus.org/browse/DOXIA-439
  
   It's not implemented yet...
  
   HTH,
   -Lukas
  
  
   On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
   lennart.jore...@gmail.comwrote:
  
   Hello Simone,
  
   Looking good.
  
   So ... given that this is a skin to maven, could you include the CSS
  and JS
   of the syntax highlighter (i.e.
   http://alexgorbatchev.com/SyntaxHighlighter/
   )?
  
   However, I guess my question is on a more fundamental level.
   What do we need to do in an APT file (or one of the other site
   documentation format files) to achieve pretty-printed/syntax colored
  source
   snippets in Java or XML?
  
   There seems to be no mention of exactly how to craft code snippet
  examples
   - as far as I can see - on the
   http://maven.apache.org/doxia/references/doxia-apt.html (and
 

Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-27 Thread Simone Tripodi
Hi Lennart,
unfortunately there's no way ATM to specify where applying the line
numbering and where not :(
The only way to do it, would be applying what you suggested in your
first message :)
Have a nice day, all the best!
Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Sun, Nov 27, 2011 at 11:52 AM, Lennart Jörelid
lennart.jore...@gmail.com wrote:
 Hello there Simone,

 You are quite right; I tested applying the maven-fluido-skin to the
 jaxb2-maven-plugin, patch http://jira.codehaus.org/browse/MJAXB-55.
 Feel free to checkout / patch to take a look at the skin in action.

 Another question, though:

 How do I disable line numbering for *some* code listings within the site?
 For instance, it would be good to be able to remove line numbers for
 listings intended to facilitate copy/paste for the user, while
 keeping line numbering for listings intended to be used as examples (i.e.
 where I want to explain what certain code lines do).

 It seems that the site.xml configuration enables or disables features such
 as line numbers for all listings within the entire site.
 Correct?

 2011/11/26 Simone Tripodi simonetrip...@apache.org

 Hi Lennart,
 what yu=ou described is something that si already working (at least
 for us), for your purposes you could just use the fluido-skin with
 that configuration in site.xml

  skin
    groupIdorg.apache.maven.skins/groupId
    artifactIdmaven-fluido-skin/artifactId
    version1.0/version
  /skin

  custom
    fluidoSkin
      sourceLineNumbersEnabledtrue/sourceLineNumbersEnabled
    /fluidoSkin
  /custom

 source code snippets contained in

 source
 ...
 source

 in XDoc and

 +-+
 ...
 +-+

 in APT are auto-detected via google code prettifier and automatically
 rendered, without the pain to configure elements by yourself.
 Just wait a couple of hours that we have to release the skin, and code
 is enhanced.
 Let me know if you need help, I would more than pleased to provide my
 support!
 All the best, have a nice weekend,
 Simo

 http://people.apache.org/~simonetripodi/
 http://simonetripodi.livejournal.com/
 http://twitter.com/simonetripodi
 http://www.99soft.org/



 On Sat, Nov 26, 2011 at 1:58 PM, Lennart Jörelid
 lennart.jore...@gmail.com wrote:
  Hello Simone,
 
  First - sorry for being short on the brink of incomprehensible in my
  response above.
 
  You are correct in that Doxia prepares HTML and the skin applies the
 style.
  However, to simplify site generation for the site developer, we need to
  create a
  set of markups understandable by Doxia (or, more precisely, the Doxia APT
  enhancements)
  indicating that the content in between them should be interpreted as
 code
  in a
  particular language - such as Java or XML.
 
  Say ... (crude XML form here, but just intended as an example) ...
 
  code language=java displayLineNumbers=yes linkUrlsInCode=yes
     ... java code goes here ...
  /code
 
  That particular element would hook into the CSS or style sheets, to
 generate
  syntax highlighted code within the maven site, using something like
  the Syntax Highlighter (http://alexgorbatchev.com/SyntaxHighlighter/)
  or the Google code prettify (
 http://code.google.com/p/google-code-prettify/
  ).
 
  For example, I need this code-with-linenumbers feature for a patch to the
  jaxb2-maven-plugin to explain the correlation between annotations in java
  code,
  plugin XML configuration and resulting/generated XML schema files.
 
  However, I am at a loss regarding how to do it with the tools available
 in
  APT today,
  since there is no code element working similar to the example above -
  at least to my knowledge.
 
  I'll check out the code, file issues and such tomorrow.
  :)
 
  Fair?
 
  2011/11/26 Simone Tripodi simonetrip...@apache.org
 
  Hi all,
  apologize but I have my own difficulties on understanding the issue;
  why applying the code highlight should be a concern of the doxia
  renderer?
  I mean, Doxia has the task of generating the html code, the skin has
  the task of applying styles on elements where class/id are already
  set... I think that's why the issue has'n been fixed yet.
 
  @Lennart: do you mind filling an issue on
  https://jira.codehaus.org/browse/MSKINS/ ? TIA!
 
  All the best, have a nice WE!
  Simo
 
  http://people.apache.org/~simonetripodi/
  http://simonetripodi.livejournal.com/
  http://twitter.com/simonetripodi
  http://www.99soft.org/
 
 
 
  On Sat, Nov 26, 2011 at 9:07 AM, Lukas Theussl ltheu...@apache.org
  wrote:
   There is a feature request for that:
   https://jira.codehaus.org/browse/DOXIA-439
  
   It's not implemented yet...
  
   HTH,
   -Lukas
  
  
   On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
   lennart.jore...@gmail.comwrote:
  
   Hello Simone,
  
   Looking good.
  
   So ... given that this is a skin to maven, could you include the CSS
  and JS
   of the syntax highlighter (i.e.
   

Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-27 Thread Lennart Jörelid
Hello Lukas,

A question here...

It seems simple enough to add the required constants conveying the choice
to provide syntax coloring or line number visibility to Doxia's
SinkEventAttributes.
It also seems simple enough to make a smallish change to the core
SinkAdapter, to recognize more properties than the boxed attribute, and
to propagate this change to all relevant doxia modules.
These changes caters for the need to convey the semantics of some extra
properties to all modules. Fair enough.

However, each module interested in interpreting these new attributes in a
meaningful way must have some means to configure them in its native markup.
According to the SunkUtils class, code of all kinds is rendered within
div or pre tags - implying Verbatim SinkEventAttributes.

While the documentation for SinkEventAttributes.DECORATION claims that
'Generally accepted values are underline, overline, line-through,
boxed', the SinkAdapter.verbatim() method in its current form only
recognizes the value boxed.
To provide the ability to set optional properties (boxed, syntaxColored,
lineNumbersVisible), one could simply create more SinkEventAttributes
values. No biggie.

But ... taking the APT module (which seems a decently frequently used one)
as an example, we have 2 choices for markup alterations:

a) Permutations of the currently available one, or
b) Mutator elements within the verbatim block

If we choose (a), we end up with several markup permutations (with/without
syntax coloring; with/without line numbers displayed).
Currently, the only two choices in the AptMarkup interface are
BOXED_VERBATIM_START_MARKUP (+--+) and HEADER_START_MARKUP ( -).
What seems the dim way to solve the problem would then be simply creating
several new markup starts along the lines of:

/** Syntax for the boxed verbatim start, indicating syntax coloring
should be used: +c-+ */
String BOXED_VERBATIM_WITH_SYNTAX_COLORING_START_MARKUP =
String.valueOf( PLUS )
+ StringUtils.repeat( String.valueOf( MINUS ), 6 ) +
String.valueOf( PLUS );

/** Syntax for the boxed verbatim start, indicating line numbers should
be used: +cl+ */
String BOXED_VERBATIM_WITH_LINE_NUMBERS_START_MARKUP = String.valueOf(
PLUS )
+ StringUtils.repeat( String.valueOf( MINUS ), 6 ) +
String.valueOf( PLUS );

If we choose (b), we would be required to introduce mutators within the
verbatim markup elements - something along the lines of:

+--+ [option: [displayLineNumbers] [useSyntaxColoring]]
... code goes here ...
+--+

I prefer the latter solution, and I hope to be able to grab the last part
of the start line within the APT module given a small tweak to
the AptSink in order for it not to use the verbatim(boolean) method. Do you
have comments or suggestions for me so far?

2011/11/26 Lukas Theussl ltheu...@apache.org

 There is a feature request for that:
 https://jira.codehaus.org/browse/DOXIA-439

 It's not implemented yet...

 HTH,
 -Lukas


 On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
 lennart.jore...@gmail.comwrote:

  Hello Simone,
 
  Looking good.
 
  So ... given that this is a skin to maven, could you include the CSS and
 JS
  of the syntax highlighter (i.e.
  http://alexgorbatchev.com/SyntaxHighlighter/
  )?
 
  However, I guess my question is on a more fundamental level.
  What do we need to do in an APT file (or one of the other site
  documentation format files) to achieve pretty-printed/syntax colored
 source
  snippets in Java or XML?
 
  There seems to be no mention of exactly how to craft code snippet
 examples
  - as far as I can see - on the
  http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
  pages.
 
  2011/11/26 Simone Tripodi simonetrip...@apache.org
 
   Hi Lennart,
   we are going to release the maven-fluido-skin[1] that does also code
   prettyprint ans syntax highlight.
   HTH!
   Simo
  
   [1] http://maven.apache.org/skins/maven-fluido-skin/
  
   http://people.apache.org/~simonetripodi/
   http://simonetripodi.livejournal.com/
   http://twitter.com/simonetripodi
   http://www.99soft.org/
  
  
  
   On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
   lennart.jore...@gmail.com wrote:
Hello folks,
   
I need to include some pretty-printed and syntax coloured code
 snippets
   into the maven site of a set of projects.
After a tad of searching, I haven't found any plugin or extension to
   Doxia that seems to do this. There seems to be
several box text and don't ruin its formatting-type tags and
   operations - but I would like to pretty print and syntax
colour both Java and XML files.
   
... and I suppose this is fixed by some nice doxia-based utility
  already.
   
Could you point me in the correct direction?
   
// Bästa hälsningar,
// [sw. Best regards
//
// Lennart Jörelid
// lennart.jore...@gmail.com
   
   
  
   -
   To unsubscribe, e-mail: 

Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-26 Thread Lukas Theussl
There is a feature request for that:
https://jira.codehaus.org/browse/DOXIA-439

It's not implemented yet...

HTH,
-Lukas


On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
lennart.jore...@gmail.comwrote:

 Hello Simone,

 Looking good.

 So ... given that this is a skin to maven, could you include the CSS and JS
 of the syntax highlighter (i.e.
 http://alexgorbatchev.com/SyntaxHighlighter/
 )?

 However, I guess my question is on a more fundamental level.
 What do we need to do in an APT file (or one of the other site
 documentation format files) to achieve pretty-printed/syntax colored source
 snippets in Java or XML?

 There seems to be no mention of exactly how to craft code snippet examples
 - as far as I can see - on the
 http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
 pages.

 2011/11/26 Simone Tripodi simonetrip...@apache.org

  Hi Lennart,
  we are going to release the maven-fluido-skin[1] that does also code
  prettyprint ans syntax highlight.
  HTH!
  Simo
 
  [1] http://maven.apache.org/skins/maven-fluido-skin/
 
  http://people.apache.org/~simonetripodi/
  http://simonetripodi.livejournal.com/
  http://twitter.com/simonetripodi
  http://www.99soft.org/
 
 
 
  On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
  lennart.jore...@gmail.com wrote:
   Hello folks,
  
   I need to include some pretty-printed and syntax coloured code snippets
  into the maven site of a set of projects.
   After a tad of searching, I haven't found any plugin or extension to
  Doxia that seems to do this. There seems to be
   several box text and don't ruin its formatting-type tags and
  operations - but I would like to pretty print and syntax
   colour both Java and XML files.
  
   ... and I suppose this is fixed by some nice doxia-based utility
 already.
  
   Could you point me in the correct direction?
  
   // Bästa hälsningar,
   // [sw. Best regards
   //
   // Lennart Jörelid
   // lennart.jore...@gmail.com
  
  
 
  -
  To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
  For additional commands, e-mail: dev-h...@maven.apache.org
 
 


 --

 --
 Lennart Jörelid



Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-26 Thread Simone Tripodi
Hi all,
apologize but I have my own difficulties on understanding the issue;
why applying the code highlight should be a concern of the doxia
renderer?
I mean, Doxia has the task of generating the html code, the skin has
the task of applying styles on elements where class/id are already
set... I think that's why the issue has'n been fixed yet.

@Lennart: do you mind filling an issue on
https://jira.codehaus.org/browse/MSKINS/ ? TIA!

All the best, have a nice WE!
Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Sat, Nov 26, 2011 at 9:07 AM, Lukas Theussl ltheu...@apache.org wrote:
 There is a feature request for that:
 https://jira.codehaus.org/browse/DOXIA-439

 It's not implemented yet...

 HTH,
 -Lukas


 On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
 lennart.jore...@gmail.comwrote:

 Hello Simone,

 Looking good.

 So ... given that this is a skin to maven, could you include the CSS and JS
 of the syntax highlighter (i.e.
 http://alexgorbatchev.com/SyntaxHighlighter/
 )?

 However, I guess my question is on a more fundamental level.
 What do we need to do in an APT file (or one of the other site
 documentation format files) to achieve pretty-printed/syntax colored source
 snippets in Java or XML?

 There seems to be no mention of exactly how to craft code snippet examples
 - as far as I can see - on the
 http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
 pages.

 2011/11/26 Simone Tripodi simonetrip...@apache.org

  Hi Lennart,
  we are going to release the maven-fluido-skin[1] that does also code
  prettyprint ans syntax highlight.
  HTH!
  Simo
 
  [1] http://maven.apache.org/skins/maven-fluido-skin/
 
  http://people.apache.org/~simonetripodi/
  http://simonetripodi.livejournal.com/
  http://twitter.com/simonetripodi
  http://www.99soft.org/
 
 
 
  On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
  lennart.jore...@gmail.com wrote:
   Hello folks,
  
   I need to include some pretty-printed and syntax coloured code snippets
  into the maven site of a set of projects.
   After a tad of searching, I haven't found any plugin or extension to
  Doxia that seems to do this. There seems to be
   several box text and don't ruin its formatting-type tags and
  operations - but I would like to pretty print and syntax
   colour both Java and XML files.
  
   ... and I suppose this is fixed by some nice doxia-based utility
 already.
  
   Could you point me in the correct direction?
  
   // Bästa hälsningar,
   // [sw. Best regards
   //
   // Lennart Jörelid
   // lennart.jore...@gmail.com
  
  
 
  -
  To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
  For additional commands, e-mail: dev-h...@maven.apache.org
 
 


 --

 --
 Lennart Jörelid



-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-26 Thread Lennart Jörelid
Hello Lukas,

All right; I'll see if I can check out the code and get started on a patch.
Tomorrow is the word; today's heavy task has to do with feasting and
birthdays.

:)

2011/11/26 Lukas Theussl ltheu...@apache.org

 There is a feature request for that:
 https://jira.codehaus.org/browse/DOXIA-439

 It's not implemented yet...

 HTH,
 -Lukas


 On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
 lennart.jore...@gmail.comwrote:

  Hello Simone,
 
  Looking good.
 
  So ... given that this is a skin to maven, could you include the CSS and
 JS
  of the syntax highlighter (i.e.
  http://alexgorbatchev.com/SyntaxHighlighter/
  )?
 
  However, I guess my question is on a more fundamental level.
  What do we need to do in an APT file (or one of the other site
  documentation format files) to achieve pretty-printed/syntax colored
 source
  snippets in Java or XML?
 
  There seems to be no mention of exactly how to craft code snippet
 examples
  - as far as I can see - on the
  http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
  pages.
 
  2011/11/26 Simone Tripodi simonetrip...@apache.org
 
   Hi Lennart,
   we are going to release the maven-fluido-skin[1] that does also code
   prettyprint ans syntax highlight.
   HTH!
   Simo
  
   [1] http://maven.apache.org/skins/maven-fluido-skin/
  
   http://people.apache.org/~simonetripodi/
   http://simonetripodi.livejournal.com/
   http://twitter.com/simonetripodi
   http://www.99soft.org/
  
  
  
   On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
   lennart.jore...@gmail.com wrote:
Hello folks,
   
I need to include some pretty-printed and syntax coloured code
 snippets
   into the maven site of a set of projects.
After a tad of searching, I haven't found any plugin or extension to
   Doxia that seems to do this. There seems to be
several box text and don't ruin its formatting-type tags and
   operations - but I would like to pretty print and syntax
colour both Java and XML files.
   
... and I suppose this is fixed by some nice doxia-based utility
  already.
   
Could you point me in the correct direction?
   
// Bästa hälsningar,
// [sw. Best regards
//
// Lennart Jörelid
// lennart.jore...@gmail.com
   
   
  
   -
   To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
   For additional commands, e-mail: dev-h...@maven.apache.org
  
  
 
 
  --
 
  --
  Lennart Jörelid
 




-- 

-- 
Lennart Jörelid


Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-26 Thread Lennart Jörelid
Hello Simone,

First - sorry for being short on the brink of incomprehensible in my
response above.

You are correct in that Doxia prepares HTML and the skin applies the style.
However, to simplify site generation for the site developer, we need to
create a
set of markups understandable by Doxia (or, more precisely, the Doxia APT
enhancements)
indicating that the content in between them should be interpreted as code
in a
particular language - such as Java or XML.

Say ... (crude XML form here, but just intended as an example) ...

code language=java displayLineNumbers=yes linkUrlsInCode=yes
... java code goes here ...
/code

That particular element would hook into the CSS or style sheets, to generate
syntax highlighted code within the maven site, using something like
the Syntax Highlighter (http://alexgorbatchev.com/SyntaxHighlighter/)
or the Google code prettify (http://code.google.com/p/google-code-prettify/
).

For example, I need this code-with-linenumbers feature for a patch to the
jaxb2-maven-plugin to explain the correlation between annotations in java
code,
plugin XML configuration and resulting/generated XML schema files.

However, I am at a loss regarding how to do it with the tools available in
APT today,
since there is no code element working similar to the example above -
at least to my knowledge.

I'll check out the code, file issues and such tomorrow.
:)

Fair?

2011/11/26 Simone Tripodi simonetrip...@apache.org

 Hi all,
 apologize but I have my own difficulties on understanding the issue;
 why applying the code highlight should be a concern of the doxia
 renderer?
 I mean, Doxia has the task of generating the html code, the skin has
 the task of applying styles on elements where class/id are already
 set... I think that's why the issue has'n been fixed yet.

 @Lennart: do you mind filling an issue on
 https://jira.codehaus.org/browse/MSKINS/ ? TIA!

 All the best, have a nice WE!
 Simo

 http://people.apache.org/~simonetripodi/
 http://simonetripodi.livejournal.com/
 http://twitter.com/simonetripodi
 http://www.99soft.org/



 On Sat, Nov 26, 2011 at 9:07 AM, Lukas Theussl ltheu...@apache.org
 wrote:
  There is a feature request for that:
  https://jira.codehaus.org/browse/DOXIA-439
 
  It's not implemented yet...
 
  HTH,
  -Lukas
 
 
  On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
  lennart.jore...@gmail.comwrote:
 
  Hello Simone,
 
  Looking good.
 
  So ... given that this is a skin to maven, could you include the CSS
 and JS
  of the syntax highlighter (i.e.
  http://alexgorbatchev.com/SyntaxHighlighter/
  )?
 
  However, I guess my question is on a more fundamental level.
  What do we need to do in an APT file (or one of the other site
  documentation format files) to achieve pretty-printed/syntax colored
 source
  snippets in Java or XML?
 
  There seems to be no mention of exactly how to craft code snippet
 examples
  - as far as I can see - on the
  http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
  pages.
 
  2011/11/26 Simone Tripodi simonetrip...@apache.org
 
   Hi Lennart,
   we are going to release the maven-fluido-skin[1] that does also code
   prettyprint ans syntax highlight.
   HTH!
   Simo
  
   [1] http://maven.apache.org/skins/maven-fluido-skin/
  
   http://people.apache.org/~simonetripodi/
   http://simonetripodi.livejournal.com/
   http://twitter.com/simonetripodi
   http://www.99soft.org/
  
  
  
   On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
   lennart.jore...@gmail.com wrote:
Hello folks,
   
I need to include some pretty-printed and syntax coloured code
 snippets
   into the maven site of a set of projects.
After a tad of searching, I haven't found any plugin or extension to
   Doxia that seems to do this. There seems to be
several box text and don't ruin its formatting-type tags and
   operations - but I would like to pretty print and syntax
colour both Java and XML files.
   
... and I suppose this is fixed by some nice doxia-based utility
  already.
   
Could you point me in the correct direction?
   
// Bästa hälsningar,
// [sw. Best regards
//
// Lennart Jörelid
// lennart.jore...@gmail.com
   
   
  
   -
   To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
   For additional commands, e-mail: dev-h...@maven.apache.org
  
  
 
 
  --
 
  --
  Lennart Jörelid
 
 

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org




-- 

-- 
Lennart Jörelid


Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-26 Thread Simone Tripodi
Hi Lennart,
what yu=ou described is something that si already working (at least
for us), for your purposes you could just use the fluido-skin with
that configuration in site.xml

  skin
groupIdorg.apache.maven.skins/groupId
artifactIdmaven-fluido-skin/artifactId
version1.0/version
  /skin

  custom
fluidoSkin
  sourceLineNumbersEnabledtrue/sourceLineNumbersEnabled
/fluidoSkin
  /custom

source code snippets contained in

source
...
source

in XDoc and

+-+
...
+-+

in APT are auto-detected via google code prettifier and automatically
rendered, without the pain to configure elements by yourself.
Just wait a couple of hours that we have to release the skin, and code
is enhanced.
Let me know if you need help, I would more than pleased to provide my support!
All the best, have a nice weekend,
Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Sat, Nov 26, 2011 at 1:58 PM, Lennart Jörelid
lennart.jore...@gmail.com wrote:
 Hello Simone,

 First - sorry for being short on the brink of incomprehensible in my
 response above.

 You are correct in that Doxia prepares HTML and the skin applies the style.
 However, to simplify site generation for the site developer, we need to
 create a
 set of markups understandable by Doxia (or, more precisely, the Doxia APT
 enhancements)
 indicating that the content in between them should be interpreted as code
 in a
 particular language - such as Java or XML.

 Say ... (crude XML form here, but just intended as an example) ...

 code language=java displayLineNumbers=yes linkUrlsInCode=yes
    ... java code goes here ...
 /code

 That particular element would hook into the CSS or style sheets, to generate
 syntax highlighted code within the maven site, using something like
 the Syntax Highlighter (http://alexgorbatchev.com/SyntaxHighlighter/)
 or the Google code prettify (http://code.google.com/p/google-code-prettify/
 ).

 For example, I need this code-with-linenumbers feature for a patch to the
 jaxb2-maven-plugin to explain the correlation between annotations in java
 code,
 plugin XML configuration and resulting/generated XML schema files.

 However, I am at a loss regarding how to do it with the tools available in
 APT today,
 since there is no code element working similar to the example above -
 at least to my knowledge.

 I'll check out the code, file issues and such tomorrow.
 :)

 Fair?

 2011/11/26 Simone Tripodi simonetrip...@apache.org

 Hi all,
 apologize but I have my own difficulties on understanding the issue;
 why applying the code highlight should be a concern of the doxia
 renderer?
 I mean, Doxia has the task of generating the html code, the skin has
 the task of applying styles on elements where class/id are already
 set... I think that's why the issue has'n been fixed yet.

 @Lennart: do you mind filling an issue on
 https://jira.codehaus.org/browse/MSKINS/ ? TIA!

 All the best, have a nice WE!
 Simo

 http://people.apache.org/~simonetripodi/
 http://simonetripodi.livejournal.com/
 http://twitter.com/simonetripodi
 http://www.99soft.org/



 On Sat, Nov 26, 2011 at 9:07 AM, Lukas Theussl ltheu...@apache.org
 wrote:
  There is a feature request for that:
  https://jira.codehaus.org/browse/DOXIA-439
 
  It's not implemented yet...
 
  HTH,
  -Lukas
 
 
  On Sat, Nov 26, 2011 at 2:16 AM, Lennart Jörelid
  lennart.jore...@gmail.comwrote:
 
  Hello Simone,
 
  Looking good.
 
  So ... given that this is a skin to maven, could you include the CSS
 and JS
  of the syntax highlighter (i.e.
  http://alexgorbatchev.com/SyntaxHighlighter/
  )?
 
  However, I guess my question is on a more fundamental level.
  What do we need to do in an APT file (or one of the other site
  documentation format files) to achieve pretty-printed/syntax colored
 source
  snippets in Java or XML?
 
  There seems to be no mention of exactly how to craft code snippet
 examples
  - as far as I can see - on the
  http://maven.apache.org/doxia/references/doxia-apt.html (and friends)
  pages.
 
  2011/11/26 Simone Tripodi simonetrip...@apache.org
 
   Hi Lennart,
   we are going to release the maven-fluido-skin[1] that does also code
   prettyprint ans syntax highlight.
   HTH!
   Simo
  
   [1] http://maven.apache.org/skins/maven-fluido-skin/
  
   http://people.apache.org/~simonetripodi/
   http://simonetripodi.livejournal.com/
   http://twitter.com/simonetripodi
   http://www.99soft.org/
  
  
  
   On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
   lennart.jore...@gmail.com wrote:
Hello folks,
   
I need to include some pretty-printed and syntax coloured code
 snippets
   into the maven site of a set of projects.
After a tad of searching, I haven't found any plugin or extension to
   Doxia that seems to do this. There seems to be
several box text and don't ruin its formatting-type tags and
   operations - but I would like to pretty print and syntax
 

Syntax coloured code snippets in Site - existing or DYO

2011-11-25 Thread Lennart Jörelid
Hello folks,

I need to include some pretty-printed and syntax coloured code snippets into 
the maven site of a set of projects.
After a tad of searching, I haven't found any plugin or extension to Doxia that 
seems to do this. There seems to be
several box text and don't ruin its formatting-type tags and operations - but 
I would like to pretty print and syntax
colour both Java and XML files.

... and I suppose this is fixed by some nice doxia-based utility already.

Could you point me in the correct direction?

// Bästa hälsningar,
// [sw. Best regards
//
// Lennart Jörelid
// lennart.jore...@gmail.com



Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-25 Thread Simone Tripodi
Hi Lennart,
we are going to release the maven-fluido-skin[1] that does also code
prettyprint ans syntax highlight.
HTH!
Simo

[1] http://maven.apache.org/skins/maven-fluido-skin/

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/



On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
lennart.jore...@gmail.com wrote:
 Hello folks,

 I need to include some pretty-printed and syntax coloured code snippets into 
 the maven site of a set of projects.
 After a tad of searching, I haven't found any plugin or extension to Doxia 
 that seems to do this. There seems to be
 several box text and don't ruin its formatting-type tags and operations - 
 but I would like to pretty print and syntax
 colour both Java and XML files.

 ... and I suppose this is fixed by some nice doxia-based utility already.

 Could you point me in the correct direction?

 // Bästa hälsningar,
 // [sw. Best regards
 //
 // Lennart Jörelid
 // lennart.jore...@gmail.com



-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org



Re: Syntax coloured code snippets in Site - existing or DYO

2011-11-25 Thread Lennart Jörelid
Hello Simone,

Looking good.

So ... given that this is a skin to maven, could you include the CSS and JS
of the syntax highlighter (i.e. http://alexgorbatchev.com/SyntaxHighlighter/
)?

However, I guess my question is on a more fundamental level.
What do we need to do in an APT file (or one of the other site
documentation format files) to achieve pretty-printed/syntax colored source
snippets in Java or XML?

There seems to be no mention of exactly how to craft code snippet examples
- as far as I can see - on the
http://maven.apache.org/doxia/references/doxia-apt.html (and friends) pages.

2011/11/26 Simone Tripodi simonetrip...@apache.org

 Hi Lennart,
 we are going to release the maven-fluido-skin[1] that does also code
 prettyprint ans syntax highlight.
 HTH!
 Simo

 [1] http://maven.apache.org/skins/maven-fluido-skin/

 http://people.apache.org/~simonetripodi/
 http://simonetripodi.livejournal.com/
 http://twitter.com/simonetripodi
 http://www.99soft.org/



 On Sat, Nov 26, 2011 at 1:15 AM, Lennart Jörelid
 lennart.jore...@gmail.com wrote:
  Hello folks,
 
  I need to include some pretty-printed and syntax coloured code snippets
 into the maven site of a set of projects.
  After a tad of searching, I haven't found any plugin or extension to
 Doxia that seems to do this. There seems to be
  several box text and don't ruin its formatting-type tags and
 operations - but I would like to pretty print and syntax
  colour both Java and XML files.
 
  ... and I suppose this is fixed by some nice doxia-based utility already.
 
  Could you point me in the correct direction?
 
  // Bästa hälsningar,
  // [sw. Best regards
  //
  // Lennart Jörelid
  // lennart.jore...@gmail.com
 
 

 -
 To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
 For additional commands, e-mail: dev-h...@maven.apache.org




-- 

-- 
Lennart Jörelid