aboutsummaryrefslogtreecommitdiff
path: root/share/templater/sphinx/setup
blob: b378ac3fcad22690e7bc16668483b7c7f44bc83d (plain)
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
#!/bin/bash
#
# Sphinx templater module.
#

# Parameters
SHARE="$1"

# Include basic functions
source $SHARE/templater/functions || exit 1

# Sphinx implementation
function templater_sphinx {
  if [ ! -e "conf.py" ]; then
    __templater_echo "Setting up sphinx..."

    #__templater_checkout_develop
    __templater_copy_or_append sphinx .gitignore

    cp $SHARE/sphinx/files/conf.py .

    __templater_install_makefile $SHARE/sphinx/files/Makefile.sphinx

    if [ ! -d "_static" ]; then
      cp -r $SHARE/sphinx/files/_static .
    fi

    if [ ! -d "_themes" ]; then
      mkdir _themes
      git submodule add https://github.com/snide/sphinx_rtd_theme _themes/sphinx_rtd_theme
    fi
  else
    __templater_echo "Sphinx already set"
  fi
}

# Dispatch
templater_sphinx