Visual Studio Blog - visual-studio

I want to write a blog and some of the blogs that I've seen on the Internet have code snippets in VB.NET or C# that look like the text in Visual Studio itself even with the colors.
Is there some sort of application or tool I can use to create code snippets that look like those other blogs.

google-code-prettify is a good one.
Also, SyntaxHighlighter looks great, but I haven't tried it myself. It has explicit support for VB.NET.

If you're using Windows Live Writer for a blog editor I recomend using "Paste from Visual Studio" (link). It's a great way of getting formatted code into your blog posts.

I use this site to convert my code to HTML-formatted text for my blog. Works nicely.

If you don't mind using another application, Notepad++ exports your files to HTML.
Just open your *.cs files and go to Plugins > NppExport > Export to HTML. Fonts and colors are preserved, as defined in your Notepad++ configuration.
FYI, Notepad++ exports to HTML 4.01

Related

Zen coding support for CSS in Web Essentials 2012 for Visual Studio

i'Ve installed web essentials 2012 for VS2012.
But it seems it doesen't support zen coding for css??
or am i missing something??
please help..
thanks.
Web Essentials only supports ZenCoding for HTML. I decided to wait with the CSS implementation because of the CSS editors rich Intellisense and snippet support. They would most likely conflict with ZenCoding
Here's a sample to try :
h1{Good Example}#test.classname+#sibling1{div sibling1 text}+#sibling2{div sibling2 text}+h2{header2 text}+ul>li>a[href="http://stackoverflow.com"]{stackoverflow link}^li>a[href="http://codeproject.com"]{codeproject link}
Hit [TAB] Key to Expand
Remember to hit [tab] key after typing the sample, to expand the zen code to real HTML.
The sample above will expand to the following:
It will render in the browser to look like this:

Is there a way in Sublime Text 2 to support JavaScript completion of objects/functions defined in other files?

If I am editing a .js file in Sublime Text 2 that makes use of a library defined in a separate .js file, is there a way to support tab completion of objects/functions defined in the external library file?
Something analogous to the following from Visual Studio:
/// <reference path="/js/some-library.min.js" />
which enables IntelliSense over the library/plugin code.
I haven't tried it myself yet, but there's SublimeCodeIntel: https://github.com/Kronuz/SublimeCodeIntel#readme
The OP in this thread: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5319 seems to be complaining that it's pulling suggestions from outside the current file, which may mean it's doing what you want.
I was looking for the exact same thing, and I can confirm that SublimeCodeIntel works well. However, Sublime Text seems slightly less responsive when using SublimeCodeIntel, which is a drawback.
Another cool thing coming from a Visual Studio environment is the support for "Go to definition" in this plugin.
Another option is TernJS:
http://emmet.io/blog/sublime-tern/
I haven't yet used it, but it looks promising. Editor slowdown seems to be an issue with any code completion plugin; sounds like authors are still working out kinks in scraping and caching related files for code completion. The TernJS page addresses this issue and offers some config options for managing how it handles related files.

Markdown syntax highlighting in SciTE/Notepad++

I'm looking for a .properties file for Markdown syntax in SciTE. Is it possible?
A partial highlighter would do, otherwise.
I'm using this syntax file: https://github.com/leafnode/markdown_npp with some color changes to fit dark background.
I've uploaded my (dark) user-defined language Markdown highlighter on GitHub. It uses different workarounds than thomsmits', which for the style of Markdown I've chosen work better.
Until the Markdown Scintilla lexer is imported into Notepad++, user defined languages are the best we can do.
I don't use Notepad++ any more and have deleted my project. Try Brettz9's fork of the project here: https://github.com/brettz9/Notepad---Markdown-Highlighting
I'm using Markdown-plus-plus. The install instruction is outdated on many projects. The actual instruction is:
Select menu "Language" → "Define your language..."
Press button "Import...", and select {markdown}.xml (from GitHub repositories).
Restart Notepad++
I believe somebody mentioned on the mailing list that he is working on such a lexer.
I don't think a simple .properties file can do the job, as there isn't any existing lexer (to my knowledge) with similar syntax.

Embed image in code with Visual Studio

I remember reading once that there was a way to embed an image into a code file (e.g. a screenshot or diagram) in Visual Studio, but now I can't find any reference to that feature.
Is this possible to do, or am I imagining things?
EDIT: I don't mean embed the image in the executable, for use at runtime. I mean link or embed it literally in the code, for use by developers.
There is a plug-in for VS 2010 that can do this:
Plug-in
There is also a plugin for VS2012 and VS2013. At this moment installing for VS2013 does not seem to work for me though.
ImageComments extension on GitHub
You can embed images in your binary through the use of the ImageList control, which is typically used to store small icons for list controls, gridviews, etc., but could also be used for storing really any image for any purpose. A better solution would be to include a resource file and store your images there.

Visual Studio copy/paste into Outlook with standard formatting?

I have custom settings in Visual Studio that include a dark background. Copy/pasting to Outlook produces a crime against eyeballs with a dark background in code on a white background of the mail.
Does anyone have any ideas of how I can paste code in standard VS formatting (NOT unformatted text from paste special, and not paste with my custom VS formatting)?
(Alternatively, does anyone know a quick way to switch between themes in VS? Thinking that could also work...)
The following blog post details how to address this issue in VS2012:
http://codinglifestyle.wordpress.com/2013/05/17/copy-and-paste-formatting-with-visual-studios-dark-theme/
Ok so the closest I got was using CopySourceAsHtml which also allows you to define custom css styles for that copied html. I peeked at the css styles when copying code from the default VS theme and copied them over.
Got me 90% there which is good enough - no black code backgrounds on white email backgrounds!
This free VS Extension (named "Copy As HTML") allows you to choose the background color when copying to clipboard:
This is a lightweight tool that allows you to copy code from the Code
Window and convert it into HTML while preserving syntax highlighting,
indentation and background colour.
This add-in adds a command to copy in plain text: VSHelper

Resources