Friday, January 6, 2012

Design of nuget package installation command

As per my previous blog post understanding of nuget package (http://www.arunrana.net/2011/10/understanding-nuget-package-manager-for.html), it is very useful tool in today .net programming , many developers building their packages and it will make process as much simple that user can install easily with just one command line.

Best example is ELMAH (Error Logging Modules and Handlers)

Today I would like to share with you that if you have already buit your Nuget package and you want to put it in your blog or webite to show commnad using standard design (with black box) as you found in Manage My Packages section on Nuget.org as per below fig.



Just you need to add below style sheet

.nuget-badge code {
background-color: #202020;
border: 4px solid silver;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
color: #E2E2E2;
display: block;
font: normal normal normal 1.5em/normal 'andale mono', 'lucida console', monospace;
line-height: 1.5em;
overflow: auto;
padding: 15px;
}

and put html code as per below with your command

 <div class="nuget-badge" >
   <p>
         <code>PM&gt; Install-Package elmah </code>
   </p>
</div>


and it's done.

cheers!

3 comments:

Anonymous said...

We are looking to add this as a feature of the gallery. aka Flair.

https://github.com/NuGet/NuGetGallery/issues/182

Anonymous said...

We are looking to add this as a feature to the NuGet Gallery. We will call it "Flair" and it will be more than just the install button.

https://github.com/NuGet/NuGetGallery/issues/182

Unknown said...

@Matthew

Thanks! It will add credit to my blog post..