Skip to content

Commit 265f303

Browse files
committed
DOC: move documentation into github pages
1 parent 92aa66c commit 265f303

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HTML_DIR=build/html
33
LATEX_DIR=build/latex
44
WWW_DIR=build/website
55
DOCSRC_DIR=doc
6-
SF_USER ?= matthewbrett
6+
GITHUB_REPO=https://github.com/nipy/nibabel
77
#
88
# The Python executable to be used
99
#
@@ -121,23 +121,23 @@ gitwash-update: build
121121
# Website
122122
#
123123

124-
website: website-stamp
125-
website-stamp: $(WWW_DIR) htmldoc pdfdoc
124+
html: html-stamp
125+
html-stamp: $(WWW_DIR) htmldoc
126126
cp -r $(HTML_DIR)/* $(WWW_DIR)
127-
cp $(LATEX_DIR)/*.pdf $(WWW_DIR)
128127
touch $@
129128

129+
pdf: pdf-stamp
130+
pdf-stamp: $(WWW_DIR) pdfdoc
131+
cp $(LATEX_DIR)/*.pdf $(WWW_DIR)
132+
touch $@
130133

131-
upload-website: website
132-
rsync -rzhvp --delete --chmod=Dg+s,g+rw $(WWW_DIR)/* \
133-
web.sourceforge.net:/home/groups/n/ni/niftilib/htdocs/nibabel/
134-
135-
# This one udates for the specific user named at the top of the makefile
136-
upload-htmldoc: htmldoc upload-htmldoc-$(SF_USER)
134+
website: website-stamp
135+
website-stamp: $(WWW_DIR) html-stamp pdf-stamp
136+
cp -r $(HTML_DIR)/* $(WWW_DIR)
137+
touch $@
137138

138-
upload-htmldoc-%: htmldoc
139-
rsync -rzhvp --delete --chmod=Dg+s,g+rw $(HTML_DIR)/* \
140-
$*,[email protected]:/home/groups/n/ni/nipy/htdocs/nibabel/
139+
upload-html: html-stamp
140+
./doc/tools/upload-gh-pages.sh $(WWW_DIR) $(GITHUB_REPO)
141141

142142
#
143143
# Sources

doc/tools/upload-gh-pages.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Upload website to gh-pages
3+
HTML_DIR=$1
4+
if [ -z "$HTML_DIR" ]; then
5+
echo "Need to specify build directory"
6+
exit 1
7+
fi
8+
UPSTREAM_REPO=$2
9+
if [ -z "$UPSTREAM_REPO" ]; then
10+
echo "Need to specify upstream repo"
11+
exit 1
12+
fi
13+
cd $HTML_DIR
14+
git init
15+
git checkout -b gh-pages
16+
git add *
17+
# A nojekyll file is needed to tell github that this is *not* a jekyll site:
18+
touch .nojekyll
19+
git add .nojekyll
20+
git commit -a -m "Documentation build - no history"
21+
git remote add origin $UPSTREAM_REPO
22+
git push origin gh-pages --force
23+
rm -rf .git # Yes

0 commit comments

Comments
 (0)