Skip to content

Commit 9bf6a89

Browse files
committed
Updates on contributing, along with a style-guide for authors.
1 parent a9645f1 commit 9bf6a89

File tree

6 files changed

+368
-64
lines changed

6 files changed

+368
-64
lines changed

CONTRIBUTING.md

+101
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,104 @@ Contributing
22
======
33

44
Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md) in the Home repo.
5+
6+
The documentation is built using [Sphinx](http://sphinx-doc.org) and [reStructuredText](http://sphinx-doc.org/rest.html), and then hosted by [ReadTheDocs](http://aspnet.readthedocs.org).
7+
8+
## Building the Docs ##
9+
10+
To build the docs, you will need to install [python](https://www.python.org/downloads/) (version 2 or higher). If you are running Windows, you will want to add the Python install folder and the \Scripts\ folder to your `PATH` environment variable (C:\Python34;C:\Python34\Scripts).
11+
12+
To install Sphinx, open a command prompt and run:
13+
14+
pip install sphinx
15+
16+
This may take a few minutes.
17+
18+
This project is also using a custom theme from ReadTheDocs, which you can install with:
19+
20+
pip install sphinx_rtd_theme
21+
22+
You should now be able to navigate to the `docs` folder and run
23+
24+
make html
25+
26+
which should generate the documentation in the _build folder. Open the _build/html/index.html file to view the generated documentation.
27+
28+
You can also install sphinx-autobuild which will run a local web server and automatically refresh whenever changes to docs files are detected. To do so, first install sphinx-autobuild:
29+
30+
pip install sphinx-autobuild
31+
32+
Then run it from the root of the project with
33+
34+
sphinx-autobuild docs docs/_build/html
35+
36+
Note that you may need to run 'make html' once before sphinx-autobuild will serve the docs correctly. Also, there seems to be an encoding issue in one of the CSS files in the theme that may cause Python to throw an exception when trying to serve the file. You can work around this issue by editing the cp1252.py file (most likely in C:\Python34\Lib\encodings\ on Windows). Modify the IncrementalDecoder as follows:
37+
38+
class IncrementalDecoder(codecs.IncrementalDecoder):
39+
def decode(self, input, final=False):
40+
return codecs.charmap_decode(input,'ignore',decoding_table)[0]
41+
42+
This should allow the CSS file to be loaded, but may result in icons being rendered improperly. A proper fix will likely involve confirming and correcting the encoding used by the CSS file for the RTD theme.
43+
44+
If contributing new documentation content, please review:
45+
46+
- the [Sphinx Style Guide](http://documentation-style-guide-sphinx.readthedocs.org/en/latest/style-guide.html)
47+
- [ASP.NET Docs Style Guide](http://docs.asp.net/contribute/style-guide/style-guide)
48+
49+
## Adding Content ##
50+
51+
Before adding content, submit an issue with a suggestion for your proposed article. Provide detail on what the article would discuss, and how it would relate to existing documentation.
52+
53+
Articles should be organized into logical groups or sections. Each section should be given a named folder (e.g. /yourfirst). Within each section, each article should also have its own folder, within which the article.rst file resides. Images and other static resources (code samples, etc.) should be placed in a _static folder within the article folder.
54+
55+
### Example Structure ###
56+
57+
docs
58+
/yourfirst
59+
/fundamentalconcepts
60+
/_static
61+
about-page.png
62+
add-config.png
63+
...
64+
fundamentalconcepts.rst
65+
/yourfirstaspnetapplication
66+
/_static
67+
about-page.png
68+
add-api-controller.png
69+
...
70+
yourfirstaspnetapplication.rst
71+
72+
**Note:** Sphinx will automatically fix duplicate image names, such as the about-page.png files shown above. There is no need to try to ensure uniqueness of static files beyond an individual article.
73+
74+
Author information should be placed in the _authors folder following the example of steve-smith.rst. Place photos in the photos folder - size them to be no more than 125px wide or tall.
75+
76+
## Process for Contributing ##
77+
78+
**Step 1:** Open an Issue describing the article you wish to write and how it relates to existing content. Get approval to write your article.
79+
80+
**Step 2:** Fork the `/aspnet/docs` repo.
81+
82+
**Step 3:** Create a `branch` for your article.
83+
84+
**Step 4:** Write your article, placing the article in its own folder and any needed images in a _static folder located in the same folder as the article. Be sure to follow the [ASP.NET Docs Style Guide](http://docs.asp.net/contribute/style-guide/style-guide). If you have code samples, place them in a folder within the `/samples/` folder.
85+
86+
**Step 5:** Submit a Pull Request from your branch to `aspnet/docs/master`.
87+
88+
**Step 6:** Discuss the Pull Request with the ASP.NET team; make any requested updates to your branch. When they are ready to accept the PR, they will add a :shipit: comment.
89+
90+
**Step 7:** The last step before your Pull Request is accepted is to [squash all commits](http://stackoverflow.com/questions/14534397/squash-all-my-commits-into-one-for-github-pull-request) into a single commit message. Do this in your branch, using the `rebase` git command. For example, if you want to squash the last 4 commits into a single commit, you would use:
91+
92+
git rebase -i HEAD~4
93+
94+
The `-i` option stands for "interactive" and should open a text editor showing the last N commits, preceded with "pick ". Change all but the first instance of "pick " to "squash " and save the file and exit the editor. A more detailed answer is [available here](http://stackoverflow.com/a/6934882).
95+
96+
## Common Pitfalls ##
97+
98+
Below are some common pitfalls you should try to avoid:
99+
100+
- Don't forget to submit an issue before starting work on an article
101+
- Don't forget to create a separate branch before working on your article
102+
- Don't update or `merge` your branch after you submit your pull request
103+
- Don't forget to squash your commits once your pull request is ready to be accepted
104+
- If updating code samples in `/samples/`, be sure any line number references in your article remain correct
105+

README.md

+2-62
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,7 @@
11
ASP.NET Docs
22
============
33

4-
This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo.
4+
This project provides the source for [docs.asp.net](http://docs.asp.net/). You can learn more about ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo.
55

6-
This repo contains documentation for ASP.NET 5. The documentation is built using [Sphinx](http://sphinx-doc.org) and [reStructuredText](http://sphinx-doc.org/rest.html), and then hosted by [ReadTheDocs](http://aspnet.readthedocs.org).
6+
**We accept pull requests!** However, before submitting a pull request, please [read the CONTRIBUTING guidelines](CONTRIBUTING.md), which include information on how to build the docs locally, as well as style and organizational guidance.
77

8-
## Building the Docs ##
9-
10-
To build the docs, you will need to install [python](https://www.python.org/downloads/) (version 2 or higher). If you are running Windows, you will want to add the Python install folder and the \Scripts\ folder to your PATH environment variable.
11-
12-
To install Sphinx, open a command prompt and run:
13-
14-
pip install sphinx
15-
16-
This project is also using a custom theme from ReadTheDocs, which you can install with:
17-
18-
pip install sphinx_rtd_theme
19-
20-
You should now be able to navigate to the docs folder and run
21-
22-
make html
23-
24-
which should generate the documentation in the _build folder. Open the _build/html/index.html file to view the generated documentation.
25-
26-
You can also install sphinx-autobuild which will run a local webserver and automatically refresh whenever changes to docs files are detected. To do so, first install sphinx-autobuild:
27-
28-
pip install sphinx-autobuild
29-
30-
Then run it from the root of the project with
31-
32-
sphinx-autobuild docs docs/_build/html
33-
34-
Note that you may need to run 'make html' once before sphinx-autobuild will serve the docs correctly. Also, there seems to be an encoding issue in one of the CSS files in the theme that may cause Python to throw an exception when trying to serve the file. You can work around this issue by editing the cp1252.py file (most likely in C:\Python34\Lib\encodings\ on Windows). Modify the IncrementalDecoder as follows:
35-
36-
class IncrementalDecoder(codecs.IncrementalDecoder):
37-
def decode(self, input, final=False):
38-
return codecs.charmap_decode(input,'ignore',decoding_table)[0]
39-
40-
This should allow the CSS file to be loaded, but may result in icons being rendered improperly. A proper fix will likely involve confirming the encoding used by the CSS file for the RTD theme.
41-
42-
If contributing new documentation content, please review the [Sphinx Style Guide](http://documentation-style-guide-sphinx.readthedocs.org/en/latest/style-guide.html).
43-
44-
## Adding Content ##
45-
46-
In addition to the style guide, articles should be organized into logical groups or sections. Each section should be given a named folder (e.g. /yourfirst). Within each section, each article should also have its own folder, within which the article.rst file resides. Images and other static resources (code samples, etc.) should be placed in a _static folder within the article folder.
47-
48-
### Example Structure ###
49-
50-
docs
51-
/yourfirst
52-
/fundamentalconcepts
53-
/_static
54-
about-page.png
55-
add-config.png
56-
...
57-
fundamentalconcepts.rst
58-
/yourfirstaspnetapplication
59-
/_static
60-
about-page.png
61-
add-api-controller.png
62-
...
63-
yourfirstaspnetapplication.rst
64-
65-
**Note:** Sphinx will automatically fix duplicate image names, such as the about-page.png files shown above. There is no need to try to ensure uniqueness of static files beyond an individual article.
66-
67-
Author information should be placed in the _authors folder following the example of steve-smith.rst. Place photos in the photos folder - size them to be no more than 125px wide or tall.

docs/_authors/steve-smith.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Author
1212

1313
.. container:: bio
1414

15-
Steve Smith is an ASP.NET MVP and Chief Technology Officer at Falafel Software. You can
16-
follow him on twitter as `@ardalis`_ or on his blog, `ardalis.com`_.
15+
Steve Smith is an ASP.NET MVP and Chief Technology Officer at `Falafel Software <http://falafel.com>`_. He is available for mentoring and training engagements, and has published a number of `software developer training courses on Pluralsight <http://www.pluralsight.com/author/steve-smith>`_. You can follow him on twitter as `@ardalis`_ or on his blog, `ardalis.com`_.
1716

1817
.. _`@ardalis`: http://twitter.com/ardalis
1918
.. _`ardalis.com`: http://ardalis.com/ardalis
2.79 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using Microsoft.AspNet.Builder;
3+
using Microsoft.AspNet.Hosting;
4+
using Microsoft.AspNet.Http;
5+
using Microsoft.Framework.DependencyInjection;
6+
7+
namespace ProductsDnx
8+
{
9+
public class Startup
10+
{
11+
public Startup(IHostingEnvironment env)
12+
{
13+
}
14+
15+
// This method gets called by a runtime.
16+
// Use this method to add services to the container
17+
public void ConfigureServices(IServiceCollection services)
18+
{
19+
services.AddMvc();
20+
}
21+
22+
// Configure is called after ConfigureServices is called.
23+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
24+
{
25+
app.UseStaticFiles();
26+
// Add MVC to the request pipeline.
27+
app.UseMvc();
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)