Skip to content

Commit 554cf6c

Browse files
committed
Initial commit to get working read the docs deployment preview
1 parent 7a3a24b commit 554cf6c

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

docs/source/conf.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,39 @@
77
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
88

99
if on_rtd:
10+
XEUS_CPP_ROOT = os.path.abspath('../..')
11+
command_emscripten = 'cd ..;\
12+
mamba init;\
13+
mamba create -f environment-wasm-build.yml -y;\
14+
mamba activate xeus-cpp-wasm-build;\
15+
mamba create -f environment-wasm-host.yml --platform=emscripten-wasm32;\
16+
mkdir build;\
17+
cd build;\
18+
export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build;\
19+
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host;\
20+
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot;\
21+
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
22+
-DCMAKE_PREFIX_PATH=$PREFIX \
23+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
24+
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
25+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
26+
-DXEUS_CPP_RESOURCE_DIR=$LLVM_BUILD_DIR/lib/clang/$LLVM_VERSION \
27+
-DSYSROOT_PATH=$SYSROOT_PATH \
28+
{0}/xeus-cpp/;\
29+
emmake make -j $(nproc --all) install;\
30+
cd {0};\
31+
mamba create -n xeus-lite-host jupyterlite-core -c conda-forge;\
32+
mamba activate xeus-lite-host;\
33+
python -m pip install jupyterlite-xeus jupyter_server;\
34+
jupyter lite build --XeusAddon.prefix=$PREFIX \
35+
--contents notebooks/xeus-cpp-lite-demo.ipynb \
36+
--contents notebooks/smallpt.ipynb \
37+
--contents notebooks/images/marie.png \
38+
--contents notebooks/audio/audio.wav \
39+
--output-dir $READTHEDOCS_OUTPUT/html/xeus-cpp;'.format(XEUS_CPP_ROOT)
1040
subprocess.call('cd ..; doxygen', shell=True)
41+
subprocess.call(command_emscripten.format(XEUS_CPP_ROOT), shell=True)
42+
1143

1244
import sphinx_rtd_theme
1345

@@ -32,4 +64,4 @@ def setup(app):
3264
highlight_language = 'c++'
3365
pygments_style = 'sphinx'
3466
todo_include_todos = False
35-
htmlhelp_basename = 'xeus-cppdoc'
67+
htmlhelp_basename = 'xeus-cppdoc'

0 commit comments

Comments
 (0)