Skip to main content

Ralsina.Me — Roberto Alsina's website

Neat stuff

This is a recipe at the Python Cook­Book show­ing how to add a new di­rec­tive to re­Struc­tured­Tex­t, called code-block, which syn­tax-high­lights the block!

I just im­ple­ment­ed it in Not­ty, and now you can have the neat­est code snip­pet­s. I did have to hack the out­put a fair bit since the dis­play­ing wid­get does­n´t sup­port <s­pan> (or CSS for that mat­ter), so I had to do mas­sive search-re­places on the out­put, to con­vert to <font>. But it took on­ly half an hour to do, since Sil­verCi­ty´s out­put is very reg­u­lar.

I think I will sug­gest this to Hugo for PyD­S, con­sid­er­ing the den­si­ty of pro­gram­mers among its users :-)