Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Add CONTRIBUTING.md with basic reStructuredText cheatsheet #71

Merged
merged 1 commit into from
Apr 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Contributing
============

Docstring Format
----------------

'The documentation style is [Sphinx' reStructuredText](http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html). Here is an example demonstrating the most common syntax:

```python
def foo(a, b):
"""
Short description of the function.

:param a: description of the parameter
:type a: the type of a parameter
:param int b: another syntax, for specifying the parameter's type and description together

:return: what the function returns
:rtype: the type the function returns

:raises TypeError: possible exception and when is it thrown

Longer description of the function, may contain multiple lines.

Italic is formatted with a single asterisk - *italic*.

Bold is formatted with a double asterisks - **bold**.

Inline code style is formatted with double backticks: ``identifier``.

Code blocks are formatted with the code-block directive and an indentation:

code-block::

assert foo(1, 1) == True

Or, you can add double colon at the end of a line to include a code block after that line::

assert foo(1, 2) == False

Example of interactive Python session that demonstrate the function are formatted with three greater-thans:

>>> foo(2, 2)
True

The interactive Python session formatting ends after one blank line
"""
if type(a) is not type(b):
raise TypeError('a and b are not of the same type')
return a == b
```
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

# easypy
easypy makes python even easier!

Contributers please read [CONTRIBUTING.md](CONTRIBUTING.md).