Skip to content

Commit 539f351

Browse files
committed
Added doc framework
1 parent 76443b1 commit 539f351

File tree

14 files changed

+326
-0
lines changed

14 files changed

+326
-0
lines changed

docs/assets/chr_logo.png

11.7 KB
Loading

docs/assets/extra.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* Indentation. */
2+
div.doc-contents:not(.first) {
3+
padding-left: 25px;
4+
border-left: .05rem solid var(--md-typeset-table-color);
5+
}
6+
7+
/* Normal size fonts on parameter tables */
8+
.md-typeset div.doc-contents table {
9+
font-size: 1em;
10+
width: 100%;
11+
display: table;
12+
}
13+
14+
/* Mark external links as such. */
15+
a.autorefs-external::after {
16+
/* https://primer.style/octicons/arrow-up-right-24 */
17+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="rgb(0, 0, 0)" d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
18+
content: ' ';
19+
20+
display: inline-block;
21+
vertical-align: middle;
22+
position: relative;
23+
bottom: 0.1em;
24+
margin-left: 0.2em;
25+
margin-right: 0.1em;
26+
27+
height: 0.7em;
28+
width: 0.7em;
29+
border-radius: 100%;
30+
background-color: var(--md-typeset-a-color);
31+
}
32+
a.autorefs-external:hover::after {
33+
background-color: var(--md-accent-fg-color);
34+
}
35+
span.doc-param-annotation:first-child{
36+
border-top: 1px solid var(--md-typeset-table-color);
37+
padding-top: 5px;
38+
margin-top: 5px;
39+
margin-bottom: -5px;
40+
}
41+
span.doc-param-annotation {
42+
font-size: 0.8em;
43+
display: block;
44+
}
45+
span.doc-param-default {
46+
font-size: 0.8em;
47+
float: unset;
48+
}
49+
.doc-label { border-radius: 15px; padding: 0 5px; }
50+
.doc-label code { background-color: transparent; color: white;}
51+
.doc-label-special { background-color: blue; color: white; }
52+
.doc-label-private { background-color: red; color: white; }
53+
.doc-label-property { background-color: green; color: white; }
54+
.doc-label-read-only { background-color: yellow; color: black; }

docs/assets/favicon.png

11.7 KB
Loading

