Skip to content

Commit 58aa553

Browse files
Add example docs (#1)
* Add example docs * Fix up the toc * Add installation docs page. * Add getting started docs * Add contributing documentation * Update the readme for the example repo
1 parent 8e7f1c4 commit 58aa553

File tree

5 files changed

+95
-15
lines changed

5 files changed

+95
-15
lines changed

README.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
# django-commons-playground
2-
A sample project to test things out
1+
# Django Commons example repository
32

3+
This is an example repository for Django Commons. Some relevant areas to review are:
44

5-
## Running tests
6-
7-
```shell
8-
python -m unittest
9-
```
10-
11-
## Manually building and uploading
12-
13-
```shell
14-
python3 -m pip install -U twine build
15-
python3 -m build
16-
python3 -m twine upload --repository testpypi dist/*
17-
```
5+
- GitHub action ([release.yml](https://github.com/django-commons/django-commons-playground/blob/main/.github/workflows/release.yml)) for releasing to PyPI
6+
- [Documentation](docs/README.md)

docs/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Documentation
2+
3+
The documentation for Django Commons Playground serves as an example for what
4+
a repository should contain. The structure doesn't have to be exactly the same
5+
as this, but it's a starting point. Any docs is better than no docs. Maintained
6+
and organized docs are the best docs.
7+
8+
## Table of Contents
9+
10+
- [Installation](installation.md)
11+
- [Getting Started](getting_started.md)
12+
- [Contributing](contributing.md)
13+
- [Code of Conduct](../CODE_OF_CONDUCT.md)

docs/contributing.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
Everyone is welcome to contribute to `django-commons-playground`. We strictly
4+
enforce our [Code of Conduct](../CODE_OF_CONDUCT.md), so please review it before
5+
contributing.
6+
7+
## Getting started
8+
9+
1. [Fork the repository](https://github.com/django-commons/django-commons-playground/fork)
10+
2. Clone your fork of the repository `git clone [email protected]:[YOUR_USERNAME_HERE]/django-commons-playground.git && cd django-commons-playground`
11+
3. Create a venv and activate it `python -m venv venv && source venv/bin/activate`
12+
4. Create a feature branch for your work `git checkout -b relevant-branch-name-here`
13+
5. Implement your changes, run the tests and make a commit to your branch
14+
6. Push your branch to GitHub `git push origin relevant-branch-name-here`
15+
7. Create a [PR on the upstream repo (this repo)](https://github.com/django-commons/django-commons-playground/pulls)
16+
17+
## Architecture
18+
19+
The django-commons-playground is a collection of utility functions with a
20+
playground theme. The purpose is to serve as an example to inbound repositories.
21+
Because of that the documentation, pre-commit configuration and GitHub actions
22+
are the most important aspects of the project. The code itself is secondary.
23+
24+
## Running the tests
25+
26+
```shell
27+
python3 -m unittest
28+
```
29+
30+
Nothing special here!
31+
32+
## Releasing
33+
34+
The repo is configured to [automatically release to PyPI](https://github.com/django-commons/django-commons-playground/blob/main/.github/workflows/release.yml)
35+
when a new tag is pushed to GitHub. This makes use of [PyPI's trusted publishers](https://docs.pypi.org/trusted-publishers/).
36+
37+
### Manual releases
38+
39+
In the case a manual release is necessary, you'll need to use [Twine](https://github.com/pypa/twine) and [Build](https://github.com/pypa/build).
40+
41+
```shell
42+
# Install packaging dependencies
43+
python3 -m pip install -U twine build
44+
# Build the project
45+
python3 -m build
46+
# Release to test PyPI
47+
python3 -m twine upload --repository testpypi dist/*
48+
# Release to PyPI
49+
python3 -m twine upload dist/*
50+
```

docs/getting_started.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Getting Started
2+
3+
This is an example project. You should not be using this. That said,
4+
after [installing the project](installation.md), you can use the functionality
5+
as such:
6+
7+
```python
8+
from django_commons_playground import playground
9+
10+
print(playground.seesaw())
11+
print(playground.seesaw())
12+
```

docs/installation.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Installation
2+
3+
This section explains how to install `django-commons-playground` to use within
4+
your project. It assumes you have a working installation of Python 3.
5+
6+
1. Create venv/virtualenv (`python -m venv venv`)
7+
2. Activate venv/virtualenv (`source venv/bin/activate`)
8+
3. Install `django-commons-playground` (`pip install django-commons-playground`)
9+
10+
All together now:
11+
12+
```shell
13+
python -m venv venv
14+
source venv/bin/activate
15+
pip install django-commons-playground
16+
```

0 commit comments

Comments
 (0)