Skip to content

Commit b59e25a

Browse files
author
Ossian O'Reilly
committed
update docs.
1 parent c3750aa commit b59e25a

File tree

3 files changed

+34
-38
lines changed

3 files changed

+34
-38
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# Contributing
2-
Anyone is more than welcome to contribute this project, but before you submit
3-
any code, please reach out first. Use the issue tracker, or email to discuss
4-
your ideas before proceeding. Also, please follow the [code of
5-
conduct](CODE_OF_CONDUCT.md) in all of your interactions with this project.
6-
7-
## Preparing a pull request
8-
1. Present a test case that demonstrates that your contribution works as
9-
expected. Please use pytest. The test case will be the starting point for the review process.
10-
2. Please use pylint to check for coding issues.
11-
3. Update README and explain any new features that have been added.
2+
You are more than welcome to contribute this project! Please use the issue tracker, or email to reach out and discuss
3+
your ideas.
124

5+
If you are contributing new code, then
6+
1. First, fork the repository and create your own branch. Commit your changes to
7+
this branch.
8+
2. In your commit, please include a test case that demonstrates that your
9+
contribution works as expected using `pytest`.
10+
Having a test case will make it easier to review your code and therefore lead
11+
to your pull request being approved faster. Please also use `pylint` to check
12+
for issues. During development it is usually simplest to disable
13+
reports via `pylint my_feature.py --reports=n` and then enable again once all
14+
issues have been corrected. Make sure that you test all parts of your code
15+
using a coverage tool such as `py-cov`.
16+
3. Update [ACKNOWLEDGMENTS](ACKNOWLEDGMENTS.md) to make sure you get credit for
17+
your contribution.
18+
4. Update [README](README.md) to explain how to use your feature.
19+
5. Make all your commits to your feature branch and check that all tests pass.
20+
Then go ahead and submit a pull request!

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Contributors

README.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ to serve as a basic building-block for building customized documentation
55
systems. Simply put, [Docstring](README.md) extracts and parses docstrings and
66
gives you access to their data so you can decide what you want to do with it.
77

8-
* Support for `C` and `Python` code.
8+
* Support for `Python` code (support `C` is planned).
99
* Support for [Google-style docstrings](http://google.github.io/styleguide/pyguide.html)
1010
* Produces [JSON](https://www.json.org/), plain-text, and [markdown](http://commonmark.org/) output for modules, classes, functions, and
1111
methods.
1212

13-
If you are interested in learning about what motivated me to develop this
14-
package, you can read my story [here](motivation.md).
15-
1613
## Contents
1714
* [Getting Started](#getting-started)
1815
* [Usage](#usage)
@@ -37,16 +34,17 @@ $ docstring --help
3734
docstring
3835
3936
Usage:
40-
docstring <file> <name> [-tmj]
37+
docstring <file> <name> [-tmj] [-T=<tpl>]
4138
docstring -h | --help
4239
docstring --version
4340
4441
Options:
4542
-h --help Show help (this screen).
4643
--version Show version.
47-
-m --markdown Render docstring as Markdown.
48-
-t --text Render docstring as text.
49-
-j --json Render docstring as JSON.
44+
-m --markdown Output extracted docstring as Markdown.
45+
-t --text Output extracted docstring as plain-text.
46+
-j --json Output extracted docstring as JSON.
47+
-T=<tpl> --template=<tpl> Set template for Markdown output.
5048
5149
Examples:
5250
Extract the module docstring
@@ -63,12 +61,6 @@ Help:
6361
https://github.com/ooreilly/docstring
6462
```
6563

66-
### Python Examples
67-
In this example, we will extract a docstring from `example.py` and output it as
68-
plain-text, markdown, and JSON. Note that the tool works by locating the source
69-
file directly, no module imports are needed.
70-
71-
The code for `example.py`can be found in [examples/example.py](examples/example.py) and is given by
7264
```python
7365
def example_function(arg1, arg2=1):
7466
"""
@@ -94,16 +86,15 @@ def example_function(arg1, arg2=1):
9486
9587
Raises:
9688
97-
ValueError: This is exception is raised when arg1 and arg2 are the same.
89+
ValueError: This is exception is raised when arg1 and arg2 are equal.
9890
9991
"""
10092
if arg1 == arg2:
101-
raise ValueError("`arg1` and `arg2` cannot be the same")
93+
raise ValueError("`arg1` and `arg2` cannot be equal.")
10294
if arg1 > arg2:
10395
return True
10496
else:
10597
return False
106-
10798
```
10899

109100
#### Plain-text
@@ -146,7 +137,7 @@ format the data)
146137
$ docstring examples/example.py --json > examples/example_py.md
147138
148139
```
149-
Go to [examples/module_level_function.json](examples/module_level_function.json) to
140+
Go to [examples/example_py.json](examples/example_py.json) to
150141
view the output for this example.
151142

152143
### Installing
@@ -194,13 +185,13 @@ new issue if you want to suggest a new feature. Ideally, post a feature
194185
request to discuss it before you implement it and make a pull request.
195186

196187
If you are contributing new code, then
197-
1. Make sure to fork the repository and create a new branch `git checkout -b
198-
my_feature`.
199-
2. Implement your feature and prepare a test case using `pytest` to demonstrate
200-
how your feature works and that it performs according to expectations.
188+
1. First, fork the repository and create your own branch. Commit your changes to
189+
this branch.
190+
2. In your commit, please include a test case that demonstrates that your
191+
contribution works as expected using `pytest`.
201192
Having a test case will make it easier to review your code and therefore lead
202-
to your pull request being approved faster. Also use `pylint` to check
203-
syntax and code quality. During development it is usually simplest to disable
193+
to your pull request being approved faster. Please also use `pylint` to check
194+
for issues. During development it is usually simplest to disable
204195
reports via `pylint my_feature.py --reports=n` and then enable again once all
205196
issues have been corrected. Make sure that you test all parts of your code
206197
using a coverage tool such as `py-cov`.
@@ -235,10 +226,6 @@ These are some projects that inspired me to develop this tool.
235226
* [docsify](https://github.com/QingWei-Li/docsify/) Markdown-based documentation
236227
site generator.
237228

238-
These posts were also a source of inspiration:
239-
* [ ]
240-
241-
242229
## License
243230

244231
This project is licensed under the MIT License - see the

0 commit comments

Comments
 (0)