Skip to content

Commit

Permalink
docs(init): create initial documentation pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Icikowski committed Jan 27, 2023
1 parent 1c0902b commit 1e76f56
Show file tree
Hide file tree
Showing 20 changed files with 334 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/hooks/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ def on_page_markdown(markdown: str, **kwargs):
links = [el[0] for el in re.findall(r"((?<!!)\[((X[^\]]+?)|([^X].*?))\]\(http[s]?://.*?\))", markdown)]
content = markdown
for link in links:
content = content.replace(link, link + '{: rel="nofollow noopener" target="_blank" }')
content = content.replace(link, link + '{: rel="nofollow noopener" target="_blank" }', 1)
return content
19 changes: 18 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ markdown_extensions:
- pymdownx.tasklist:
custom_checkbox: true
- attr_list
- md_in_html
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg

extra:
generator: false
Expand All @@ -84,9 +88,9 @@ extra:
version:
provider: mike


extra_css:
- assets/css/extra.css
- assets/css/cards.css

hooks:
- hooks/links.py
Expand All @@ -96,7 +100,20 @@ nav:
- index.md
- Installation:
- installation/index.md
- Binaries: installation/binaries.md
- Docker: installation/docker.md
- Kubernetes (via Helm): installation/kubernetes.md
- Usage:
- usage/index.md
- Configuration:
- usage/config/index.md
- Configuration variables: usage/config/vars.md
- TLS configuration: usage/config/tls.md
- Admin API:
- usage/admin/index.md
- Status: usage/admin/status.md
- Payloads: usage/admin/payloads.md
- Routes: usage/admin/routes.md
- Liveness & readiness probes: usage/health.md
- Examples:
- examples/index.md
66 changes: 66 additions & 0 deletions docs/sources/assets/css/cards.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.cards > ul {
display: flex !important;
align-items: stretch;
align-content: stretch;
flex-flow: row wrap;
gap: 0.5rem;
margin-left: 0 !important;
}

.cards.cols-1 > ul > li {
flex-basis: 100%;
}

.cards.cols-2 > ul > li {
flex-basis: calc(50% - 0.25rem);
}

.cards.cols-3 > ul > li {
flex-basis: calc(33.3333333% - 0.3333333rem);
}

.cards.cols-4 > ul > li {
flex-basis: calc(25% - 0.375rem);
}

@media screen and (max-width: 980px) {
.cards.cols-2 > ul > li { flex-basis: 100%; }
.cards.cols-3 > ul > li { flex-basis: 100%; }
.cards.cols-4 > ul > li { flex-basis: 100%; }
}

.cards > ul > li {
display: flex;
flex-direction: column;
margin: 0 !important;
box-sizing: border-box;
padding: 0.5rem;
border: .05rem solid var(--md-default-fg-color--lightest);
border-radius: .1rem;
margin: 0;
padding: .8rem;
transition: border .25s, box-shadow .25s;
}

.cards > ul > li:hover {
border-color: #0000;
box-shadow: var(--md-shadow-z2);
}

.cards > ul > li > * {
margin: 0.5em 0;
}

.cards > ul > li > :first-child {
padding-top: 0;
margin-top: 0;
}

.cards > ul > li > :last-child {
padding-bottom: 0;
margin-bottom: 0;
}

.cards > ul > li > :nth-child(3) {
flex-grow: 100;
}
20 changes: 19 additions & 1 deletion docs/sources/assets/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
--md-primary-fg-color--light: #547AA5;
--md-primary-fg-color--dark: #22223B;

--md-accent-fg-color: #FED766;
--md-accent-fg-color: #CBAC52;
--md-accent-fg-color--transparent: rgba(254, 215, 102, 0.1);
}

p {
hyphens: auto;
text-align: justify;
}

@media screen and (max-width: 980px) {
.smallImg {
max-width: 20% !important;
}
}

@media screen and (min-width: 981px) {
.smallImg {
max-width: 10% !important;
}
}

Binary file added docs/sources/assets/img/logo-inv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/sources/examples/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Examples
---

# Examples

> To be developed
9 changes: 6 additions & 3 deletions docs/sources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ hide: ["navigation"]

# GoosyMock

