1

This site has the pretty source code listing.

alt text

Looking into the source code I get this HTML code.

<pre class="brush: cpp; wrap-lines: false;">
#ifndef PROGRESSSTATE_H_
#define PROGRESSSTATE_H_
class ProgressState {
 ...
#endif /* PROGRESSSTATE_H_ */
</pre>

It seems to me that the css does the magic. If so, what's the css should look like for having the source code listing? If not, what's the way to have the source code in HTML?

Mogsdad
46k21 gold badges166 silver badges289 bronze badges
asked Jan 17, 2011 at 18:09
0

1 Answer 1

4

It is probably using a javascript highlighting library such as syntaxhighlighter.

The javascript will pick up the CSS class name and use the brush value to highlight the contents of the <pre> tag the way you see it.

It is done with lots of changes to the DOM - additional divs and spans with specific styles.

answered Jan 17, 2011 at 18:14
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.