aboutsummaryrefslogtreecommitdiff
path: root/share/templater/sphinx/setup
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-31 17:23:15 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-31 17:23:15 -0200
commit82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4 (patch)
tree4b81210f80e8a3e85a1d65b01beb67f92a727066 /share/templater/sphinx/setup
parent8e83eb20f8841022cf9a221f2e8447cdba1f7270 (diff)
downloadtemplater-82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4.tar.gz
templater-82e6bce4ea8fc61e99f6eb32dc12c470b93dccd4.tar.bz2
New module format
Diffstat (limited to 'share/templater/sphinx/setup')
-rwxr-xr-xshare/templater/sphinx/setup44
1 files changed, 44 insertions, 0 deletions
diff --git a/share/templater/sphinx/setup b/share/templater/sphinx/setup
new file mode 100755
index 0000000..ec70c1e
--- /dev/null
+++ b/share/templater/sphinx/setup
@@ -0,0 +1,44 @@
+#!/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 .
+
+ if [ ! -e "Makefile" ]; then
+ cp $SHARE/sphinx/files/Makefile .
+ #elif ! grep -q sphinx Makefile; then
+ # grep -v '^#' $SHARE/sphinx/files/Makefile >> Makefile
+ else
+ cp $SHARE/ikiwiki/files/Makefile Makefile.sphinx
+ fi
+
+ 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