github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

yui / yuidoc

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 74
    • 15
  • Source
  • Commits
  • Network (15)
  • Downloads (50)
  • Graphs
  • Tree: cf62eeb

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master
  • Switch Tags (50)
    • yuidoc-49
    • yuidoc-48
    • yuidoc-47
    • yuidoc-46
    • yuidoc-45
    • yuidoc-44
    • yuidoc-43
    • yuidoc-42
    • yuidoc-41
    • yuidoc-40
    • yuidoc-39
    • yuidoc-38
    • yuidoc-37
    • yuidoc-36
    • yuidoc-35
    • yuidoc-34
    • yuidoc-33
    • yuidoc-32
    • yuidoc-31
    • yuidoc-30
    • yuidoc-29
    • yuidoc-28
    • yuidoc-27
    • yuidoc-26
    • yuidoc-25
    • yuidoc-24
    • yuidoc-23
    • yuidoc-22
    • yuidoc-21
    • yuidoc-20
    • yuidoc-19
    • yuidoc-18
    • yuidoc-17
    • yuidoc-16
    • yuidoc-15
    • yuidoc-14
    • yuidoc-13
    • yuidoc-12
    • yuidoc-11
    • yuidoc-10
    • yuidoc-9
    • yuidoc-8
    • yuidoc-7
    • yuidoc-6
    • yuidoc-5
    • yuidoc-4
    • yuidoc-3
    • yuidoc-2
    • ${label}
    • 1.0.0b1
  • Comments
Sending Request…

YUI Javascript Documentation Tool — Read more

  Cancel

http://yuilibrary.com/projects/yuidoc

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

2009 -> 2010
apm (author)
Wed Jan 06 13:10:26 -0800 2010
commit  cf62eebf2d16d2584d7ebd087df9b39e4780cdb2
tree    47a49ead9d04b981fa488b1e2aebd6912606c191
parent  99e77a8d5ec107e47b9716c5791c31d597a2bb3e
M bin/const.py 2 ••
M bin/yuidoc.py 2 ••
M bin/yuidoc_generate.py 63 ••••
M bin/yuidoc_highlight.py 2 ••
M bin/yuidoc_parse.py 2 ••
M license.txt 2 ••
M template/assets/ac-js 34 ••••
M template/main.tmpl 5 •••••
0
bin/const.py
...
1
2
 
3
4
5
...
1
 
2
3
4
5
0
@@ -1,5 +1,5 @@
0
 '''
0
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
0
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
0
 Code licensed under the BSD License:
0
 http://developer.yahoo.net/yui/license.html
0
 version: 1.0.0b1
0
bin/yuidoc.py
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 # vim: et sw=4 ts=4
0
 
0
 '''
0
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
0
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
0
 Code licensed under the BSD License:
0
 http://developer.yahoo.net/yui/license.html
0
 version: 1.0.0b1
0
bin/yuidoc_generate.py
...
3
4
5
6
 
7
8
9
...
103
104
105
 
 
106
107
108
...
274
275
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
278
279
...
391
392
393
394
395
 
 
 
 
 
 
396
397
398
399
400
401
 
 
 
402
403
404
...
428
429
430
 
 
431
432
433
...
466
467
468
469
 
 
 
 
 
 
470
471
472
473
474
475
 
 
 
476
477
478
...
495
496
497
498
499
500
501
502
...
524
525
526
 
 
 
 
527
528
529
...
626
627
628
629
 
 
630
631
632
633
634
635
 
 
636
637
638
...
3
4
5
 
6
7
8
9
...
103
104
105
106
107
108
109
110
...
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
...
418
419
420
 
 
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
...
462
463
464
465
466
467
468
469
...
502
503
504
 
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
...
539
540
541
 
 
542
543
544
...
566
567
568
569
570
571
572
573
574
575
...
672
673
674
 
675
676
677
678
679
680
681
682
683
684
685
686
687
0
@@ -3,7 +3,7 @@
0
 # vim: et sw=4 ts=4
0
 
