Skip to content

Commit

Permalink
Merge branch 'main' of github.com:/hannorein/rebound
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Feb 2, 2025
2 parents 1344b3d + aa36ae7 commit 5bec0eb
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Not all combinations make physically sense, and not all combinations are support
We describe the different modules and their configuration in this section.

Also make sure to some of the other concepts documented in this section.
They will help you understand the [units](units.md) used in REBOUND, how REBOUND handles [orbital elements](orbitalelements.md), how to save and load simulations to [Simulationarchive](simulationarchive.md) files, how to use [chaos indicators](chaosindicators.md), how to use the [browser based 3D visualization](visualization.md), and several other topics.
They will help you understand the [units](units.md) used in REBOUND, how REBOUND handles [orbital elements](orbitalelements.md), how to save and load simulations to [Simulationarchive](simulationarchive.md) files, how to use [chaos indicators](chaos.md), how to use the [browser based 3D visualization](visualization.md), and several other topics.


!!! Info
Expand Down
64 changes: 64 additions & 0 deletions docs/make_docs.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash
if [ -f documentation_lock.txt ]; then
echo "Documentation update already in progress. Exiting."
exit
fi
touch documentation_lock.txt

git pull

repository_head=` git rev-parse HEAD`
documentation_head=$(<documentation_head.txt)

echo "Repository head: $repository_head"
echo "Documentation head: $documentation_head"


if [[ "$repository_head" == "$documentation_head" ]]; then
echo "Documentation is up-to-date."
rm documentation_lock.txt
exit
fi

echo "Updating documentation."

## UPDATE START

mkdocs build
../emsdk/emsdk activate latest
source ../emsdk/emsdk_env.sh

OPTIMI="${1:-3}"

echo "Compiling C examples with emscripten."
echo ""
mkdir -p site/emscripten_c_examples/

for dir in examples/*/
do
echo "Working on $dir ..."
mpi_enabled=$(cat $dir/Makefile | grep -c "export MPI=1")
openmp_enabled=$(cat $dir/Makefile | grep -c "export OPENMP=1")
server_used=$(cat $dir/problem.c | grep -c "reb_simulation_start_server")
if [ $mpi_enabled -eq 0 ] && [ $openmp_enabled -eq 0 ]; then
mkdir -p site/emscripten_c_$dir/
echo "Compiling... "
if [ $server_used -eq 0 ]; then
emcc -O$OPTIMI -Isrc/ src/*.c $dir/problem.c -DSERVERHIDEWARNING -sSTACK_SIZE=655360 -s -sASYNCIFY -sALLOW_MEMORY_GROWTH -sEXPORTED_RUNTIME_METHODS="callMain" --shell-file web_client/shell_rebound_console.html -o site/emscripten_c_$dir/index.html || exit 1
else
emcc -O$OPTIMI -Isrc/ src/*.c $dir/problem.c -DSERVERHIDEWARNING -DOPENGL=1 -sSTACK_SIZE=655360 -s USE_GLFW=3 -s FULL_ES3=1 -sASYNCIFY -sALLOW_MEMORY_GROWTH -sEXPORTED_RUNTIME_METHODS="callMain" --shell-file web_client/shell_rebound_webgl.html -o site/emscripten_c_$dir/index.html || exit 1
fi
echo "Output written to site/emscripten_c_$dir/index.html"
else
echo "Skipping."
fi
echo ""

done

## UPDATE DONE
echo "Documentaiton updated. Releasing lock."
echo "$repository_head" > documentation_head.txt
rm documentation_lock.txt

exit
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mkdocs-material
mkdocs-jupyter
mkdocs-jupyter==0.24.7
#git+git://github.com/hannorein/mkdocs-jupyter
mkdocs-simple-hooks
mkdocs-video
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ nav:
- c_examples/closeencounter.md
- c_examples/closeencounter_record.md
- c_examples/closeencounter_hybrid.md
- c_examples/apophis_flyby.md
- ipython_examples/HybridIntegrationsWithMercurius.ipynb
- ipython_examples/HybridIntegrationsWithTRACE.ipynb
- ipython_examples/CloseEncounters.ipynb
- c_examples/mergers.md
- ipython_examples/User_Defined_Collision_Resolve.ipynb
Expand Down Expand Up @@ -192,6 +191,8 @@ plugins:
hooks:
on_pre_build: "docs.c_examples.generate_c_examples:run"
- mkdocs-jupyter
# Note: Newer version doesn't render math due to a bug. Using mkdocs-jupyter==0.24.7 to fix this for now.
# See https://github.com/danielfrg/mkdocs-jupyter/issues/212
- mkdocs-video:
css_style:
width: "48vw"
Expand Down

0 comments on commit 5bec0eb

Please sign in to comment.