Why did I create codestyle.co?

Code style and standards has been a passion of mine for a long time. I've helped a lot of different companies create and adopt code standards. During that time, while everyone has agreed that the standards need to be a dynamic document, no one ever goes back and adjusts them as new languages and technologies are introduced, new guidelines are implicitly put into place, or existing guidelines are dropped.

Inspired by Code Guide by @mdo, for HTML and CSS standards, I decided to create a central repository for code standards that is available on line. Hopefully, the guidelines contained here will continually be expanded to cover additional programming languages and language features as the languages are updated.

How do I contribute?

If you have questions about any of the guidelines, please open an issue. If you find any errors, want to update an existing guideline, add a new guideline to an existing language, or even want to add a new language all you need to do is fork the repository and submit a pull request. If you aren't comfortable forking repositories and submitting pull requests, simply open an issue.

All of the standards are maintained in a GitHub repository. This was done to help keep the content up to date by allowing community contributions and open discussions.

Each language is in it's own folder under the data folder and contains a contents.json file as well as the markdown files for each individual guideline. The contents.json file acts as a table of contents and allows me to easily turn guidelines on or off, control the order, and maintain reference links without having to edit the actual guideline content itself. The markdown files are completely self-contained guidelines and include both the text of the guideline plus all code examples.

Where is the code for the website?

While the data files for the actual guidelines are open source and available on GitHub, the code for the website itself is not. This was done primarily to minimize the amount of "clutter" in the GitHub repository and keep it focused just on the data files. The website code is maintained in a private Visual Studio Online repository, but if there is enough interest in making it available through GitHub as well I can consider moving it to a branch of the codestyle.co repository.

Technical details

  • The data files for the guidelines are stored in markdown format to make it easy to modify. The file for the table of contents for each language is stored in JSON format.
  • The website is written in ASP.NET MVC and hosted on Microsoft Azure.
  • The styling for the site is Bootstrap 3.2 and an adapted version of the Instant theme by BlackTie.co.
  • The icon fonts are provided by Bootstrap, Font Awesome and Pictonic.
  • The markdown processing and rendering is done with a modified version of MarkdownDeep.
  • The syntax highlighting for the code examples is done with highlight.js. If you include a new language and notice that it isn't being highlighted properly, please open an issue.
  • The "go to top" feature is done with GoUp by Roger Vila.
  • The smooth scrolling is done using jquery.scrollTo and jquery.localScroll by Ariel Flesler.
  • The continuous integration server for the content files is hosted at AppVeyor.