Skip to content

Commit

Permalink
mkdocs initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
benne238 committed Dec 17, 2020
1 parent 38445fe commit 2ea657a
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ def isValidItemName(name: str) -> bool:
class Item:
"""A single issue.
Example:
# Create an Item (ce100)
>>> item = Item("ce", 100)
### Example:
**Create an Item (ce100)**
```
>>> item = Item("ce", 100)
```
Attributes:
**Attributes:**
lastUpdated: An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem.
headers: A list of dictionaries containing header keys and values.
content: A list of section dictionaries.
Expand Down
11 changes: 11 additions & 0 deletions api/documentation/docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# API documentation

## Item Class

::: ECNQueue.Item
:docstring:

## Item functions

::: ECNQueue.Item
:members:
3 changes: 3 additions & 0 deletions api/documentation/docs/hellothere.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello there

ahh general kenobi
17 changes: 17 additions & 0 deletions api/documentation/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to MkDocs

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.
53 changes: 53 additions & 0 deletions api/documentation/docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Mkdocs configuration and installation

[Mkdocs](https://www.mkdocs.org/) is a html documentation generator which parses markdown files and outputs the contents of markdown into html. Mkautodoc is an extension of mkdocs that pulls markdown formated docstrings from python scripts without having to copy the docstrings manually. This project will make use of the mkdocs material theme.

**Note:** *The starting directory for commands will be the `webqueue2` project directory*

**1. Mkdocs, mkautodoc, and the mkdoc material theme can be installed directly with pip (ensure that the python virtual environment is running)**
```bash
pip install mkdocs
```
```bash
pip install mkautodoc
```
```bash
pip install mkdocs-material
```
**2. Mkdocs needs a directory to contain all of the documentation related files and subdirectories, to do that:**
```bash
cd api
```
This next command will create several things:
* a directory called documentation with a subdirectory called docs
* a `mkdocs.yml` file located within the newly created documentation directory
* an `index.md` file located within the newly created docs directory
```bash
mkdocs new documentation
```
**Output:**
```bash
$ mkdocs new docstwo
INFO - Creating project directory: documentation
INFO - Writing config file: documentation/mkdocs.yml
INFO - Writing initial docs: docuentation/docs/index.md
```
**3. Edit the `mkdocs.yml` file**
```bash
nano documentation/mkdocs.yml
```
*mkdocs.yml*
```yml
site_name: My Docs

markdown_extensions:
- admonition
- codehilite
- mkautodoc

theme:
name: material
```
Change the `site_name` from `My Docs` to something more appropriate but append all the other lines from above as is.

This file is used for a number of different configurations which change the output format of the html files produced my mkdocs, a list of all the flags can be found [here](https://www.mkdocs.org/user-guide/configuration/)
9 changes: 9 additions & 0 deletions api/documentation/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
site_name: WebQueue2

markdown_extensions:
- admonition
- codehilite
- mkautodoc

theme:
name: material
5 changes: 5 additions & 0 deletions api/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from distutils.core import setup
setup(name='webqueueapi',
version='1.0',
py_modules=['api', 'ECNqueue'],
)
10 changes: 10 additions & 0 deletions api/webqueueapi.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Metadata-Version: 1.0
Name: webqueueapi
Version: 1.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
6 changes: 6 additions & 0 deletions api/webqueueapi.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
api.py
setup.py
webqueueapi.egg-info/PKG-INFO
webqueueapi.egg-info/SOURCES.txt
webqueueapi.egg-info/dependency_links.txt
webqueueapi.egg-info/top_level.txt
1 change: 1 addition & 0 deletions api/webqueueapi.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions api/webqueueapi.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ECNqueue
api

0 comments on commit 2ea657a

Please sign in to comment.