Skip to content

Commit 2cd66d3

Browse files
authored
Merge pull request #70 from cal-itp/mkdocs
initial mkdocs configuration, Docker Compose service for localhost, GitHub Action to build + deploy to GitHub Pages
2 parents 80f98b0 + 0e5a8ce commit 2cd66d3

8 files changed

Lines changed: 85 additions & 2 deletions

File tree

.devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Benefits",
44
"dockerComposeFile": ["./docker-compose.yml"],
55
"service": "dev",
6-
"runServices": ["dev", "server"],
6+
"runServices": ["dev", "docs", "server"],
77
"workspaceFolder": "/home/calitp/app",
88
"postStartCommand": ["/bin/bash", "bin/init.sh"],
99
"postAttachCommand": ["/bin/bash", "bin/pre-commit.sh"],

.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ DJANGO_INIT_PATH=data/client.json
1717
DJANGO_LOCAL_PORT=8000
1818
DJANGO_LOG_LEVEL=DEBUG
1919
DJANGO_SECRET_KEY=secret
20+
21+
# mkdocs config
22+
DOCS_LOCAL_PORT=8001

.github/workflows/mkdocs.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish docs
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
7+
jobs:
8+
docs:
9+
name: Publish docs
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Deploy docs
16+
uses: mhausenblas/mkdocs-deploy-gh-pages@master
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
CUSTOM_DOMAIN: docs.calitp.org
20+
CONFIG_FILE: docs/mkdocs.yml

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ repos:
1313
- id: end-of-file-fixer
1414
- id: requirements-txt-fixer
1515
- id: check-yaml
16+
args: ["--unsafe"]
1617
- id: check-added-large-files
1718

1819
- repo: https://github.com/psf/black

Dockerfile.dev

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ FROM benefits_client:latest
33
USER root
44

55
RUN apt-get install -qq --no-install-recommends curl git jq ssh && \
6-
pip install --no-cache-dir flake8 debugpy pre-commit
6+
pip install --no-cache-dir flake8 debugpy pre-commit \
7+
mkdocs mkdocs-material mkdocs-awesome-pages-plugin \
8+
fontawesome_markdown mdx_truly_sane_lists mkdocs-macros-plugin

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ services:
4343
volumes:
4444
- .:/home/calitp/app:cached
4545

46+
docs:
47+
image: benefits_client:dev
48+
entrypoint: []
49+
command: mkdocs serve --config-file docs/mkdocs.yml --dev-addr "0.0.0.0:8001"
50+
ports:
51+
- "${DOCS_LOCAL_PORT}:8001"
52+
volumes:
53+
- .:/home/calitp/app:cached
54+
4655
server:
4756
build: ./server
4857
image: eligibility_verification_server:dev

docs/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Home
2+
3+
This is the documentation website for [`benefits`](https://github.com/cal-itp/benefits)
4+
from Cal-ITP, the [California Integrated Travel Project](https://calitp.org).

docs/mkdocs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
site_name: Benefits Documentation
2+
repo_url: https://github.com/cal-itp/benefits
3+
edit_uri: edit/dev/docs
4+
docs_dir: ./
5+
site_url: https://docs.calitp.org/benefits
6+
7+
theme:
8+
name: material
9+
features:
10+
- navigation.tabs
11+
palette:
12+
primary: "blue"
13+
accent: "amber"
14+
15+
plugins:
16+
- search
17+
- awesome-pages
18+
19+
extra_javascript:
20+
- https://unpkg.com/mermaid@8.5.0/dist/mermaid.min.js
21+
22+
extra_css:
23+
- https://use.fontawesome.com/releases/v5.13.0/css/all.css
24+
25+
markdown_extensions:
26+
- admonition
27+
- codehilite:
28+
linenums: true
29+
- pymdownx.inlinehilite
30+
- pymdownx.tasklist:
31+
custom_checkbox: true
32+
- pymdownx.tabbed
33+
- pymdownx.superfences:
34+
custom_fences:
35+
- name: mermaid
36+
class: mermaid
37+
format: !!python/name:pymdownx.superfences.fence_div_format
38+
- pymdownx.smartsymbols
39+
- meta
40+
- toc:
41+
# insert a blank space before the character
42+
permalink: ""
43+
- smarty
44+
- fontawesome_markdown

0 commit comments

Comments
 (0)