Code Monkey home page Code Monkey logo

sourcebrowser's Introduction

SourceBrowser

Source browser website generator that powers http://referencesource.microsoft.com and http://source.roslyn.io.

Create and host your own static HTML website to browse your C#/VB/MSBuild/TypeScript source code.

Of course Source Browser allows you to browse its own source code: http://sourcebrowser.azurewebsites.net

##Instructions:

  1. git clone https://github.com/KirillOsenkov/SourceBrowser.git
  2. cd SourceBrowser
  3. msbuild
  4. cd bin\Debug\HtmlGenerator
  5. HtmlGenerator.exe ..\..\..\TestCode\TestSolution.sln
  6. the website in bin\Debug\HtmlGenerator\Index is ready to be served

##In Visual Studio 2015:

  1. Open SourceBrowser.sln.
  2. Set HtmlGenerator project as startup and hit F5 - it is preconfigured to generate a website for TestCode\TestSolution.sln
  3. Pass a path to an .sln file or a .csproj file (or multiple paths separated by spaces) to create an index for them
  4. pass /out: to HtmlGenerator.exe to configure where to generate the website to
  5. Edit .vs\config\applicationhost.config line 166 so that physicalPath points to <virtualDirectory path="/" physicalPath="C:\SourceBrowser\bin\debug\HtmlGenerator\Index" />. Then you can set SourceIndexServer project as startup and run/debug the website.

##Conceptual design

At indexing time, C# and VB source code is analyzed using Roslyn and a lot of static hyperlinked HTML files are generated into the output directory. There is no database. The website is mostly static HTML where all the links, source code coloring etc. are precalculated at indexing time. All the hyperlinks are hardwired to be simple links bypassing the server.

The only component that runs on the webserver is a service that given a search query does the lookup and returns a list of matching types and members, which are hyperlinks into the static HTML. The webservice keeps a list of all declared types and members in memory, this list is also precalculated at indexing time. All services, such as Find All References, Project Explorer, etc. are all pre-rendered.

The website is designed to run from the root of the domain /. Making it run from a subdirectory is non-trivial.

##Project status and contributions

This is a reference implementation that showcases the concepts and Roslyn usage. It comes with no guarantees, use at your own risk. We will consider accepting high-quality pull requests that add non-trivial value, however we have no plans to do significant work on the application in its current form. Any significant rearchitecture, adding large features, big refactorings won't be accepted because of resource constraints. Feel free to use it to generate websites for your own code, integrate in your CI servers etc. Feel free to do whatever you want in your own forks. Bug reports are gratefully accepted.

For any questions, feel free to reach out to @KirillOsenkov on Twitter. Thanks to @v2_matveev for contributing TypeScript support!

sourcebrowser's People

Contributors

kirillosenkov avatar vladima avatar

Watchers

James Cloos avatar Saar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.