0
 '''
0
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
0
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
0
 Code licensed under the BSD License:
0
 http://developer.yahoo.net/yui/license.html
0
 version: 1.0.0b1
0
@@ -103,6 +103,8 @@ class DocGenerator(object):
0
         self.classnames  = ""
0
         self.filenames   = ""
0
         self.allprops = []
0
+        self.allprops_ext = []
0
+
0
 
0
     def cleanseStr(self, strg):
0
         cleanregex= re.compile(r"[^\w\-]")
0
@@ -274,6 +276,31 @@ class DocGenerator(object):
0
             cy = pat.sub('', cy)
0
             return cmp(cx, cy)
0
 
0
+        def completeProp(main, ext):
0
+            data = main.copy()
0
+            if DESCRIPTION in ext:
0
+                data[DESCRIPTION] = ext[DESCRIPTION]
0
+            else:
0
+                data[DESCRIPTION] = ''
0
+
0
+            if PARAMS in ext:
0
+                params = ext[PARAMS]
0
+                count = 0
0
+                result = []
0
+                itemtemplate = '%s <%s> %s'
0
+                for p in params:
0
+                    if count > 0:
0
+                        result.append(', ')
0
+                    result.append(itemtemplate % (p[NAME] or 'unknown', p[TYPE] or 'Object', p[DESCRIPTION] or ''))
0
+                    count+=1
0
+
0
+                data[PARAMS] = ''.join(result)
0
+            else:
0
+                data[PARAMS] = ''
0
+
0
+            return data
0
+
0
+
0
         log.info("-------------------------------------------------------")
0
  
0
         # copy the json file
0
@@ -391,14 +418,21 @@ class DocGenerator(object):
0
                         for propertykey in keys:
0
                             prop     = c[PROPERTIES][propertykey]
0
                             if self.showprivate or PRIVATE not in prop:
0
-                                propdata = {NAME: propertykey, HOST: i, TYPE: 'property', URL:getUrl(i, propertykey, PROPERTY)}
0
-
0
+                                propdata = {
0
+                                    NAME: propertykey, 
0
+                                    HOST: i, 
0
+                                    TYPE: 'property', 
0
+                                    URL: getUrl(i, propertykey, PROPERTY)
0
+                                }
0
 
0
                                 transferToDict( ACCESS,   prop, propdata           )
0
                                 if PRIVATE in prop: propdata[ACCESS] = PRIVATE
0
                                 elif PROTECTED in prop: propdata[ACCESS] = PROTECTED
0
 
0
                                 self.allprops.append(propdata.copy())
0
+                                # completeProp(propdata, prop)
0
+                                self.allprops_ext.append(completeProp(propdata, prop))
0
+
0
                                 moduleprops.append(propdata.copy())
0
 
0
                                 transferToDict( TYPE,        prop, propdata, OBJECT )
0
@@ -428,6 +462,8 @@ class DocGenerator(object):
0
                                 elif PROTECTED in method: methoddata[ACCESS] = PROTECTED
0
 
0
                                 self.allprops.append(methoddata.copy())
0
+                                # completeProp(methodData, method)
0
+                                self.allprops_ext.append(completeProp(methoddata, method))
0
                                 moduleprops.append(methoddata.copy())
0
 
0
                                 transferToDict( DESCRIPTION, method, methoddata )
0
@@ -466,13 +502,21 @@ class DocGenerator(object):
0
                         for eventkey in keys:
0
                             event = c[EVENTS][eventkey]
0
                             if self.showprivate or PRIVATE not in event:
0
-                                eventdata = {NAME: eventkey, HOST: i, TYPE: 'event', URL:getUrl(i, eventkey, EVENT)}
0
+                                eventdata = {
0
+                                    NAME: eventkey, 
0
+                                    HOST: i, 
0
+                                    TYPE: 'event', 
0
+                                    URL: getUrl(i, eventkey, EVENT)
0
+                                }
0
 
0
                                 transferToDict( ACCESS,      event, eventdata )
0
                                 if PRIVATE in event: eventdata[ACCESS] = PRIVATE
0
                                 elif PROTECTED in event: eventdata[ACCESS] = PROTECTED
0
 
0
                                 self.allprops.append(eventdata.copy())
0
+                                # completeProp(eventdata, event)
0
+                                self.allprops_ext.append(completeProp(eventdata, event))
0
+
0
                                 moduleprops.append(eventdata.copy())
0
 
0
                                 transferToDict( DESCRIPTION, event, eventdata )
0
@@ -495,8 +539,6 @@ class DocGenerator(object):
0
                                 transferToDict( CANCELABLE,      event, eventdata )
0
                                 if CANCELABLE in event: eventdata[CANCELABLE] = CANCELABLE
0
 
0
-
0
-
0
                                 params = eventdata[PARAMS] = []
0
                                 if PARAMS in event:
0
                                     mp = event[PARAMS]
0
@@ -524,6 +566,10 @@ class DocGenerator(object):
0
                                 elif PROTECTED in config: configdata[ACCESS] = PROTECTED
0
 
0
                                 self.allprops.append(configdata.copy())
0
+
0
+                                # completeProp(configdata, config)
0
+                                self.allprops_ext.append(completeProp(configdata, config))
0
+
0
                                 moduleprops.append(configdata.copy())
0
 
0
                                 transferToDict( TYPE,        config, configdata, OBJECT )
0
@@ -626,13 +672,16 @@ class DocGenerator(object):
0
         #remove dups
0
         allprops = []
0
         propmap = {}
0
-        for i in self.allprops:
0
+        # for i in self.allprops:
0
+        for i in self.allprops_ext:
0
             url = i[URL]
0
             if url not in propmap:
0
                 allprops.append(i)
0
                 propmap[url] = True
0
 
0
         allprops.sort(allprop_sort)
0
+
0
+        # self.allprops_ext.sort(allprop_sort)
0
                                             
0
         allprops_json =  simplejson.dumps(allprops, ensure_ascii=False)
0
         self.write("index.json", allprops_json, False)
0
bin/yuidoc_highlight.py
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 # vim: et sw=4 ts=4
0
 
0
 '''
