Overview
- Fork the repo on Github.
- Clone this repo to your PC.
- Look in the
src
directory and openN2.Sources.sln
. - 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".
- 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
...
Project | Description |
---|---|
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.Templates | Interface 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 add
TM_STRIP_WHITESPACE_ON_SAVE = true
to your.tm_properties
file. - For Sublime users, set the
ensure_newline_at_eof_on_save
option totrue
. - 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 | ||
---|---|---|
| ||
#!/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 | ||
---|---|---|
| ||
#!/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
...
language | bash |
---|
...
. |
...