Permalink
Browse files

Added Appcelerator Titanium and jQuery docsets

  • Loading branch information...
1 parent 525847e commit 05eb1ebb30a3931f033c8f0a192ebbe66ab19b02 @jkozera committed Mar 27, 2013
Showing with 42 additions and 12 deletions.
  1. +2 −2 README.md
  2. +4 −2 docsets.txt
  3. BIN gendocsets/extjs/appcelerator.png
  4. +36 −8 gendocsets/extjs/parse.py
View
@@ -20,7 +20,7 @@ Zeal is a simple documentation browser inspired by [Dash](http://kapeli.com/dash
After installing/compiling it you need to download docsets. It can be done automatically by clicking 'Edit', 'Options', 'Docsets', 'Download...'.
-Currently there are docsets available from Django, Ruby 1 and 2 [1], ExtJS 4.1, Python 2.7.3, Sencha Touch 2.1, Qt 5 [2].
+Currently there are docsets available from Django, jQuery, Ruby 1 and 2 [1], Appcelerator Titanium, ExtJS 4.1, Python 2.7.3, Sencha Touch 2.1, Qt 5 [2].
[1] thanks to Dash's [docset exchange programme](https://github.com/jkozera/zeal/issues/1#issuecomment-13357189)
[2] generated using scripts from `gendoctests` directory
@@ -53,7 +53,7 @@ Currently Zeal requires Qt 5.0. To compile it, run `qmake` and `make` in the `ze
For creating new docsets, you have three choices of index format supported by Zeal.
- 1. `ZEAL` format, as generated by scripts in `gendocsets` directory. It's essentially a single sqlite table with `type`, `name`, `path` and `parent` columns.
+ 1. `ZEAL` format, as generated by scripts in `gendocsets/{python273,qt5}` directories. It's essentially a single sqlite table with `type`, `name`, `path` and `parent` columns.
2. `DASH` format, which is also similar single table, without the `parent` column.
3. So-called `ZDASH`, which is a more complex Xcode docset format, implemented in Zeal to allow reusing Dash's docsets.
View
@@ -1,7 +1,9 @@
+AppceleratorTitanium https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPNzVGTElmcVZ0Vmc 201303272010
Django https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPMGJxRE44VndpaHM 201303171634
-ExtJS-4.1 https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPZHRBcXZXd3RaU2s 201303170007
+ExtJS-4.1 https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPTVRYeHdNU1h5Y3M 201303272010
+jQuery https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPYU4tSHNPUVN1VzA 201303272010
python-2.7.3-docs-html https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPVkVtM0lrNVdCNXM 201303062116
Qt5 https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPMjlHa1k5WTVldDg 201303062116
Ruby https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPS3JZc2dZdUVTYms 201303170016
Ruby2 https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPM1A5WkJKYkd2SEU 201303170016
-SenchaTouch-2.1 https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPVGkyLVVBSEw5dXM 201303170045
+SenchaTouch-2.1 https://drive.google.com/uc?export=download&confirm=no_antivirus&id=0B8S9pdOpH0GPWjVUejY4ZzZtWFk 201303272010
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -15,17 +15,28 @@
INPUT_DIR = '.'
OUTPUT_DIR = os.path.join(INPUT_DIR, 'output')
+icon = 'icon.png'
+indexpath = 'html/Ext.html'
if os.path.exists(os.path.join(INPUT_DIR, 'extjs-build')):
builddir = 'extjs-build'
OUT_DIR = 'ExtJS-4.1.docset'
docsetname = 'ExtJS'
docsetshortname = 'extjs'
-else:
+elif os.path.exists(os.path.join(INPUT_DIR, 'touch-build')):
builddir = 'touch-build'
- assert os.path.exists(os.path.join(INPUT_DIR, builddir))
OUT_DIR = 'SenchaTouch-2.1.docset'
docsetname = 'Sencha Touch'
docsetshortname = 'sencha'
+else:
+ # assuming Appcelerator Titanium
+ builddir = None
+ OUT_DIR = 'AppceleratorTitanium.docset'
+ docsetname = 'Appcelerator Titanium'
+ docsetshortname = 'titanium'
+ icon = 'appcelerator.png'
+ indexpath = 'html/Titanium.html'
+
+
DOCUMENTS_DIR = os.path.join(OUT_DIR, 'Contents', 'Resources', 'Documents')
HTML_DIR = os.path.join(DOCUMENTS_DIR, 'html')
@@ -34,11 +45,23 @@
# index.html doesn't work with Dash
rmtree(os.path.join(DOCUMENTS_DIR, 'output'))
-rmtree(os.path.join(DOCUMENTS_DIR, builddir))
-rmtree(os.path.join(DOCUMENTS_DIR, 'guides'))
+if builddir:
+ rmtree(os.path.join(DOCUMENTS_DIR, builddir))
+ rmtree(os.path.join(DOCUMENTS_DIR, 'guides'))
+if docsetname == 'Appcelerator Titanium':
+ # CSS fix for fluid width
+ for dirpath, dirnames, filenames in os.walk(DOCUMENTS_DIR):
+ for fname in filenames:
+ if not fname.endswith('.css'): continue
+ with open(os.path.join(dirpath, fname), 'a') as f:
+ f.write("""
+body {min-width:0px !important}
+.class-overview p.private {border:0px; background-color:inherit; padding:0px; text-align:left;}""")
+ print os.path.join(dirpath, fname), 'CSS fixed'
+
os.unlink(os.path.join(DOCUMENTS_DIR, 'index.html'))
-copy(os.path.join(os.path.dirname(__file__), 'icon.png'), OUT_DIR)
+copy(os.path.join(os.path.dirname(__file__), icon), os.path.join(OUT_DIR, 'icon.png'))
os.mkdir(HTML_DIR)
with open(os.path.join(OUT_DIR, 'Contents', 'Info.plist'), 'w') as plist:
@@ -55,9 +78,9 @@
<key>isDashDocset</key>
<true/>
<key>dashIndexFilePath</key>
- <string>html/Ext.html</string>
+ <string>%s</string>
</dict>
-</plist>""" % (docsetshortname, docsetname, docsetshortname))
+</plist>""" % (docsetshortname, docsetname, docsetshortname, indexpath))
conn = sqlite3.connect(os.path.join(OUT_DIR, 'Contents', 'Resources', 'docSet.dsidx'))
c = conn.cursor()
@@ -85,6 +108,10 @@
<html>
<head>
<link rel="stylesheet" href="../resources/css/app-851b66f18114a2a31d488e9c8d7cb964.css" type="text/css" />
+ <!-- titanium hack -->
+ <link rel="stylesheet" href="../resources/css/my.css" type="text/css" />
+ <link rel="stylesheet" href="../resources/css/viewport.css" type="text/css" />
+ <link rel="stylesheet" href="../resources/css/docs-ext.css" type="text/css" />
<style>
body {
margin: 2em;
@@ -99,7 +126,8 @@
</head>
<body>
<span style="font-size:2em; font-weight:bold">%s</span>
-<div class="class-overview"><div class="x-panel-body">"""%fname[:-len('.html')])
+<!-- center-container is for titanium -->
+<div id="center-container" class="class-overview"><div class="x-panel-body">"""%fname[:-len('.html')])
for a in tree.findall('//a'):
if 'href' not in a.attrib: continue

0 comments on commit 05eb1eb

Please sign in to comment.