Permalink
Browse files

now builds to a docs/build, unless the --gh-pages flag is present.

  • Loading branch information...
bobspace committed Feb 22, 2014
1 parent 5118e5d commit 1bfa4d376a85c7b7c6f2f02c49548b67d8b824bf
Showing with 20 additions and 7 deletions.
  1. +3 −0 .gitignore
  2. +2 −2 docs/src/Gruntfile.js
  3. +15 −5 scripts/build_documentation
@@ -27,3 +27,6 @@ node_modules
#Misc
.sass-cache
#docs local build path
docs/build
@@ -7,7 +7,7 @@ module.exports = function(grunt) {
var buildPath = grunt.option('build-path') || '../../docs' ;
var rootURL = grunt.option('root-url') || '' ;
var rootURL = grunt.option('root-url') || 'relative' ;
// Used by jade and validate-and-build-controls
var controlsNavItems = [];
@@ -63,7 +63,7 @@ module.exports = function(grunt) {
}
//translate for relativeURLs
if (rootURL === '') {
if (rootURL === 'relative') {
locals.rootURL = getRelativeRoot(filePath);
}
@@ -17,10 +17,7 @@
. ${PX_FREESTYLE_SCRIPT:-$(dirname $0)}/common.sh
# stop if we encounter an error
#set -e
# set variables
DOCS_ROOT="${PX_FREESTYLE_ROOT}/docs"
DOCS_WORKSPACE="${DOCS_ROOT}/src/specs"
@@ -29,6 +26,19 @@ CONTROLS_METADATA="${DOCS_WORKSPACE}/controls.json"
DOCS_TOOLS="${PX_FREESTYLE_SCRIPT}/build_documentation_tools"
# Determine build path and roots.
if [[ $1 == "--gh-pages" ]]; then
echo buliding docs to github pages repo
BUILD_PATH="${PX_FREESTYLE_ROOT}/../pixate-freestyle-ios-gh-pages"
GRUNT_ROOT_URL="/pixate-freestyle-ios"
else
echo building docs to docs/build
BUILD_PATH="${DOCS_ROOT}/build"
GRUNT_ROOT_URL="relative"
fi
# generate Styling Reference metadata
mkdir -p "${DOCS_WORKSPACE}"
@@ -46,12 +56,12 @@ echo Building controls.json.
# build the main documentation set
echo Building core documentation.
cd "${DOCS_ROOT}/src/"
grunt --root-url "/pixate-freestyle-ios" --build-path "../../../pixate-freestyle-ios-gh-pages"
grunt --root-url $GRUNT_ROOT_URL --build-path $BUILD_PATH
# move back to the starting directory
cd "${PX_FREESTYLE_SCRIPT}"
# generate the appledocs
echo Building appledocs.
./build_appledocs "${PX_FREESTYLE_ROOT}" "${PX_FREESTYLE_ROOT}/../pixate-freestyle-ios-gh-pages"
./build_appledocs "${PX_FREESTYLE_ROOT}" $BUILD_PATH

0 comments on commit 1bfa4d3

Please sign in to comment.