User:Thundergnat/Syntax highlighting and CSS: Difference between revisions

m
→‎Tokens: sidenote
m (typos, tweaks)
m (→‎Tokens: sidenote)
Line 86:
 
So "mi" are integers, and "mf" are floating point numbers. Now, the classifications in Python may not match up exactly with numerics in your language. For instance, in Raku 1.5 is a rational number not a floating point, but we can only work with what's available. Probably should include the other numerics too in our customization.
 
<div style="background-color:#fafaf8;font-style:italic;padding:1em;margin:1em;border:solid 1px;">On a side note: Speaking of working with what's available, the Raku lexer in Pygments gets octal numbers incorrect. It treats a decimal number that starts with a zero (0) is being octal but that's a holdover from Perl. In Raku an octal number is denoted by beginning with 0o. (Much like binary is 0b and hexadecimal is 0x.) Probably should file a bug report with Pygments.</div>
 
So. I'd like the make the numbers black instead of grey and to make them stand out a bit, I'll make them bold. Now I really only want to affect the particular language I'm mostly interested in. (Raku, if you hadn't guessed.) So I want to only apply my changes to the Raku examples. Luckily There is a class for each different highlighting lexer.
 
For Raku the highlighted code class is '''.mw-highlight-lang-raku'''.
 
 
===Putting it all together===
10,333

edits