docs/development.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Development
3+
summary: How to develop psmq.
4+
date: 2023-08-27
5+
---
6+
7+
# Installing from source for development
8+
9+
Clone the repo:
10+
11+
```shell
12+
$ git clone https://github.com/callowayproject/psmq
13+
```
14+
15+
`Poetry` is required. Optionally set a local python version with `pyenv`.
16+
17+
```shell
18+
$ pipx install poetry
19+
$ poetry install --with dev,test,docs
20+
$ poetry env info
21+
```
22+
23+
If you hit errors like `Poetry: Failed to unlock the collection` add `export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring` to your `.bashrc` / `.zshrc` and source it.
24+
25+
Run Python Simple Message Queue's tests from the source tree on your machine:
26+
27+
```shell
28+
$ poetry run pytest
29+
```
30+
31+
## Development Flow
32+
33+
This project uses the [GitHubFlow](https://docs.github.com/en/get-started/quickstart/github-flow) workflow.
34+
35+
Rationale:
36+
37+
* The primary branch is always releasable.
38+
* Lightweight.
39+
* Single long-lived branch. Less maintenance overhead, faster iterations.
40+
* Simple for one person projects, as well as collaboration.
41+
42+
Put simply:
43+
44+
1. Anything in the primary branch is deployable
45+
2. To work on something new, create a descriptively named branch off the primary branch (ie: new-oauth2-scopes)
46+
3. Commit to that branch locally and regularly push your work to the same named branch on GitHub
47+
4. When you need feedback or help, or you think the branch is ready for merging, open a pull request
48+
5. After someone else has reviewed and signed off on the feature, you can merge it into the primary branch
49+
6. Once it is merged and pushed to the primary branch, you can and should deploy immediately
50+
51+
**Merging**
52+
53+
Merges are done via Pull Requests.
54+
55+
56+
**Tags**
57+
58+
Tags are used to denote releases.

docs/explanation.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Explanations
3+
summary: Why Python Simple Message Queue is the way it is!
4+
date: 2023-08-27
5+
---
6+
7+
This page explains why Python Simple Message Queue is the way it is.
8+
9+
!!! warning
10+
11+
Explanation has not been implemented yet!
12+
13+
Explanation is **discussion** that clarifies and illuminates a particular topic. Explanation is **understanding-oriented.**
14+
15+
- Give context and background on your library
16+
- Explain why you created it
17+
- Provide multiple examples and approaches of how to work with it
18+
- Help the reader make connections
19+
- Avoid writing instructions or technical descriptions here
20+
- [More Information](https://diataxis.fr/explanation/)

docs/gen_doc_stubs.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""Generate documentation stubs."""
2+
from pathlib import Path
3+
from typing import Set
4+
5+
import mkdocs_gen_files
6+
7+
nav = mkdocs_gen_files.Nav()
8+
9+
src_root = Path("psmq")
10+
exclude: Set[str] = set()
11+
12+
for path in sorted(src_root.rglob("*.py")):
13+
module_path = path.with_suffix("")
14+
doc_path = path.with_suffix(".md")
15+
full_doc_path = Path("reference", doc_path)
16+
17+
parts = tuple(module_path.parts)
18+
19+
if parts[-1] == "__init__":
20+
parts = parts[:-1]
21+
doc_path = doc_path.with_name("index.md")
22+
full_doc_path = full_doc_path.with_name("index.md")
23+
elif parts[-1].startswith("_"):
24+
continue
25+
26+
nav[parts] = doc_path.as_posix()
27+
28+
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
29+
ident = ".".join(parts)
30+
fd.write(f"::: {ident}")
31+
32+
mkdocs_gen_files.set_edit_path(full_doc_path, path)
33+
34+
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
35+
nav_file.writelines(nav.build_literate_nav())

docs/glossary.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Glossary
3+
summary: A glossary of terminology used in the Python Simple Message Queue package and documentation.
4+
date: 2023-08-27
5+
---
6+
7+
A glossary of terminology and nomenclature used in the psmq package and documentation.
8+
9+
!!! warning
10+
11+
Glossary not implemented yet! Recommend each item has its own anchor link.

docs/howtos/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: How Tos
3+
summary: Recipes for common tasks using Python Simple Message Queue.
4+
date: 2023-08-27
5+
---
6+
7+
The *How To's* are intended as recipes for common tasks using psmq. See the API reference for detailed reference documentation and function, class etc definitions.
8+
9+
!!! warning
10+
11+
How Tos not implemented yet!
12+
13+
How-to guides are directions that take the reader through the steps required to solve a real-world problem. How-to guides are **goal-oriented.**
14+
15+
[More information](https://diataxis.fr/how-to-guides/)

docs/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: psmq
3+
summary: Python Simple Message Queue
4+
date: 2023-08-27
5+
---
6+
7+
# Python Simple Message Queue
8+
9+
> *Python Simple Message Queue*
10+
11+
## What Next
12+
13+
To get going quickly head over to the [Quick Start](quickstart.md) tutorial, then check out the [Tutorials](tutorials/index.md), [Reference](reference/index.md), or [How-tos](howtos/index.md) for more information. Developers should check out the [Developer Guide](development.md) for even more detailed information and advice on how to extend psmq.
14+
15+
The [Glossary](glossary.md) lists terms and nomenclature used in the package and in this documentation.

docs/installation.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Installation
3+
summary: How to install psmq.
4+
date: 2023-08-27
5+
---
6+
7+
!!! warning
8+
9+
Installation instructions not implemented yet!
10+
11+
12+
## Installing the Stable Release from PyPI
13+
14+
To install psmq, run this command in your terminal:
15+
16+
``` console
17+
$ pip install psmq
18+
```
19+
20+
This is the preferred method to install psmq, as it will always install the most recent stable release. You can also replace `pip` with `pipx`.

0 commit comments

Comments
 (0)