Skip to content

Commit

Permalink
Documentation additions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansurf committed May 29, 2024
1 parent 4783465 commit b102ca8
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 17 deletions.
3 changes: 3 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# FAQ

FAQ coming soon...
19 changes: 3 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# Welcome to MkDocs
# cli-surf

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
cli-surf is a simple command line tool (with a frontend too!) that sends custom ocean/surf report
data!
23 changes: 23 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Installation

## Fork the repository

- Press **Fork** on the repository's page ([or click here](https://github.com/ryansurf/cli-surf/fork))
- Press **Create fork**
- On Github, navigate to your fork of the repository
- Click on **<> Code**
- Copy the URL for the repository

## Cloning the forked repository

Open your terminal and naviagate to the directory you want the fork to be in
```
git clone <fork URL>
Example: git clone https://github.com/ryansurf/cli-surf.git
```





9 changes: 9 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Setup

## Environment Variables

- Copy the variables from `.env.example` to `.env`
```
cp .env.example .env
```
- Edit the environment variables if necessary (see [settings]())
61 changes: 61 additions & 0 deletions docs/structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Structure

The basic structure of the project is:

```
├── docs
├── images
├── src
├── static
├── templates
└── tests
```

- `docs`: Contains markdown for the documentation (this website!)
- `images`: Images/GIFs/Media
- `src`: Source code!
- `src/static`: JavaScript
- `src/templates`: HTML
- `src/tests`: Testing files



More in-depth structure:

```
├── CONTRIBUTING.md
├── Dockerfile
├── docs
│ ├── faq.md
│ ├── index.md
│ ├── install.md
│ ├── setup.md
│ ├── styling.md
│ └── tests.md
├── help.txt
├── images
│ ├── ocean.gif
│ ├── surf.gif
│ ├── wave.png
│ └── website.gif
├── mkdocs.yml
├── README.md
├── requirements.txt
├── src
│ ├── api.py
│ ├── art.py
│ ├── cli.py
│ ├── helper.py
│ ├── __init__.py
│ ├── send_email.py
│ ├── server.py
│ ├── static
│ │ └── script.js
│ ├── templates
│ │ └── index.html
│ └── tests
│ ├── __init__.py
│ └── test_code.py
├── start_venv.sh
└── venv
```
15 changes: 15 additions & 0 deletions docs/styling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Styling

## Code Style and Quality

The [PEP 8](https://realpython.com/python-pep8/) styling convention is used.

To make sure you are following it, you can install [black](https://pypi.org/project/black/)

`pip install black`

To run black:

`black .`

On a push/pull request, git will run `black .` for you!
17 changes: 17 additions & 0 deletions docs/tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Tests

To run tests, install pytest, `pip install pytest` and navigate to `src/test`.

Run `pytest`

On a push/pull request, git will run `pytest` for you to catch any errors.

## Writing Tests

In `src/tests`, there are multiple files for different types of test cases.

- `test_helper.py`: Tests functions in `src/helper.py` (functions like rounding decimals, etc.)
- `test_api.py`: Tests functions in `src/api.py`.
- `test_server.py`: Tests the Flask server in `src/server/py`

Writing tests is encouraged, especially if you introduce a new function/feature!
11 changes: 10 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ theme:
name: material

nav:
- Home: index.md
- index.md
- General:
- FAQ: faq.md
- Developers:
- Installation: install.md
- Setup: setup.md
- Contributing:
- Styling: styling.md
- Tests: tests.md
- Structure: structure.md

0 comments on commit b102ca8

Please sign in to comment.