Skip to content

Commit 01eca68

Browse files
committed
Add overview of nginx-org source ingestion
1 parent fe9674e commit 01eca68

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

documentation/nginx-org-source.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# nginx.org content
2+
3+
This document describes the process by which https://github.com/nginx/nginx.org are ingested by the `nginx/documentation` repository, and rendered as markdown.
4+
5+
## Source of truth
6+
The https://github.com/nginx/nginx.org repository remains the source of truth for a subset of content in `/content/nginx`. Primarily, this includes is the `module reference`, and the https://github.com/nginx/nginx.org/blob/main/yaml/nginx_api.yaml.
7+
8+
Any modifications to these autogenerated files will be blocked during the pull request process.
9+
If modifications are required, they will be made in the source xml in https://github.com/nginx/nginx.org repository.
10+
11+
All files that are autogenerated from this source, will have the warning:
12+
13+
```md
14+
********************************************************************************
15+
🛑 WARNING: AUTOGENERATED FILE - DO NOT EDIT 🛑 This Markdown file was
16+
automatically generated from the source XML documentation. Any manual
17+
changes made directly to this file will be overwritten. To request or
18+
suggest changes, please edit the source XML files instead.
19+
https://github.com/nginx/nginx.org/tree/main/xml/en
20+
********************************************************************************
21+
```
22+
23+
## Markdown generation flow
24+
25+
A GitHub Action running as a cron job in the `nginx/documentation` repository detects changes in the documentation within `nginx/nginx.org`, generates new markdown files when changes are found, and creates a PR with these changes.
26+
27+
Only PRs generated by this GitHub Action can be merged.
28+
29+
The markdown files are generated using a markdown-specific XSLT file, which targets only the XML sources intended for inclusion in the nginx/documentation repository.
30+
31+
```mermaid
32+
flowchart TD
33+
Start([Cron Job Triggered]) --> CheckChanges{Changes detected in 'en' docs of nginx/nginx.org?}
34+
CheckChanges -- Yes --> CloneRepo[Clone nginx/nginx.org repository]
35+
CloneRepo --> RunMake["Execute make target: 'make hugo-md'"]
36+
RunMake --> MoveFiles["Move generated markdown files to '/content/nginx' directory"]
37+
MoveFiles --> OpenPR["Create PR in nginx/documentation repository"]
38+
OpenPR --> Finish([End])
39+
40+
CheckChanges -- No --> FinishNoAction([End - No updates detected])
41+
42+
style Finish stroke:#27ae60,stroke-width:2px
43+
style OpenPR stroke:#2980b9,stroke-width:2px
44+
style CheckChanges stroke:#7f8c8d,stroke-width:2px
45+
```

0 commit comments

Comments
 (0)