Skip to content

Commit 7586fcf

Browse files
committed
switch to py to fix windows build
1 parent a0f3082 commit 7586fcf

3 files changed

Lines changed: 28 additions & 13 deletions

File tree

docs/dev/documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The Python documentation tools are managed with [poetry]. Building every documen
2020
git clone https://github.com/Vector35/binaryninja-api/
2121
cd binaryninja-api
2222
poetry install
23-
poetry run bash scripts/zensical_build.sh
23+
poetry run python scripts/zensical_build.py
2424
echo User documentation available in site/
2525
cd api-docs
2626
poetry run make html
@@ -30,7 +30,7 @@ poetry run make html
3030
echo C++ API documentation available in html/
3131
```
3232

33-
`scripts/zensical_build.sh` runs `zensical build` and then writes the redirect stubs described by `[project.plugins.redirects.redirect_maps]` in `zensical.toml`.
33+
`scripts/zensical_build.py` runs `zensical build` and then writes the redirect stubs described by `[project.plugins.redirects.redirect_maps]` in `zensical.toml`.
3434

3535
## Changing
3636
Changing documentation for the API itself is fairly straightforward. Use [doxygen style comment blocks](https://www.doxygen.nl/manual/docblocks.html) in C++ and C, and [restructured text blocks](https://sphinx-tutorial.readthedocs.io/step-1/) for python for the source. The user documentation is located in the `docs/` folder and the API documentation is generated from the config in the `api-docs` folder.

scripts/zensical_build.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
"""Build the docs, then emit redirect stubs from zensical.toml.
3+
4+
Extra arguments are forwarded to `zensical build`.
5+
"""
6+
import subprocess
7+
import sys
8+
from pathlib import Path
9+
10+
DIR = Path(__file__).resolve().parent.parent
11+
CONFIG = DIR / "zensical.toml"
12+
SITE_DIR = DIR / "site"
13+
14+
15+
def main() -> int:
16+
result = subprocess.run([sys.executable, "-m", "zensical", "build", "--strict",
17+
"-f", str(CONFIG)] + sys.argv[1:])
18+
if result.returncode != 0:
19+
return result.returncode
20+
21+
return subprocess.run([sys.executable, str(DIR / "scripts" / "zensical_redirects.py"),
22+
"--config", str(CONFIG), "--site-dir", str(SITE_DIR)]).returncode
23+
24+
25+
if __name__ == "__main__":
26+
sys.exit(main())

scripts/zensical_build.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)