Permalink
Browse files

Initial checkin of documentation tools for generating Ti docs with Js…

…Duck.
  • Loading branch information...
Arthur Evans
Arthur Evans committed Aug 9, 2012
1 parent 1410bcd commit 55c60507bb9f83a73251f902daeb89c5ca2ab95c
View
@@ -0,0 +1,44 @@
+DocTools
+========
+
+This repository contains build scripts, configuration files, and other miscellany related
+to building the Titanium docs for JsDuck.
+
+To build the docs, you must have a local clone of this repo, the titanium_mobile repo, and
+the Titanium-flavored JsDuck repo.
+
+## Initial Setup
+
+1. Clone all three repos, preferably into the same parent folder (for example, ~/work).
+
+2. Set the TI_ROOT environment variable to the parent directory of all three repos.
+
+ TI_ROOT=~/work
+ export TI_ROOT
+
+ If the repos are in different locations, or use non-default names, you can set
+ environment variables for each repo. See `deploy.sh`.
+
+3. Make sure you have Ruby installed, and install JsDuck's dependencies:
+
+ gem install compass
+ gem install rdiscount
+ gem install json
+
+4. Make sure you have python installed and install pyyaml and Pygments.
+
+ easy_install pyyaml
+ easy_install Pygments
+
+5. Export the wiki docs as an Eclise Help archive. Extract the archive and rename the
+ folder to ${DOCTOOLS_DIR}/htmlguides.
+
+6. If the jsduck_generator has not yet been added to Titanium mobile, obtain a copy of
+ it and place it in the `titanium_mobile/apidoc/generators` folder.
+
+7. Here goes nothing! Try building the docs:
+
+ sh deploy.sh
+
+8. If all goes well, open dist/index.html and see how it looks.
+
View
@@ -32,13 +32,12 @@ then
fi
python ${TI_DOCS}/docgen.py -f jsduck -o ./build
-python ${JSDUCK}/guides_parser.py --input "./htmlguides/toc.xml" --output "./build/guides"
+python ./guides_parser.py --input "./htmlguides/toc.xml" --output "./build/guides"
-compass compile ${JSDUCK}/jsduck/template/resources/sass
-ruby ${JSDUCK}/jsduck/bin/jsduck --config ./jsduck/jsduck.config
-cp -r "${JSDUCK}/htmlguides/images" "dist/images"
-cp -r "${JSDUCK}/htmlguides/attachments" "dist/attachments"
-cp -r "${JSDUCK}/htmlguides/css/common.css" "dist/resources/css/common.css"
-cp ${JSDUCK}/mock_video.png dist/resources/images/mock_video.png
-cp ${JSDUCK}/codestrong_logo_short.png dist/resources/images/codestrong_logo_short.png
-# cp -r "/landing" "dist/landing"
+compass compile ${JSDUCK}/template/resources/sass
+ruby ${JSDUCK}/bin/jsduck --template ${JSDUCK}/template --config ./jsduck.config
+cp -r "./htmlguides/images" "dist/images"
+cp -r "./htmlguides/attachments" "dist/attachments"
+cp -r "./htmlguides/css/common.css" "dist/resources/css/common.css"
+cp ./resources/mock_video.png dist/resources/images/mock_video.png
+cp ./resources/codestrong_logo_short.png dist/resources/images/codestrong_logo_short.png
View
@@ -51,7 +51,7 @@ def node2obj(node):
shortname = re.sub('(.*)\.html', '\\1', node.getAttribute('href'))
dirname = shortname
- dir = os.path.join(dest, 'tutorials', dirname)
+ dir = os.path.join(dest, 'guides', dirname)
try:
os.makedirs(dir)
except:
@@ -95,8 +95,8 @@ def node2obj(node):
# Rewrite any absolute links to http://docs.appcelerator.com
# Only way we can insert a link to the videos in the wiki is to use a full URL
- elif href.startswith('http://docs.appcelerator.com/titanium/latest/#!/video'):
- tag['href'] = href.replace('http://docs.appcelerator.com/titanium/latest/', '')
+ elif re.search('http://docs.appcelerator.com/titanium/.*#!.*', href):
+ tag['href'] = re.sub('http://docs.appcelerator.com/titanium/.*#!', '#!', href)
# In general, any link back to the wiki is a bad link.
# There are a very few exceptions, such as the community wiki.
View
@@ -1,12 +1,11 @@
{
"--title": "Appcelerator Titanium Mobile",
- "--external": "void",
- "--output": "./../dist",
+ "--external": "void,Callback",
+ "--output": "./dist",
"--meta-tags": "meta",
- "--template": "./jsduck/template",
"--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'>",
- "--guides": "./../tmp/guides/guides.json",
+ "--guides": "./build/guides/guides.json",
"--videos": "./videos.json",
- "--": ["./../tmp/titanium.js"]
+ "--": ["./build/titanium.js"]
}
View
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 55c6050

Please sign in to comment.