fixing wiki generation
Generate and publish developer Wiki / generated-wiki (pull_request) Successful in 14s
Generate and publish developer Wiki / generated-wiki (pull_request) Successful in 14s
This commit is contained in:
@@ -12,7 +12,6 @@ from pathlib import Path
|
||||
|
||||
REPOSITORY_ROOT = Path(__file__).resolve().parents[2]
|
||||
SOURCE_ROOT = REPOSITORY_ROOT / "src"
|
||||
DEFAULT_WIKI_ROOT = REPOSITORY_ROOT / "wiki"
|
||||
MAX_IMPLEMENTATION_LINES = 900
|
||||
|
||||
CONTROL_WORDS = {
|
||||
@@ -325,18 +324,22 @@ development packages installed. It is not a host-side test substitute.
|
||||
|
||||
## Documentation workflow
|
||||
|
||||
Generate pages after changing C code or architecture:
|
||||
Check out the separate `openunifi.wiki` repository, then generate pages after
|
||||
changing C code or architecture:
|
||||
|
||||
```sh
|
||||
./scripts/docs/generate-wiki.py
|
||||
./scripts/docs/generate-wiki.py --output /path/to/openunifi.wiki
|
||||
```
|
||||
|
||||
Run the linter-style drift and structure check in CI or before committing:
|
||||
|
||||
```sh
|
||||
./scripts/docs/generate-wiki.py --check
|
||||
./scripts/docs/generate-wiki.py --check --output /path/to/openunifi.wiki
|
||||
```
|
||||
|
||||
The generator uses only the Python 3 standard library. The publisher uses POSIX
|
||||
shell utilities and Git, so neither path depends on the runner CPU architecture.
|
||||
|
||||
The checker parses C functions recursively, rebuilds internal call edges,
|
||||
validates required runtime entry points, rejects known non-English comment
|
||||
fragments, and limits each implementation unit to
|
||||
@@ -344,21 +347,20 @@ fragments, and limits each implementation unit to
|
||||
|
||||
## Publishing to the Gitea Wiki
|
||||
|
||||
Gitea stores a repository Wiki in a separate Git repository whose URL normally
|
||||
ends in `.wiki.git`. The generated `wiki/` directory is ready for that remote.
|
||||
Run `scripts/docs/publish-wiki.sh` from a trusted machine with suitable
|
||||
credentials. It derives the Wiki remote from `origin`; an explicit URL may be
|
||||
passed when needed. The publisher regenerates and checks the pages,
|
||||
updates only the generated Markdown files, commits changed pages, and pushes
|
||||
them to the Wiki repository.
|
||||
Gitea stores this documentation in the separate lowercase
|
||||
`openunifi.wiki` repository. Run `scripts/docs/publish-wiki.sh` from a trusted
|
||||
machine with suitable credentials. It derives that repository from `origin`;
|
||||
an explicit URL may be passed when needed. The publisher checks out the Wiki
|
||||
repository before generating, updates only the generated Markdown files,
|
||||
commits changed pages, and pushes them back to the Wiki repository.
|
||||
"""
|
||||
|
||||
|
||||
def home_page() -> str:
|
||||
return """# openUF Developer Wiki
|
||||
|
||||
This Wiki is generated from the current source tree and maintained in the main
|
||||
repository so architecture documentation changes can be reviewed with code.
|
||||
This Wiki is generated from the current source tree and maintained in the
|
||||
separate `openunifi.wiki` repository.
|
||||
|
||||
- [[Developer Guide|Developer-Guide]] — architecture, invariants, extension
|
||||
points, build validation, and Wiki publishing.
|
||||
@@ -367,7 +369,8 @@ repository so architecture documentation changes can be reviewed with code.
|
||||
- [[Function Call Graph|Call-Graph]] — generated internal caller/callee graph
|
||||
and searchable function table.
|
||||
|
||||
Run `./scripts/docs/generate-wiki.py --check` to verify these pages are current.
|
||||
Run `./scripts/docs/generate-wiki.py --check --output /path/to/openunifi.wiki`
|
||||
from the source checkout to verify these pages are current.
|
||||
"""
|
||||
|
||||
|
||||
@@ -543,8 +546,10 @@ def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--check", action="store_true",
|
||||
help="fail if generated pages or source checks are stale")
|
||||
parser.add_argument("--output", type=Path, default=DEFAULT_WIKI_ROOT,
|
||||
help="Wiki output directory (default: repository wiki/)")
|
||||
parser.add_argument(
|
||||
"--output", type=Path, required=True, metavar="WIKI_CHECKOUT",
|
||||
help="path to the checked-out openunifi.wiki repository",
|
||||
)
|
||||
arguments = parser.parse_args()
|
||||
|
||||
functions = discover_functions()
|
||||
@@ -568,8 +573,11 @@ def main() -> int:
|
||||
for error in errors:
|
||||
print(f"documentation error: {error}", file=sys.stderr)
|
||||
if arguments.check:
|
||||
print("run ./scripts/docs/generate-wiki.py to refresh pages",
|
||||
file=sys.stderr)
|
||||
print(
|
||||
"run ./scripts/docs/generate-wiki.py --output "
|
||||
f"{output} to refresh pages",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 1
|
||||
|
||||
action = "verified" if arguments.check else "generated"
|
||||
|
||||
Reference in New Issue
Block a user