Wikipedia:WikiProject C/C++/Syntax highlighting
This project page is being considered for deletion in accordance with Wikipedia's deletion policy.
Please discuss the matter at this page's entry on the Miscellany for deletion page. You are welcome to edit this page, but please do not blank, merge, or move it, or remove this notice, while the discussion is in progress. For more information, see the Guide to deletion. Maintenance use only: Place either {{mfd}} or {{mfdx|2nd}} on the page nominated for deletion. Then subst {{subst:mfd2|pg=Wikipedia:WikiProject C/C++/Syntax highlighting|text=...}} ~~~~ to create the discussion subpage. Finally, subst {{subst:mfd3|pg=Wikipedia:WikiProject C/C++/Syntax highlighting}} into the MfD log. Please consider notifying the author(s) by placing{{subst:MFDWarning|Wikipedia:WikiProject C/C++/Syntax highlighting}} ~~~~ on their talk page(s). |
It would be nice to make full use of HTML's facility with text formatting in code samples. Following are proposals for syntax highlighting.
Standard colors
While the usual white or off-white background is reasonably well suited for plain encyclopedic text, it's poor at providing the contrast needed to easily distinguish color. Thus, colored text should preferably be placed on a dark background to allow a broad range of colors to be used. Note, however, that pure blue is less visible against black than against white.
The default colors are proposed to be as follows (it will of course be possible to override them with style sheets):
Color | RGB triplet | Uses |
---|---|---|
White | #ffffff | keywords |
Red | #ff0000 | decimal numbers |
Orange | #ff8000 | octal numbers |
Yellow | #ffff00 | characters, strings |
Green | #00ff00 | preprocessor symbols |
Cyan | #00ffff | function names |
Blue | #0000ff | ? |
Magenta | #ff00ff | hexadecimal numbers |
Dark red | #a00000 | ? |
Dark orange | #a05000 | ? |
Dark yellow | #a0a000 | comments |
Dark green | #00a000 | ? |
Dark cyan | #00a0a0 | punctuation |
Dark blue | #0000a0 | ? |
Dark magenta | #a000a0 | ? |
Gray | #cccccc | everything else |
Dark gray | #a0a0a0 | ? |