Skip to content

Commit

Permalink
Initial scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Oct 30, 2023
0 parents commit 7325a01
Show file tree
Hide file tree
Showing 31 changed files with 436 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
site
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
##@ General

# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

IMAGE ?= ghcr.io/githedgehog/hhdocs:latest
RUN = docker run --rm -it -v ${PWD}:/docs -p 8000:8000 $(IMAGE)


.PHONY: all
all: build

.PHONY: docker
docker: ## Pull mkdocs docker image.
docker pull -q $(IMAGE)

CMD ?= mkdocs

.PHONY: run
run: docker ## Run a command in the mkdocs docker image.
$(RUN) $(CMD)

.PHONY: build
build: docker ## Build the documentation.
$(RUN) mkdocs build

.PHONY: serve
serve: docker ## Serve the documentation.
$(RUN) mkdocs serve -a 0.0.0.0:8000

.PHONY: serve-versioned
serve-versioned: docker ## Serve versioned documentation with mike.
$(RUN) mike serve -a 0.0.0.0:8000

RELEASE ?= dev
ALIAS ?= master

.PHONY: deploy
deploy: docker ## Deploy documentation version with mike.
$(RUN) mike deploy -u $(RELEASE) $(ALIAS)

# TODO we need to "deploy dev" in master and "deploy -u alpha-x latest" in release/alpha-x branches
12 changes: 12 additions & 0 deletions docs/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin
nav:
- introduction.md
- getting-started
- concepts
- Wiring Diagram: wiring
- Install & Upgrade: install-upgrade
- User Guide: user-guide
- Reference: reference
- Troubleshooting: troubleshooting
- ...
- contribute
Binary file added docs/assets/favicon.ico
Binary file not shown.
Binary file added docs/assets/logo.webp
Binary file not shown.
1 change: 1 addition & 0 deletions docs/concepts/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Concepts
4 changes: 4 additions & 0 deletions docs/contribute/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nav:
- overview.md
- docs.md
- ...
Empty file added docs/contribute/docs.md
Empty file.
Empty file added docs/contribute/overview.md
Empty file.
1 change: 1 addition & 0 deletions docs/getting-started/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Getting Started
1 change: 1 addition & 0 deletions docs/install-upgrade/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Overview
Empty file.
Empty file.
165 changes: 165 additions & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# 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.


## Examples

https://squidfunk.github.io/mkdocs-material/reference/

The HTML specification is maintained by the W3C.

*[HTML]: Hyper Text Markup Language

W3C abbr coming from includes/abbreviations.md


https://squidfunk.github.io/mkdocs-material/reference/admonitions/
https://squidfunk.github.io/mkdocs-material/reference/admonitions/#supported-types

```markdown
!!! note

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```

!!! note

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.

```markdown
!!! info inline end "Lorem ipsum"

Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla et euismod nulla.
Curabitur feugiat, tortor non consequat
finibus, justo purus auctor massa, nec
semper lorem quam in massa.
```

!!! info end "Lorem ipsum"

Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla et euismod nulla.
Curabitur feugiat, tortor non consequat
finibus, justo purus auctor massa, nec
semper lorem quam in massa.

``` py
import tensorflow as tf
```

``` py title="bubble_sort.py" hl_lines="2 3" linenums="1"
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```

``` yaml
theme:
features:
- content.code.annotate # (1)
```
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
text__, images, ... basically anything that can be written in Markdown.



=== "C"

``` c
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
return 0;
}
```

=== "C++"

``` c++
#include <iostream>
int main(void) {
std::cout << "Hello world!" << std::endl;
return 0;
}
```


| Method | Description |
| :---------- | :----------------------------------- |
| `GET` | :material-check: Fetch resource |
| `PUT` | :material-check-all: Update resource |
| `DELETE` | :material-close: Delete resource |


``` mermaid
graph LR
A[Start] --> B{Error?};
B -->|Yes| C[Hmm...];
C --> D[Debug];
D --> B;
B ---->|No| E[Yay!];
```

``` mermaid
sequenceDiagram
autonumber
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```

Text can be {--deleted--} and replacement text {++added++}. This can also be
combined into {~~one~>a single~~} operation. {==Highlighting==} is also
possible {>>and comments can be added inline<<}.

{==

Formatting can also be applied to blocks by putting the opening and closing
tags on separate lines and adding new lines between the tags and the content.

==}

++ctrl+alt+del++


``` markdown
:fontawesome-regular-face-laugh-wink:
:fontawesome-brands-twitter:{ .twitter }
```

:fontawesome-regular-face-laugh-wink:
:fontawesome-brands-twitter:{ .twitter }

https://github.com/mkdocstrings/autorefs

(test url)[https://test.githedgehog.com]
1 change: 1 addition & 0 deletions docs/reference/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# API Reference
1 change: 1 addition & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# CLI reference
1 change: 1 addition & 0 deletions docs/troubleshooting/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Troubleshooting
5 changes: 5 additions & 0 deletions docs/user-guide/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nav:
- overview.md
- vpc.md
- harvester.md
- ...
Empty file added docs/user-guide/harvester.md
Empty file.
1 change: 1 addition & 0 deletions docs/user-guide/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Overview
1 change: 1 addition & 0 deletions docs/user-guide/vpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# VPCs
4 changes: 4 additions & 0 deletions docs/wiring/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nav:
- overview.md
- clos.md
- ...
19 changes: 19 additions & 0 deletions docs/wiring/clos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Clos

Placeholder:

```mermaid
flowchart TD
spine1 --- leaf1
spine2 --- leaf1
spine1 --- leaf2
spine2 --- leaf2
spine1 --- leaf3
spine2 --- leaf3
spine1 --- leaf4
spine2 --- leaf4
leaf1 --- edge1
leaf2 --- edge1
leaf3 --- edge2
leaf4 --- edge2
```
1 change: 1 addition & 0 deletions docs/wiring/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Wiring Diagram
10 changes: 10 additions & 0 deletions hhdocs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM squidfunk/mkdocs-material

COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt

COPY gitconfig /root/.gitconfig

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

17 changes: 17 additions & 0 deletions hhdocs/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

if [ "$#" -eq "0" ]; then
echo "Only mkdocs and mike commands are available"
exit 1
fi

if [ "$1" = "mkdocs" ]; then
shift
mkdocs "$@"
elif [ "$1" = "mike" ]; then
shift
mike "$@"
else
echo "Only mkdocs and mike commands are available"
exit 1
fi
7 changes: 7 additions & 0 deletions hhdocs/gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[user]
name = HHDocs
email = hhdocs@githedgehog.com

[safe]
directory = /docs
directory = /site
7 changes: 7 additions & 0 deletions hhdocs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mkdocs-glightbox
mkdocs-autorefs
mkdocs-git-revision-date-localized-plugin
mkdocs-redirects
mkdocs-awesome-pages-plugin
mkdocs-htmlproofer-plugin
mike
4 changes: 4 additions & 0 deletions includes/abbreviations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
*[VPC]: Virtual Private Cloud
*[HHFab]: Hedgehog Fabricator - a tool for building Hedgehog Fabric
Loading

0 comments on commit 7325a01

Please sign in to comment.