Skip to content

Commit 46f96af

Browse files
author
jb5513
authored
Add files via upload
1 parent cb462f6 commit 46f96af

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

model/model-docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/book

model/model-docs/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Project Location Model Documentation
2+
3+
This directory contains the source files and configuration for generating the Project Location Model documentation as a GitHub Pages site.
4+
5+
## Structure
6+
7+
- `src/` - Markdown source files for the documentation
8+
- `src/schemas/` - Generated schema documentation (automatically created)
9+
- `book.toml` - mdbook configuration
10+
- `book/` - Generated HTML documentation (automatically created)
11+
12+
## Local Development
13+
14+
### Prerequisites
15+
16+
- Python 3.8+ with Poetry
17+
- mdbook (installed via snap, cargo, or GitHub releases)
18+
19+
### Setup
20+
21+
1. Install Python dependencies:
22+
```bash
23+
poetry install
24+
```
25+
26+
2. Generate schema documentation:
27+
```bash
28+
poetry run python generate_schema_docs.py
29+
```
30+
31+
3. Build the documentation:
32+
```bash
33+
mdbook build
34+
```
35+
36+
4. Serve locally (optional):
37+
```bash
38+
mdbook serve --open
39+
```
40+
41+
### Automatic Generation
42+
43+
The schema documentation in `src/schemas/` is automatically generated from the JSON schema files in `../schema/` using the `json-schema-for-humans` package.
44+
45+
## Deployment
46+
47+
The documentation is automatically built and deployed to GitHub Pages via the GitHub Actions workflow defined in `.github/workflows/builddeploy.yaml`. The workflow:
48+
49+
1. Generates schema documentation from JSON schemas
50+
2. Builds the mdbook documentation
51+
3. Builds the React Project Location validator
52+
4. Combines everything into a single GitHub Pages deployment
53+
54+
The deployed site includes:
55+
- Main documentation at the root
56+
- Project Location validator at `/project-location-validator/`
57+
58+
## Adding New Content
59+
60+
1. Create new `.md` files in the `src/` directory
61+
2. Add them to `src/SUMMARY.md` to include in the navigation
62+
3. Commit and push to trigger automatic deployment
63+
64+
## Schema Documentation
65+
66+
Schema documentation is automatically generated from JSON schema files. If you add new schemas to `../schema/`, they will be automatically included in the next build.

model/model-docs/book.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[book]
2+
authors = ["Project Team"]
3+
language = "en"
4+
src = "src"
5+
title = "Project Location Model Documentation"
6+
7+
[output.html]
8+
additional-css = ["src/custom.css"]
9+
git-repository-url = "https://github.com/mapme-initiative/IATI_project_location_standard"
10+
11+
[preprocessor.links]

0 commit comments

Comments
 (0)