开发者

Copy Source Code as HTML Add-In for VS2010?

开发者 https://www.devze.com 2022-12-29 15:31 出处:网络
I\'ve been unable to find such an add-in for VS2010, I only found it for earlier versions. Does a开发者_如何学JAVAnyone know where I can find a newer version?You need to install the Visual Studio Pro

I've been unable to find such an add-in for VS2010, I only found it for earlier versions.

Does a开发者_如何学JAVAnyone know where I can find a newer version?


You need to install the Visual Studio Productivity Power Tools, which includes just such an extension (along with many others).


You can install the VS2008 version of CopySourceAsHtml (from here), and then manually edit the CopySourceAsHtml.AddIn file located at C:\Users\<username>\Documents\Visual Studio 2010\Addins so that both Version elements are 10.0:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
  <HostApplication>
    <Name>Microsoft Visual Studio Macros</Name>
    <Version>10.0</Version>
  </HostApplication>
  <HostApplication>
    <Name>Microsoft Visual Studio</Name>
    <Version>10.0</Version>
  </HostApplication>
  <Addin>
    <FriendlyName>CopySourceAsHtml</FriendlyName>
    <Description>Adds support to Microsoft Visual Studio 2008 for copying source code, syntax highlighting, and line numbers as HTML.</Description>
    <Assembly>JTLeigh.Tools.Development.CopySourceAsHtml, Version=3.0.3215.1, Culture=neutral, PublicKeyToken=bb2a58bdc03d2e14, processorArchitecture=MSIL</Assembly>
    <FullClassName>JTLeigh.Tools.Development.CopySourceAsHtml.Connect</FullClassName>
    <LoadBehavior>1</LoadBehavior>
    <CommandPreload>0</CommandPreload>
    <CommandLineSafe>0</CommandLineSafe>
  </Addin>
</Extensibility>


It looks like Code4Blog will do what you're looking for. I just tried it out and it seems pretty good!


Personally though, if it's an option I highly suggest you go with SyntaxHighlighter over the Html produced by this or other similar extensions because it keeps the source code more lightweight and easy to copy/paste.


Be aware that if you install CopySourceAsHtml via that hack it WILL slow down your startup time by quite a bit. It works, but you may only want to enable it when you need it.

0

精彩评论

暂无评论...
验证码 换一张
取 消