Hi, For most of the code samples that I post on my blog , I use “Insert Code for Windows Live Writer” plugin for WLW to format code snippets and absolutely love the way that the code snippet turns out on the blog. I use the Dark Theme by Orren Ellenbogen for my VS at home and at work and wanted to mirror the code snippets on my blog to turn up the same way . Step 1) Figure out what kind of styles are used by the Visual Studio theme Step 2) Figure out how to apply said styles to output of Insert Code for Windows Live Writer. Step 1) Go to Visual Studio –> Tools –> Options –> Expand Environment –> Fonts and Colors There you have it ! All the styles that are used by the VS to format my code in the dark theme.
Step 2)
<!—Rest of the html removed for sanity—!> The primary class seems to be “csharpcode”
4. In the source , if you choose to embed the styles , see if the styles are added . The way the styles seem to work are : there is a main class “csharpcode” , and every other class inherits from this keywords are decorated by the class ‘kwrd”, comments are “rem” and so on and so forth.
5. I fired up the calculator , switched to Hex mode and started translating some of the key colors from visual studio into their hex equivalents. 6. And modified the files to make the new stylesheet for code snippets “darkcsharpcode”
Normal code snippet with the Plugin
<div id="listTemplate" class="sys-template"> <ul> <li> {{ ListTitle }}s </li> </ul> </div>
DarkCsharp
<div id="listTemplate" class="sys-template"> <ul> <li> {{ ListTitle }} </li> </ul> </div>
PingBack from http://blog.a-foton.ru/2008/08/welcome-to-the-dark-side-code-snippets/