Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

  1. Fork the repo on Github.
  2. Clone this repo to your PC.
  3. Look in the src directory and open N2.Sources.sln.
  4. Find the Visual Studio solution explorer find the web project you chose (N2.Templates.* or Dinamico), right-click on it and select "Set as StartUp Project".
  5. Compile and run (Ctrl+F5)
Note

N2 CMS supports many databases, this code is set up to use the SQLite embedded database. You may want to use SQL Server or MySQL in production.

Fork First, Contribute Later

...

ProjectDescription
N2

This is the core library of the N2 CMS. This alone provides functionality to define, store, navigate, query, filter, serialize and edit  content data. The library also helps with integrity and security issues, provides data binding utilities and web controls. N2.Tests: Unit tests for the N2 library. N2.Extensions contains a few classes to bridge over to the ASP.NET MVC framework.

N2.Edit

The edit interface. Through this interface non-technical editors can edit and manage content items. Parts of the edit functionality is organized in optional modules. The N2.Edit project provides interfaces for organizing, navigating, creating, editing, movig, copying, sorting, searching and deleting content. There is also a simple file manager. N2.Edit.Tests: unit tests.

N2.TemplatesInterface files for the templates implementation with event calendar functionality, frequently asked questions, customized form functionality, an image gallery, news functionality, poll question functionality syndication functionality, content search functionality. N2.Templates.Tests: unit tests.

Conventions

  • Unless absolutely necessary, binary files should not be checked into the Git repository
  • Text files should be encoded with UTF-8
  • Line endings should be set to \n, and every text file should end with a newline character
  • Lines should be free of trailing spaces
  • Lines are indented with tab characters (\t)
    • not 4 spaces (as is Visual Studio's default)
    • not 8 spaces, etc.

Read more on Stackoverflow: Why should I use core.autocrlf=true in Git? (external link)

Git Configuration

Code Block
git config core.autocrlf true

 

Following the rules in your editor

You can make sure you follow this rule easily:

  • For Vim users, you're all set out of the box! Just don't change your eol setting.
  • For TextMate users, you can install the Avian Missing Bundle and addTM_STRIP_WHITESPACE_ON_SAVE = true to your .tm_properties file.
  • For Sublime users, set the ensure_newline_at_eof_on_save option to true.
  • For RubyMine, set "Ensure line feed at file end on Save" under "Editor."

For visual studio, you can download this VS Settings file which will configure your environment properly.

Quick Tricks/Scripts for fixing things

Fixes "No newline at end of file" for all *.cs files (Requires Bash 4.0, based on this post http://stackoverflow.com/questions/3261925/how-to-fix-no-newline-at-end-of-file-compiler-warning-for-lots-of-files)

Code Block
languagebash
#!/bin/bash
shopt -s globstar
 
for i in **/*.cs ; do  echo $i; \
 if diff /dev/null "$i" | tail -1 | \
  grep '^\\ No newline' > /dev/null; then echo >> "$i"; \
 fi; done

Ensure newlines are \n (example is for *.aspx files)

Code Block
languagebash
#!/bin/bash
expand_func () {
  dos2unix -m -n "$1" "$1.tmp"
  mv "$1.tmp" "$1"
}
export -f expand_func
find . -name \*.aspx -exec bash -c 'expand_func {}' \;

Convert files indented with 4 spaces, to tabs

...

languagebash

...

.

...