Skip to content

Commit c89e4e8

Browse files
committed
Add contribution guidelines
1 parent 04c5cea commit c89e4e8

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

CONTRIBUTING.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Contribution Guidelines
2+
3+
You can help by contributing new examples or improve on existing ones that
4+
demonstrate how to use the various MoreLINQ methods and extensions.
5+
6+
All it takes to add an example is the following fenced-block in a Markdown
7+
document:
8+
9+
```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj
10+
// replace this comment with your example code
11+
```
12+
13+
**You can develop an example as a single C# expression or as C# statements.**
14+
In the above example, `--region statements` assumes the example code is
15+
expressed as one or more C# statements:
16+
17+
```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj
18+
var xs = Enumerable.Range(1, 5);
19+
foreach (var x in xs)
20+
Console.WriteLine(x);
21+
```
22+
23+
To show an example as a single C# expression, instead, change
24+
`--region statements` to `--region expression`. The benefit is that you do not
25+
need to worry about looping and displaying the result of the expression via
26+
`Console.WriteLine`. This will be done automatically when the example is run
27+
interactively through Try .NET. Following is an example using an expression:
28+
29+
```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj
30+
Enumerable.Range(1, 5)
31+
```
32+
33+
Note that expressions _must not_ be terminated by a semi-colon (`;`), which is
34+
the standard syntax rule in C#.
35+
36+
Keep examples:
37+
38+
- simple
39+
- clear
40+
- short
41+
- meaningful
42+
- self-contained
43+
44+
**Wrap paragraphs in Markdown documents such that no line exceeds 78
45+
characters in length.** See the "Wrap Your Text" section of [Markdown Style
46+
Guide] on [Miguel de Icaza's Blog][tirania] for the background behind this
47+
choice.
48+
49+
That's it! Fork away and submit your pull request!
50+
51+
52+
[Markdown Style Guide]: https://tirania.org/blog/archive/2014/Sep-30.html
53+
[tirania]: https://tirania.org/blog/

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ run and tested interactively in a browser using [`dotnet try`
66

77
See [Setup](setup.md) for requirements and installation instructions.
88

9+
See the [Contribution Guidelines](CONTRIBUTING.md) if you would like to help
10+
contribute new examples or improve existing ones.
11+
912

1013
## Examples
1114

0 commit comments

Comments
 (0)