Skip to content

Commit 0777aab

Browse files
authored
ci/rtfd: building both fast docs on PR (#18738)
1 parent 87dff99 commit 0777aab

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

.readthedocs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ build:
3939
commands:
4040
- printenv
4141
- pwd ; ls -lh
42-
- pip install -U pip awscli --user
42+
- pip install -U pip awscli py-tree --user
4343
- python -m awscli s3 sync --no-sign-request s3://sphinx-packages/ dist/ ; ls -lh dist/
4444
- >
45-
pip install -e . -q -r requirements/pytorch/docs.txt -r _notebooks/.actions/requires.txt \
45+
pip install -e . -q -r _notebooks/.actions/requires.txt \
46+
-r requirements/fabric/docs.txt \
47+
-r requirements/pytorch/docs.txt \
4648
-f 'https://download.pytorch.org/whl/cpu/torch_stable.html' -f dist/ ;
4749
pip list
4850
# this need to be split so `sphinx-build` is picked from previous installation
4951
- bash docs/rtfd-build.sh
50-
- mkdir -p _readthedocs ; mv docs/build/html _readthedocs/html
52+
- cd docs/build ; python -m py_tree --depth_limit=1
53+
- mkdir -p _readthedocs ; mv docs/build _readthedocs/html

docs/crossroad.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>RTFD cross-road</title>
5+
<style>
6+
body {
7+
text-align: center;
8+
}
9+
</style>
10+
</head>
11+
<body>
12+
<a href="fabric/"><button>Fabric</button></a>
13+
<a href="pytorch/"><button>PyTorch</button></a>
14+
</body>
15+
</html>

docs/rtfd-build.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@
22

33
if ! [ $READTHEDOCS_VERSION == "latest" -o $READTHEDOCS_VERSION == "stable" ];
44
then
5-
cd ./docs/source-pytorch ;
65
export FAST_DOCS_DEV=1 ;
7-
make html --jobs $(nproc) ;
8-
ls -lh ../build
6+
root=$(pwd) ;
7+
# build Fabric
8+
cd $root/docs/source-fabric ;
9+
make html --jobs $(nproc) ;
10+
cd $root/docs ;
11+
mv build/html build/fabric ;
12+
# build PyTorch
13+
cd $root/docs/source-pytorch ;
14+
make html --jobs $(nproc) ;
15+
cd $root/docs ;
16+
mv build/html build/pytorch ;
17+
# cross-road
18+
rm -rf build/doctrees ;
19+
cp crossroad.html build/index.html
920
else
1021
echo "Void build... :-]" ;
11-
mkdir -p ./docs/build/html
12-
cp ./docs/redirect.html ./docs/build/html/index.html
22+
mkdir -p ./docs/build
23+
cp ./docs/redirect.html ./docs/build/index.html
1324
fi

0 commit comments

Comments
 (0)