-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathconf.py
More file actions
79 lines (69 loc) · 2.94 KB
/
conf.py
File metadata and controls
79 lines (69 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
XEUS_CPP_ROOT = os.path.abspath('../..')
command_emscripten = f'''
cd ../../;
curl -L https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba;
export PATH="$PWD/bin:$PATH";
export MAMBA_EXE="$PWD/bin/micromamba";
export MAMBA_ROOT_PREFIX="/home/docs/checkouts/readthedocs.org/user_builds/xeus-cpp/conda/";
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)";
eval "$__mamba_setup";
alias micromamba="$MAMBA_EXE";
micromamba create -f environment-wasm-build.yml -y;
micromamba activate xeus-cpp-wasm-build;
micromamba create -f environment-wasm-host.yml \
--platform=emscripten-wasm32 \
-c https://prefix.dev/emscripten-forge-4x \
-c https://prefix.dev/conda-forge
mkdir -p build;
cd build;
export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/xeus-cpp-wasm-build;
export PREFIX=$MAMBA_ROOT_PREFIX/xeus-cpp-wasm-host;
export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot;
emcmake cmake -DCMAKE_BUILD_TYPE=Release \\
-DCMAKE_PREFIX_PATH=$PREFIX \\
-DCMAKE_INSTALL_PREFIX=$PREFIX \\
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \\
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \\
-DSYSROOT_PATH=$SYSROOT_PATH \\
{XEUS_CPP_ROOT};
emmake make -j $(nproc --all) install;
cd {XEUS_CPP_ROOT};
micromamba create -n xeus-lite-host jupyter_server jupyterlite-xeus -c conda-forge -y;
micromamba activate xeus-lite-host;
jupyter lite build --settings-overrides=overrides.json \\
--XeusAddon.prefix=$PREFIX \\
--XeusAddon.mounts="$PREFIX/share/xeus-cpp/tagfiles:/share/xeus-cpp/tagfiles" \
--XeusAddon.mounts="$PREFIX/etc/xeus-cpp/tags.d:/etc/xeus-cpp/tags.d" \
--contents notebooks/xeus-cpp-lite-demo.ipynb \\
--contents notebooks/tinyraytracer.ipynb \\
--contents notebooks/images/marie.png \\
--contents notebooks/audio/audio.wav \\
--output-dir $READTHEDOCS_OUTPUT/html/xeus-cpp;
'''
subprocess.call('cd ..; doxygen', shell=True)
subprocess.run(['bash', '-c', command_emscripten], check=True)
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
def setup(app):
app.add_css_file("main_stylesheet.css")
extensions = ['breathe', 'sphinx_rtd_theme']
breathe_projects = { 'xeus-cpp': '../xml' }
templates_path = ['_templates']
html_static_path = ['_static']
source_suffix = '.rst'
master_doc = 'index'
project = 'xeus-cpp'
copyright = '2017, Johan Mabille, Loic Gouarin and Sylvain Corlay'
author = 'Johan Mabille, Loic Gouarin and Sylvain Corlay'
exclude_patterns = []
highlight_language = 'c++'
pygments_style = 'sphinx'
todo_include_todos = False
htmlhelp_basename = 'xeus-cppdoc'