You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f3fa2db
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+28-16Lines changed: 28 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,14 @@
1
1
# Contributing to the DFO docs
2
2
3
-
The DFO docs serve analysts who know the DAC and the CRS, write some Python or R, and need data they can trust in their own work. AI assistants read the same pages. This guide covers where pages live, how to write one, and how a source repository publishes its own pages into the corpus.
3
+
Issues and pull requests are welcome. The ONE Data team maintains this repository. Open an issue to discuss a large change, such as a new section or a new source repository, before you write it. Contributors follow the [Code of Conduct](https://github.com/DevelopmentFinanceObservatory/.github/blob/main/CODE_OF_CONDUCT.md). Report security issues through the "Report a vulnerability" button under the repository's Security tab, as the [security policy](https://github.com/DevelopmentFinanceObservatory/.github/blob/main/SECURITY.md) describes.
4
+
5
+
The DFO docs serve analysts who know the DAC and the CRS, write some Python or R, and need data they can trust in their own work. AI assistants read the same pages.
4
6
5
7
## Where pages live
6
8
7
9
The site publishes hub pages from Markdown files under `content/hub/` in this repository. Source pages live in each source repository's docs folder, and the build fetches them through a row in `sources.yaml`.
8
10
9
-
```
11
+
```text
10
12
dfo-docs/
11
13
├── content/hub/ hub pages; a page's URL is its path here
12
14
│ ├── index.md Home, published at /docs
@@ -21,7 +23,7 @@ dfo-docs/
21
23
22
24
A hub page publishes at its path under `content/hub/` without the `.md` suffix, so `content/hub/data/glossary.md` publishes at `/docs/data/glossary`. Its place in the nav comes from `hub.yaml`, so a page can move in the nav without changing its URL. Only pages named in `hub.yaml` publish.
23
25
24
-
A source repository with several pages groups them by mode:`tutorials/`, `how-to/` and `about/`, as `tossd-reader` does.
26
+
A source repository with several pages groups them by mode in`tutorials/`, `how-to/` and `about/`, as `tossd-reader` does.
25
27
26
28
## Writing a page
27
29
@@ -48,11 +50,11 @@ Use DFO values in examples, including `country/NGA`, CRS purpose 12220, finance
48
50
49
51
End every page with a `## Next` section of one or two links, each with a sentence saying what the reader gets there. Leave out boilerplate headings such as Overview, Summary or Conclusion.
50
52
51
-
Use only three callouts:`!!! note`, `!!! tip` and `!!! warning`. Leave them untitled and indent the body four spaces. The build renders them as site alerts. A title becomes a bold lead sentence, so put the point in the body. Use callouts for optional material and keep required information in the page body.
53
+
Use only three callouts,`!!! note`, `!!! tip` and `!!! warning`. Leave them untitled and indent the body four spaces. The build renders them as site alerts. A title becomes a bold lead sentence, so put the point in the body. Use callouts for optional material and keep required information in the page body.
52
54
53
55
```markdown
54
56
!!! warning
55
-
Studio links are always snapshots.
57
+
Studio links are always snapshots.
56
58
```
57
59
58
60
The build passes collapsible `???` blocks through unchanged, where they render as raw text. Leave them out.
@@ -96,7 +98,7 @@ Only published pages are valid link targets. The link check fails for a page abs
96
98
97
99
## Publishing a source repository's docs
98
100
99
-
A source repository keeps its pages in a docs folder and declares them in a nav sidecar. The build looks for the sidecar in three places, in this order: `docs/mkdocs.yml`, a root `mkdocs.yml`, and a root `zensical.toml`. The docs root is the sidecar's own `docs_dir`, resolved from the folder the sidecar sits in.
101
+
A source repository keeps its pages in a docs folder and declares them in a nav sidecar. The build looks for the sidecar at `docs/mkdocs.yml`, then a root `mkdocs.yml`, then a root `zensical.toml`. The docs root is the sidecar's own `docs_dir`, resolved from the folder the sidecar sits in.
100
102
101
103
Use a root `mkdocs.yml` when user-facing pages sit in a subfolder separate from a repository's internal docs. `apis` publishes `docs/guide/` this way:
102
104
@@ -119,30 +121,40 @@ nav:
119
121
Then register the repository in `sources.yaml`:
120
122
121
123
```yaml
122
-
- name: dfo-apis
123
-
repo: DevelopmentFinanceObservatory/apis
124
-
ref: dev
125
-
docs_dir: docs/guide
126
-
path: api
127
-
title: API
124
+
- name: dfo-apis
125
+
repo: DevelopmentFinanceObservatory/apis
126
+
ref: dev
127
+
docs_dir: docs/guide
128
+
path: api
129
+
title: API
128
130
```
129
131
130
-
In `sources.yaml`, `docs_dir` sets which folder the build checks out. Match it to the sidecar's `docs_dir`. Set `path` to `extra.dfo.path`. The build fails if they differ. Add a `mount` entry in `hub.yaml` that names the source row. To register a repository before publication, set `enabled: false` with a `reason` and leave it out of `hub.yaml`. A mount for a disabled source fails the build. Every registered repository must be public. The README covers `exclude`, `kind: external`, `kind: skill`, and each build failure.
132
+
In `sources.yaml`, `docs_dir` sets which folder the build checks out. Match it to the sidecar's `docs_dir`. Set `path` to `extra.dfo.path`. The build fails if they differ. Add a `mount` entry in `hub.yaml` that names the source row. To register a repository before publication, set `enabled: false` with a `reason` and leave it out of `hub.yaml`. A mount for a disabled source fails the build. Every registered repository must be public. [docs/development.md](docs/development.md) covers `exclude`, `kind: external`, `kind: skill`, and each build failure.
131
133
132
134
Before opening a pull request in the source repository, check its nav against its pages from a `docs` checkout. Then check links from the source repository's docs folder:
133
135
134
-
```
136
+
```bash
135
137
uv run python scripts/check_nav.py /path/to/source-repo
136
138
lychee --offline /path/to/source-repo/docs/guide/
137
139
```
138
140
139
141
## Checking a change here
140
142
141
-
```
143
+
```bash
142
144
uv run ruff check .
145
+
uv run ruff format --check .
146
+
uv run ty check src/dfo_docs
143
147
uv run pytest
144
148
uv run python scripts/build.py --out /tmp/dfo-docs-build
The build clones every enabled source over HTTPS without credentials.
152
+
The build clones every enabled source over HTTPS without credentials, so none of this needs ONE's cloud access. Run `uv run pre-commit install` once, and pre-commit then runs the formatters and hygiene checks on each commit.
153
+
154
+
## Pull requests
155
+
156
+
Branch from `dev` and open the pull request into `dev`. A push to `dev` rebuilds the corpus the site reads, and a pull request runs the build without publishing. A draft pull request runs no CI, so mark it ready when you want the checks. CI runs ruff, ty, the tests on Python 3.13 and 3.14, the build, and the link check. A page change needs a description in its front matter and working links. Code changes need tests and must pass these checks.
157
+
158
+
Commit messages follow Conventional Commits, such as `docs(docsync): describe the first run without state`.
159
+
160
+
Maintainer internals are in [docs/development.md](docs/development.md).
0 commit comments