Skip to content

Commit 09591ba

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
add cpp api reference (#618)
Summary: Adding cpp docs and updating the build system for the docs to support doxygen and breath (connects sphinx and doxygen). Reviewed By: svekars, cccclai Differential Revision: D49924199
1 parent d935d9a commit 09591ba

File tree

13 files changed

+803
-466
lines changed

13 files changed

+803
-466
lines changed

.ci/docker/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ TORCH_VERSION=$(cat ci_commit_pins/pytorch.txt)
3636
TORCHAUDIO_VERSION=$(cat ci_commit_pins/audio.txt)
3737
TORCHVISION_VERSION=$(cat ci_commit_pins/vision.txt)
3838

39+
BUILD_DOCS=1
40+
3941
# Copy requirements-lintrunner.txt from root to here
4042
cp ../../requirements-lintrunner.txt ./
4143

@@ -51,6 +53,7 @@ docker build \
5153
--build-arg "TORCHVISION_VERSION=${TORCHVISION_VERSION}.${NIGHTLY}" \
5254
--build-arg "BUCK2_VERSION=${BUCK2_VERSION}" \
5355
--build-arg "LINTRUNNER=${LINTRUNNER}" \
56+
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
5457
-f "${OS}"/Dockerfile \
5558
"$@" \
5659
.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [ -n "$BUILD_DOCS" ]; then
6+
apt-get update
7+
# Ignore error if gpg-agent doesn't exist (for Ubuntu 16.04)
8+
apt-get install -y gpg-agent || :
9+
10+
curl --retry 3 -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
11+
sudo apt-get install -y nodejs
12+
13+
curl --retry 3 -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
14+
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
15+
16+
apt-get update
17+
apt-get install -y --no-install-recommends yarn
18+
yarn global add katex --prefix /usr/local
19+
20+
sudo apt-get -y install doxygen
21+
22+
apt-get autoclean && apt-get clean
23+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
24+
25+
fi

.ci/docker/requirements-ci.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ hypothesis==6.84.2
1515
parameterized==0.9.0
1616

1717
# Doc build requirements
18-
sphinx==5.0.0
18+
sphinx==4.5.0
1919
sphinx-gallery
20+
breathe==4.35.0
21+
exhale==0.3.6
22+
docutils==0.16
2023
matplotlib
2124
# PyTorch Theme
2225
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme

.ci/docker/ubuntu/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ RUN bash ./install_buck.sh && rm install_buck.sh
2424
COPY ./common/install_user.sh install_user.sh
2525
RUN bash ./install_user.sh && rm install_user.sh
2626

27+
# Install docs
28+
ARG BUILD_DOCS
29+
COPY ./common/install_docs_reqs.sh install_docs_reqs.sh
30+
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh
31+
2732
# Install conda and other dependencies
2833
ARG MINICONDA_VERSION
2934
ARG PYTHON_VERSION

.github/workflows/doc-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
4747
# Build docset:
4848
cd docs
49+
doxygen source/Doxyfile
4950
make html
5051
cd ..
5152

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS = -WT --keep-going
5+
# SPHINXOPTS = -WT --keep-going TODO(T165752164) fix sphinx warnings around preprocess macros in cpp like __ET_DEPRECATED
66
SPHINXBUILD = sphinx-build
77
SPHINXPROJ = ExecuTorch
88
SOURCEDIR = source

0 commit comments

Comments
 (0)