![GoosyMock icon](assets/img/logo.png#only-light){ align=right .smallImg }
![GoosyMock icon](assets/img/logo-inv.png#only-dark){ align=right .smallImg }

**GoosyMock** is a configurable test service for mocking HTTP responses,
featuring SSL support, dedicated administration API and custom payloads
(binary files that can be served on particular routes). It's also prepared
Expand Down Expand Up @@ -32,6 +35,6 @@ code from scratch.
- [X] Running in rootless mode
- [X] Kubernetes support
- [X] Helm chart available
- [X] Image running as non-root
- [X] All settings can be configured via chart values
- [X] Support Ingress controllers
- [X] Rootless container image
- [X] All settings configurable via chart values
- [X] Support for Ingress controllers
63 changes: 63 additions & 0 deletions docs/sources/installation/binaries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Binaries
---

# Running **GoosyMock** from binaries

## Downloading pre-built binaries

**GoosyMock** offers pre-build binaries for following operating systems and
architectures:

| Operating system | OS codename | Architectures |
|-|-|-|
| Linux | `linux` | `amd64`, `386`, `arm`, `arm64`, `ppc64le` |
| Windows | `windows` | `amd64`, `386` |
| MacOS | `darwin` | `arm64` |

Properly named binaries are attached as release assets and can be downloaded
from [*Releases* page on GitHub](https://github.com/Icikowski/GoosyMock/releases/latest).

## Building binaries manually

!!! info "Prerequisites"
- **Git** 2.34+
- **Go** 1.19+
- **Taskfile** 3.17+

### Cloning the repository

=== "Clone via HTTPS"

```bash
git clone https://github.com/Icikowski/GoosyMock.git
```

=== "Clone via SSH"

```bash
git clone [email protected]:Icikowski/GoosyMock.git
```

### Building the sources

!!! tip "Using _Taskfile_"
This project utilizes _[Taskfile](https://taskfile.dev)_ for build
automatization. If you are willing to use `task` command for building
binaries, please install _Taskfile_ as described in
[official documentation](https://taskfile.dev/installation).

Binary will be built for current OS & architecture and placed in
`target/binaries` directory.

=== "Building static binary"

```bash
task build:static
```

=== "Building dynamic binary"

```bash
task build:dynamic
```
3 changes: 3 additions & 0 deletions docs/sources/installation/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Docker
---
32 changes: 31 additions & 1 deletion docs/sources/installation/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
---
title: Installation
---

# Installation Guide

> To be developed
<div class="cards cols-3" markdown>

- :material-file-multiple:{ .lg .middle } **Binaries**

---

Download or build **GoosyMock** binaries for direct use and jump start the adventure.

[:material-arrow-right: Binaries](binaries.md)

- :material-docker:{ .lg .middle } **Docker container image**

---

Start **GoosyMock** starting Docker container and jump right into the action.

[:material-arrow-right: Docker](docker.md)

- :material-kubernetes:{ .lg .middle } **Kubernetes (via Helm)**

---

Deploy **GoosyMock** instance on your Kubernetes cluster and don't worry about maintenance.

[:material-arrow-right: Kubernetes (via Helm)](kubernetes.md)

</div>
3 changes: 3 additions & 0 deletions docs/sources/installation/kubernetes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Kubernetes (via Helm)
---
45 changes: 45 additions & 0 deletions docs/sources/usage/admin/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Admin API
---

# Admin API Guide

<div class="cards cols-1" markdown>

- :simple-openapiinitiative:{ .lg .middle } **OpenAPI Specification**

---

Check the OpenAPI Specification of **GoosyMock**'s Admin API.


[:material-arrow-right: OpenAPI Specification](https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/Icikowski/GoosyMock/main/api/spec_adminapi.yaml)

</div>

<div class="cards cols-3" markdown>

- :material-list-status:{ .lg .middle } **Status**

---

Check the documentation for `/` endpoint.

[:material-arrow-right: Status](status.md)

- :material-router:{ .lg .middle } **Routes**

---

Check the documentation for `/routes` endpoint.

[:material-arrow-right: Routes](routes.md)

- :material-file-star:{ .lg .middle } **Payloads**

---

Check the documentation for `/payloads` endpoint.

[:material-arrow-right: Payloads](payloads.md)
</div>
3 changes: 3 additions & 0 deletions docs/sources/usage/admin/payloads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Payloads endpoint
---
3 changes: 3 additions & 0 deletions docs/sources/usage/admin/routes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Routes endpoint
---
3 changes: 3 additions & 0 deletions docs/sources/usage/admin/status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Status endpoint
---
25 changes: 25 additions & 0 deletions docs/sources/usage/config/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Configuration
---

# Configuration Guide

<div class="cards cols-2" markdown>

- :material-code-braces:{ .lg .middle } **Configuration variables**

---

Learn about environment variables used for **GoosyMock**'s configuration.

[:material-arrow-right: Configuration variables](vars.md)

- :material-lock:{ .lg .middle } **TLS configuration**

---

Deep dive into **GoosyMock**'s TLS & SSL configuration.

[:material-arrow-right: TLS configuration](tls.md)

</div>
3 changes: 3 additions & 0 deletions docs/sources/usage/config/tls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: TLS configuration
---
3 changes: 3 additions & 0 deletions docs/sources/usage/config/vars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Configuration variables
---
3 changes: 3 additions & 0 deletions docs/sources/usage/health.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: Health probes
---
Loading

0 comments on commit 1e76f56

Please sign in to comment.