Code4Blog is an Visual Studio 2010 add-in has been created for converting any text data that supporting by the IDE to HTML format.
What this all about?
When you blog or work on a documentation, it could be complicated to insert code snippets into your post or blog: yes – you can copy/paste it using Windows Clipboard but content style most likely will be different from rest of post/doc and you will need to
do some manual intervention to fit a snippet into article.
Using Code4Blog you just need a source file where you can select a part that needs to be converted (or select nothing in case if you need entire file content). As result, an HTML file will be created and opened in VS IDE, in split form so you can edit HTML
source as well as work in IDE’s HTML designer. After you done, everything what you need is just copy converted snippet either from HTML code editor (useful for blog insertion) or from designer (for Microsoft Word doc). It is also support some additional customization
such as different background colors, fonts, frame size, line numbering etc. All these settings are available in own IDE Options dialog page and saved between sessions.
How to install and setup Code4Blog?
To convert a file:
- Download Code4Blog.vsix file.
- Make sure your Visual Studio IDE is closed otherwise you will need to restart it.
- Double click on the file to install it into the IDE and you done.
- If you want to apply some additional styling, in Visual Studio IDE open menu Tools-Options and scroll down to the Code4Blog page.
- Open your file in the IDE.
- Select nothing if you want to convert the entire file content otherwise select a block of text. Note: for best results use “block selection” using Shift+Alt instead of mouse selection to keep same indents in all lines.
- Go to menu Tools and click on “Convert to Html”.
- An HTML file will be opened in the IDE.
- Do necessary changes if needed then save results into a file or copy either HTML source or design into Clipboard.
- Paste created content into your blog post or doc.
Sources are in C# for .NET 4 and are available under Microsoft Publick License.
How to build?
The only requirement is VS2010 SDK which could be downloaded from here:
No other components/SDKs are needed.