Skip to content

Commit 50b8614

Browse files
Mkdocs on GitHub Pages (#226)
Depends on #225. Uses `mkdocs` to build the documentation into a read-the-docs theme, and copies over the Javadocs (from #224) and REST Endpoint API docs (from #225) into the static site folder so they can also be served (and are linked to from the `.nav.yml`). Detailed why we ended up with mkdocs over other alternatives in ADR 13. --------- Co-authored-by: plocket <[email protected]>
1 parent 99f8175 commit 50b8614

File tree

10 files changed

+153
-5
lines changed

10 files changed

+153
-5
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
steps:
1010
- uses: actions/checkout@v3
11-
- name: Set up JDK 11
11+
- name: Set up JDK 21
1212
uses: actions/setup-java@v4
1313
with:
1414
java-version: '21'

.github/workflows/docs_site.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2+
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.10'
33+
cache: 'pip'
34+
- name: Build Mkdocs
35+
run: |
36+
pip install mkdocs mkdocs-awesome-nav
37+
mkdocs build
38+
- uses: actions/setup-java@v4
39+
with:
40+
java-version: '21'
41+
distribution: 'adopt'
42+
cache: 'maven'
43+
- name: Build Javadoc and Enunciate Swagger UI
44+
run: |
45+
mvn --batch-mode -Preproducible compile javadoc:javadoc javadoc:aggregate
46+
cp -r target/reports/apidocs site/apidocs
47+
cp -r proxyserver/target/enunciate-docs/apidocs site/endpoints
48+
# Adds a setting to swagger-ui to turn off the "Try it now" buttons
49+
# Not active right now, but keeping around in case we want to change
50+
# sed -i 's/url\: url/url\: url\, supportedSubmitMethods\: \[\]/' site/endpoints/ui/swagger-initializer.js
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: site/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ proxyserver/tyler_efm_codes*
8686

8787
# formatting
8888
google-java-format_*
89+
90+
# MKDocs Output
91+
site

docs/.nav.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
nav:
2+
- README.md
3+
- developing.md
4+
- operations_guide/index.md
5+
- architecture.md
6+
- "REST API Docs 🔗": /endpoints
7+
- "Javadocs 🔗": /apidocs
8+
- "*"

docs/setup.md renamed to docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,8 @@ mvn test
134134
## Contents of .env file
135135

136136
See [env.example](../env.example) for the most up to date documentation for this.
137+
138+
139+
## Next steps
140+
141+
See [developing.md](developing.md).
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Choice of Documetation Site Framework
2+
3+
Author: Bryce Willey
4+
5+
Date: 2025-06-25
6+
7+
Status: Decided, In progress
8+
9+
While we have various ways of generating and viewing docs locally (manually
10+
building javadocs, using [enunciate](008-choice-of-rest-docs.md) to view REST
11+
endpoint docs), there's no easy way to access this information if you don't
12+
have a local development environment set up (i.e. new developers or folks who
13+
don't work on this repo much).
14+
15+
We should host this information on a documentation site that is easily findable and
16+
accessible. The only real choice for where to host it is on GitHub pages, and
17+
IMO it should be separate from the rest of the [Assembly Line documentation](https://assemblyline.suffolklitlab.org/docs/overview).
18+
This ADR focuses on how to generate the static HTML that will be hosted on
19+
GitHub pages.
20+
21+
## Considered Alternatives
22+
23+
* `mvn site` and the maven-site-plugin
24+
* `docsite`: https://github.com/luiinge/docsite-maven-plugin?tab=readme-ov-file
25+
* `jekyll`, the default / best supported static site generator for GitHub pages
26+
* `mkdocs`: https://www.mkdocs.org/
27+
* `docusaurus`, what we use for the Document Assembly Line documetation
28+
29+
## Decision Outcome
30+
31+
**mkdocs**
32+
33+
* `+` it Just Works. Out of all of the options tried, needed the least
34+
customization, and no moving of documetation files.
35+
* `+` lets us easily add links to other URLs (necessary to include externally
36+
generated javadocs and Swagger API docs)
37+
* `+` built on python, so not too much of a lift compared to other choices
38+
* `-` is a new documetation generator compared to what's already available
39+
* `-` not the biggest fan of either of the themes, but they're good enough and
40+
there are [alternate themes available](https://github.com/mkdocs/catalog?tab=readme-ov-file#-theming)
41+
42+
## Pros and Cons of the Alternatives <!-- optional -->
43+
44+
### maven-site-plugin
45+
46+
* `+` already built into maven
47+
* `-` unintuitive layout and navigation, doesn't emphasize the right things
48+
* `-` would have to move markdown content to `src/site/markdown`, a very
49+
confusing place to put documentation when simply browsing the project.
50+
* `-` cumbersome to use and try to find documentation for (maven has lots of
51+
documentation, but little of it is immediately usable, or could serve as a good reference)
52+
* `-` not aesthetically appealing
53+
54+
### docsite
55+
56+
* `+` a better alternative to maven site, can use a maven plugin
57+
* `-` had conflicting errors with multi-module projects
58+
* `-` still some wonky-ness when trying to include a docs folder
59+
60+
### jekyll
61+
62+
* `+` the best support when trying do stuff on GitHub pages (prebuilt actions,
63+
etc.)
64+
* `-` almost all Jekyll themes don't have good navigation
65+
* `-` still quite a bit of extra setup to get things set up, without adding a
66+
lot of extra config and `_layout` dirs, etc.
67+
68+
### Docusaurus
69+
70+
* `+` already used by other Suffolk projects
71+
* `-` too heavy-weight for this project, still lots of config

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# E-file Proxy Architecture
1+
# Architecture
22

33
There's a glossary at the end with common e-filing jargon.
44
If I refer to specific `*.java` files, I will use just the file name (i.e. `LoginDatabase.java`) if it's unique in the repo, or sub number of

docs/https.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ We are still working to improve the steps, but current the process is:
1919
Something like `openssl rand -base64 12` will generate 16 characters securely.
2020
* You can also set a `MONITORING_EMAIL` which will be used for email renewal reminders from Lets Encrypt.
2121
2. Start up the docker containers (see [setup.md](setup.md)).
22-
3. Start a bash shell inside the running container: `docker exec -it efileproxyserver-efspjava-1 /bin/sh`
22+
3. Start a shell inside the running container: `docker exec -it efileproxyserver-efspjava-1 /bin/sh`
2323
4. Change directories to the app: `cd /app`.
2424
5. Run the ACME renewal process: `java -cp efspserver-with-deps.jar edu.suffolk.litlab.efspserver.services.acme.AcmeRenewal renew`.
2525
If the renewal process succeeded, `acme-domain-chain.crt` and `tls_server_cert.jks`
2626
should both be present in `/tmp/tls_certs` inside the container and in `src/main/config` outside the container.
27-
6. Exit the bash shell you started, and rebuild and restart the java docker container.
27+
6. Exit the shell you started, and rebuild and restart the java docker container.
2828

2929
The newly started container should be able to serve HTTPS correctly!
3030

docs/wsdl2java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WSDL2Java: Generating the SOAP code
1+
# Using WSDL2Java
22

33
The proxy server uses SOAP to communicate with Tyler's Efiling Manager servers (EFM).
44
SOAP describes the procedure calls that can be made to the server using XML. The SOAP library

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
site_name: Suffolk LIT Lab E-file Proxy Server
2+
3+
theme: readthedocs
4+
5+
plugins:
6+
- search
7+
- awesome-nav

0 commit comments

Comments
 (0)