0
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
0
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
0
 Code licensed under the BSD License:
0
 http://developer.yahoo.net/yui/license.html
0
 version: 1.0.0b1
0
bin/yuidoc_parse.py
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 # vim: et sw=4 ts=4
0
 
0
 '''
0
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
0
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
0
 Code licensed under the BSD License:
0
 http://developer.yahoo.net/yui/license.html
0
 version: 1.0.0b1
0
license.txt
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-Copyright (c) 2009, Yahoo! Inc. All rights reserved.
0
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
0
 Code licensed under the BSD License:
0
 
0
 Redistribution and use of this software in source and binary forms, with or
1
template/assets/ac-js
...
12
13
14
15
16
17
 
 
 
18
 
 
19
20
21
 
 
 
 
 
 
 
 
22
23
24
...
75
76
77
78
79
 
80
81
82
83
84
85
 
 
86
87
88
...
156
157
158
 
159
160
161
...
163
164
165
166
167
 
 
 
 
168
169
170
...
12
13
14
 
 
 
15
16
17
18
19
20
21
22
 
23
24
25
26
27
28
29
30
31
32
33
...
84
85
86
 
 
87
88
 
 
 
 
 
89
90
91
92
93
...
161
162
163
164
165
166
167
...
169
170
171
 
 
172
173
174
175
176
177
178
0
@@ -12,13 +12,22 @@
0
         ITEM_TEMPLATE = '<em>{host}</em> <span>{name}</span>',
0
         // ITEM_TEMPLATE = '<em>{host}</em> <span>{params}</span> <span>{name}</span>',
0
         // ITEM_TEMPLATE = '<em>{host}</em> <span>{params}</span> <span>{name}</span><div>{description}</div>',
0
-        yuidoc = YAHOO.namespace('yuidoc');
0
-
0
-yuidoc.init = function() {
0
+        yuidoc = YAHOO.namespace('yuidoc'),
0
+        propdata,
0
+        initialized = false;
0
 
0
+yuidoc.init = function(altdata) {
0
+   yuidoc.initUI(altdata);
0
 };
0
 
0
-yuidoc.initUI = function() {
0
+yuidoc.initUI = function(altdata) {
0
+
0
+    if (initialized) {
0
+        return;
0
+    }
0
+
0
+    propdata = ALL_YUI_PROPS || altdata;
0
+
0
     //Checkboxes are available..
0
     var handleClick = function(e) {
0
         var id, checked = false;
0
@@ -75,14 +84,10 @@ yuidoc.initUI = function() {
0
 //Starting the AutoComplete code
0
     var getResults = function(query) {
0
         var results = [];
0
-        if(query && query.length > 0) {
0
-
0
+        if (query && query.length > 0) {
0
             var q = query.toLowerCase();
0
-
0
-            for (var i=0, len=ALL_YUI_PROPS.length; i<len; ++i) {
0
-
0
-                var prop = ALL_YUI_PROPS[i];
0
-
0
+            for (var i=0, len=propdata.length; i<len; ++i) {
0
+                var prop = propdata[i];
0
                 if (!show['protected'] && prop.access == "protected") {
0
                     // skip
0
                 } else if (!show['private'] && prop.access == "private") {
0
@@ -156,6 +161,7 @@ yuidoc.initUI = function() {
0
     YAHOO.util.Event.onAvailable('classTab', function() {
0
         var tabs = new YAHOO.widget.TabView('classTab');
0
     });
0
+
0
     /*
0
     YAHOO.util.Event.onAvailable('codeTree', function() {
0
         var tree1 = new YAHOO.widget.TreeView('codeTree');
0
@@ -163,8 +169,10 @@ yuidoc.initUI = function() {
0
     });
0
     */
0
 
0
-    YAHOO.util.Event.onAvailable('show_private', function() {
0
-        YAHOO.yuidoc.initUI();
0
+    YAHOO.util.Event.onDOMReady(function() {
0
+        if (typeof ALL_YUI_PROPS != "undefined") {
0
+            YAHOO.yuidoc.initUI();
1
+        });
0
     });
0
 
0
 })();
1
template/main.tmpl
...
675
676
677
 
 
 
 
678
679
680
681
682
...
675
676
677
678
679
680
681
682
 
683
684
685
0
@@ -675,8 +675,11 @@
0
   </div>
0
 </div>
0
 <script type="text/javascript">
1
+    #if $indexasdfsdfa
0
+        YAHOO.yuidoc.init();
0
+    #end if 
0
+
0
     var ALL_YUI_PROPS = $allprops;
0
-    YAHOO.yuidoc.init();
0
 </script>
0
 #if $ydn
0
 <!-- Yahoo! Web Analytics - All rights reserved -->

Comments

evocateur Wed Jan 13 10:52:31 -0800 2010 at template/main.tmpl L678

The $indexasdfsdfa variable should be $index here, as the former does not exist in bin/yuidoc_generate.py

evocateur Wed Jan 13 12:52:18 -0800 2010 at template/assets/ac-js L73

The trailing ); on this line causes a syntax error

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server