Permalink
Browse files

Merge pull request #12 from arthurevans/tidoc-960

TIDOC-1066 / TIDOC-960 New build script & config for Cloud docs.
  • Loading branch information...
2 parents 7f69410 + 1ce7f41 commit 673ce457d1b5ca9db67746e66090500fc07bd828 bhatfield committed Mar 19, 2013
Showing with 136 additions and 0 deletions.
  1. +89 −0 clouddeploy.sh
  2. +23 −0 jsduck_cloud.config
  3. +12 −0 meta/LoginRequiredTag.rb
  4. +12 −0 meta/UrlTag.rb
View
@@ -0,0 +1,89 @@
+DEBUG_TEMPLATE=template
+PROD_TEMPLATE=template-min
+VIDEO_LIST="videos.json"
+PROCESSED_VIDEO_LIST="build/videos.json"
+config="./jsduck.config"
+
+progname=$0
+
+usage() {
+ echo "Usage: $progname [options] [debug|prod]"
+ echo ""
+ echo " Options:"
+ echo " -c <config_file> (i.e., jsduck_21.config for 2.1 docs build)."
+ echo " -s Enable --seo flag to jsduck."
+ echo ""
+}
+
+while getopts ":tso:c:g:" opt; do
+ case $opt in
+ c)
+ if [ "$OPTARG" ]; then
+ config=$OPTARG
+ fi
+ ;;
+ s)
+ seo="--seo"
+ ;;
+ \?)
+ echo "Invalid option: -$OPTARG">&2
+ usage
+ exit 1
+ ;;
+ :)
+ echo "Option -$OPTARG requires an argument." >&2
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# Skip the options and move on to the positional parameters
+shift $((OPTIND-1))
+
+
+while [ $1 ]; do
+ if [ $1 == "prod" ]; then
+ production_build="production"
+ seo="--seo"
+ no_thumbnails=""
+ elif [ $1 == "debug" ]; then
+ debug_build="debug"
+ fi
+ shift
+done
+#
+if [ ! "$CLOUD_DOCS" ]; then
+ if [ "$TI_ROOT" ]; then
+ CLOUD_DOCS=${TI_ROOT}/cloud_docs
+ else
+ echo "No doc root \$CLOUD_DOCS and \$TI_ROOT not defined. Exiting."
+ exit
+ fi
+fi
+if [ ! "$JSDUCK" ]; then
+ if [ "$TI_ROOT" ]; then
+ JSDUCK=${TI_ROOT}/jsduck
+ else
+ echo "No JSDuck dir \$JSDUCK and \$TI_ROOT not defined. Exiting."
+ exit
+ fi
+fi
+
+if [ ! "$DOCTOOLS" ]; then
+ if [ "$TI_ROOT" ]; then
+ DOCTOOLS=${TI_ROOT}/doctools
+ else
+ echo "No doctools dir \$DOCTOOLS and \$TI_ROOT not defined. Exiting."
+ exit
+ fi
+fi
+
+if [ $production_build ] ; then
+ (cd ${JSDUCK}; rake compress)
+ TEMPLATE=${JSDUCK}/${PROD_TEMPLATE}
+else
+ compass compile ${JSDUCK}/template/resources/sass
+ TEMPLATE=${JSDUCK}/${DEBUG_TEMPLATE}
+fi
+ruby ${JSDUCK}/bin/jsduck --template ${TEMPLATE} $seo --config jsduck_cloud.config
View
@@ -0,0 +1,23 @@
+{
+ "--title": "Cloud Docs - Appcelerator Docs",
+ "--output": "./dist-cloud",
+ "--external": "Hash,FileUpload",
+ "--rest": true,
+ "--meta-tags": "meta",
+ "--welcome": "welcome.html",
+ "--head-html": "<link rel='stylesheet' href='resources/css/my.css' type='text/css'><link rel='stylesheet' href='resources/css/common.css' type='text/css'>",
+ "--body-html": [ "<script type=\"text/javascript\">",
+ "Docs.otherProducts = [ {",
+ "text: 'Cloud Docs',",
+ "href: 'http://docs.appcelerator.com/cloud/latest'",
+ "}, {",
+ "text: 'Titanium 3.0',",
+ "href: 'http://docs.appcelerator.com/titanium/3.0'",
+ "}, {",
+ "text: 'Titanium 2.X',",
+ "href: 'http://docs.appcelerator.com/titanium/2.1'",
+ "} ];",
+ "Docs.isRESTDoc = true; </script>" ],
+ "--guides": "../cloud_docs/guides.json",
+ "--": ["../cloud_docs/apidoc"]
+}
View
@@ -0,0 +1,12 @@
+require "jsduck/meta_tag"
+
+class LoginRequiredTag < JsDuck::MetaTag
+ def initialize
+ @name = "loginRequired"
+ end
+ # One can make use of the #format method to easily support
+ # Markdown and {@link} tags inside the contents of the tag.
+ def to_html(loginRequired)
+ "<strong>User Login Required: " + ((loginRequired && "Yes") || "No") + "</strong>"
+ end
+end
View
@@ -0,0 +1,12 @@
+require "jsduck/meta_tag"
+
+class UrlTag < JsDuck::MetaTag
+ def initialize
+ @name = "url"
+ end
+ # One can make use of the #format method to easily support
+ # Markdown and {@link} tags inside the contents of the tag.
+ def to_html(url)
+ "<h3>Since " + url + "</h3>"
+ end
+end

0 comments on commit 673ce45

Please sign in to comment.