Skip to content

Commit a7ae309

Browse files
authored
Add initial new website (see #2232) (#2513)
* Add initial new website (see #2232) * Add mkdocs-minify-plugin to website generation * Pinned versions in Pipfile * Add mkdocs-git-revision-date-plugin to website generation * Replace mkdocs-git-revision-date-plugin with mkdocs-git-revision-date-localized-plugin for website generation
1 parent 12d0762 commit a7ae309

File tree

12 files changed

+742
-22
lines changed

12 files changed

+742
-22
lines changed

.devcontainer/devcontainer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
"features": {
99
// https://github.com/akhildevelops/devcontainer-features/issues/7
10-
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {}
10+
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {},
11+
"ghcr.io/devcontainers-contrib/features/pipenv:2": {}
1112

1213
// https://github.com/CASL0/devcontainer-features/issues/4
1314
// "ghcr.io/casl0/devcontainer-features/android-sdk:1": {}

.github/workflows/build.yml

+10
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ jobs:
9999
# This deploys content based on docs/ which ends up in site/
100100
# to https://google.github.io/android-fhir/ using GitHub Pages.
101101

102+
- name: Install Python
103+
uses: actions/setup-python@v5
104+
with:
105+
python-version: 3.11
106+
cache: "pipenv"
107+
- name: Install PipEnv
108+
uses: tiagovrtr/actions-pipenv@v1
109+
with:
110+
pipenv-version: 2023.12.1
111+
102112
- name: Build Docs Site
103113
# This 1st step intentionally runs not just on the main ("master") branch
104114
# but also for all pull requests. This serves to detect doc breakages.

.vscode/extensions.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"recommendations": ["davidanson.vscode-markdownlint"]
2+
"recommendations": [
3+
"davidanson.vscode-markdownlint",
4+
"streetsidesoftware.code-spell-checker",
5+
"redhat.vscode-yaml"
6+
]
37
}

.vscode/settings.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// https://squidfunk.github.io/mkdocs-material/creating-your-site/
3+
"yaml.schemas": {
4+
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yaml"
5+
},
6+
"yaml.customTags": [
7+
"!ENV scalar",
8+
"!ENV sequence",
9+
"!relative scalar",
10+
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
11+
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
12+
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
13+
]
14+
}

Pipfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
mkdocs-material = "~=9.5.21"
8+
mkdocs-minify-plugin = "~=0.8.0"
9+
mkdocs-git-revision-date-localized-plugin = "~=1.2.5"
10+
11+
[dev-packages]
12+
13+
[requires]
14+
python_version = "3.11"

Pipfile.lock

+617
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build-docs.bash

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ set -euox pipefail
2020
rm -rf site/
2121
mkdir -p site/
2222

23-
# TODO https://github.com/google/android-fhir/issues/2232 Add mkdocs generation
23+
# "install --deploy" is better than "sync", because it checks that the Pipfile.lock
24+
# is up-to-date with the Pipfile before installing. If it's not, it will fail the
25+
# installation. This is useful for ensuring strict dependency control during CI.
26+
pipenv install --deploy
27+
pipenv run mkdocs build
2428

2529
./gradlew dokkaHtml
2630
mkdir -p site/api/
2731
mv docs/data-capture site/api/
2832
mv docs/engine site/api/
2933
mv docs/knowledge site/api/
3034
mv docs/workflow site/api/
31-
32-
cp -R docs/index.html site/
33-

docs/contrib/docs.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Docs
2+
3+
Developer Documentation for both users of and contributors to this project is maintained
4+
alongside its code in [the `docs/` folder its git repo](https://github.com/google/android-fhir/tree/master/docs).
5+
6+
The <https://google.github.io/android-fhir/> website is automatically generated from this with Continous Integration.
7+
8+
This website is built using [Material](https://squidfunk.github.io/mkdocs-material/) for [MkDocs](https://www.mkdocs.org/).
9+
10+
## Contribute
11+
12+
Contributions to the documentation are very welcome, and should typically be made together with code contributions.
13+
14+
You can edit the `docs/**.md` files with any editor you like and include such changes with your regular Pull Requests.
15+
16+
New MD files needs to be added to `nav:` in [`mkdocs.yaml`](https://github.com/google/android-fhir/blob/master/mkdocs.yaml).
17+
18+
To generate the website, for simplicity we recommend using [GitHub Codespaces](codespaces.md); in a Terminal of such a Codespace:
19+
20+
1. `pipenv shell`: This enters a [Python "virtual environment" (`venv`)](https://docs.python.org/3/library/venv.html), using [`pipenv`](https://pipenv.pypa.io/)
21+
22+
1. `mkdocs serve`
23+
24+
1. Confirm Codespace's _"Port Forward"_ prompt to open `https://...app.github.dev`, et voilà!
25+

docs/index.html

-16
This file was deleted.

docs/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Welcome to Android FHIR SDK Technical Documentation
2+
3+
The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first
4+
healthcare applications using the [HL7® FHIR® standard](https://www.hl7.org/fhir/) on Android. It
5+
aims to accelerate the adoption of FHIR by making it easy to incorporate FHIR into new and existing
6+
mobile applications.

docs/use/api.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# API
2+
3+
* [Engine](/api/engine/1.0.0/)
4+
* [Data Capture](/data-capture/1.1.0/)
5+
* [Workflow](/api/workflow/0.1.0-alpha04/)
6+
* [Knowledge](/api/knowledge/0.1.0-alpha03/)

mkdocs.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
site_name: Android FHIR SDK
2+
site_url: https://google.github.io/android-fhir/
3+
repo_url: https://github.com/google/android-fhir/
4+
edit_uri: blob/master/docs/
5+
copyright: Copyright 2024 The Android FHIR SDK Authors
6+
7+
nav:
8+
- Users:
9+
- API: use/api.md
10+
- Contributors:
11+
- Codespaces: contrib/codespaces.md
12+
- Documentation: contrib/docs.md
13+
14+
# The following settings were originally partially inspired by
15+
# https://github.com/enola-dev/enola/blob/main/mkdocs.yaml
16+
17+
theme:
18+
name: material
19+
features:
20+
- content.action.edit
21+
- content.code.copy
22+
- navigation.expand
23+
- navigation.footer
24+
- navigation.instant
25+
- navigation.tracking
26+
- navigation.expand
27+
- navigation.path
28+
- navigation.top
29+
- navigation.sections
30+
- navigation.tabs
31+
- search.suggest
32+
- search.share
33+
34+
plugins:
35+
- search
36+
- git-revision-date-localized
37+
- minify:
38+
minify_html: true

0 commit comments

Comments
 (0)