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: 2a88711

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

Added support for Python, Perl and Ruby
davglass (author)
Tue Jun 23 21:37:34 -0700 2009
commit  2a8871171cc1de5d085aaa28f7f7052673050892
tree    4a944d3a766925566c8e0fd167ff54f4e04530c4
parent  babd41bb1d506199b0b1aa517bab0ae9c92c5704
M bin/yuidoc_highlight.py 13 ••••
M bin/yuidoc_parse.py 6 ••••
A test/lang/perl/test.pl 39 •••••
R test/{ → lang}/test.php/php 2 ••
A test/lang/python/test.py 27 •••••
A test/lang/ruby/test.rb 73 •••••
0
bin/yuidoc_highlight.py
...
14
15
16
17
18
19
20
21
...
43
44
45
 
46
 
 
 
 
 
 
 
 
 
47
 
48
49
50
...
14
15
16
 
 
17
18
19
...
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -14,8 +14,6 @@ from const import *
0
 from cStringIO import StringIO 
0
 from optparse import OptionParser
0
 from pygments import highlight
0
-from pygments.lexers import JavascriptLexer
0
-from pygments.lexers import PhpLexer
0
 from pygments.formatters import HtmlFormatter
0
 
0
 try:
0
@@ -43,8 +41,19 @@ class DocHighlighter(object):
0
         def highlightString(src):
0
             try:
0
                 if self.currentExt == 'php':
0
+                    from pygments.lexers import PhpLexer
0
                     return highlight(src, PhpLexer(), HtmlFormatter())
0
+                elif self.currentExt == 'py':
0
+                    from pygments.lexers import PythonLexer
0
+                    return highlight(src, PythonLexer(), HtmlFormatter())
0
+                elif self.currentExt == 'rb':
0
+                    from pygments.lexers import RubyLexer
0
+                    return highlight(src, RubyLexer(), HtmlFormatter())
0
+                elif self.currentExt == 'pl':
0
+                    from pygments.lexers import PerlLexer
0
+                    return highlight(src, PerlLexer(), HtmlFormatter())
0
                 else:
0
+                    from pygments.lexers import JavascriptLexer
0
                     return highlight(src, JavascriptLexer(), HtmlFormatter())
0
             except: 
0
                 return "File could not be highlighted"
0
bin/yuidoc_parse.py
...
40
41
42
43
 
 
 
44
45
46
...
499
500
501
502
503
504
505
...
540
541
542
 
543
544
545
...
40
41
42
 
43
44
45
46
47
48
...
501
502
503
 
504
505
506
...
541
542
543
544
545
546
547
0
@@ -40,7 +40,9 @@ class DocParser(object):
0
 
0
         def parseFile(path, file):
0
             f=open(os.path.join(path, file))
0
-            fileStr=StringIO(f.read()).getvalue()
0
+            #adding a return to the beginning of the line allows for:
0
+            #  #!/usr/bin/foo
0
+            fileStr = StringIO("\n%s" % f.read()).getvalue()
0
             log.info("parsing " + file)
0
             # add a file marker token so the parser can keep track of what is in what file
0
             content = "\n/** @%s %s \n*/" % (FILE_MARKER, file)
0
@@ -499,7 +501,6 @@ it was empty" % token
0
             self.subModName = False
0
             if not MODULES in self.data: self.data[MODULES] = {}
0
             for module in tokenMap[MODULE]:
0
-
0
                 if module not in self.data[MODULES]:
0
                     self.data[MODULES][module] = { NAME: module, CLASS_LIST: [], FILE_LIST: [], SUBMODULES: [], SUBDATA: {} }
0
 
0
@@ -540,6 +541,7 @@ it was empty" % token
0
 
0
             return target, tokenMap
0
 
0
+        print "DAV: %s" % tokenMap
0
         if FILE_MARKER in tokenMap:
0
             if not FILE_MAP in self.data: self.data[FILE_MAP] = {}
0
             self.currentFile = desc
0
test/lang/perl/test.pl
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -0,0 +1,39 @@
0
+#!/usr/bin/env perl
0
+=begin
0
+/**
0
+* Test Perl File
0
+* @module perltest
0
+*/
0
+=cut
0
+use strict;
0
+=begin
0
+/**
0
+* Test Perl Class
0
+* @class PerlTest
0
+* @namespace Perl
0
+*/
0
+=cut
0
+
0
+=begin
0
+/**
0
+* Arith Method
0
+* @method arith
0
+*/
0
+=cut
0
+sub arith($);
0
+
0
+my %h = (
0
+        'add'   => '+',
0
+        'sub'   => '-',
0
+        'mul'   => '*',
0
+        'div'   => '/',
0
+);
0
+
0
+print arith(eval $ARGV[0]), "\n";
0
+
0
+sub arith($) {
0
+        my $a = shift;
0
+        ref $a ? eval join $h{$a->[0]}, map arith($_), @{$a}[1..$#$a] : $a;
0
+}
0
+
0
+
0
test/php/test.php → test/lang/php/test.php
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 <?php
0
 /**
0
- * General Module description
0
+ * General Module description for PHPTest
0
  * @module phptest
0
  */
0
 
0
test/lang/python/test.py
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
@@ -0,0 +1,27 @@
0
+#!/usr/bin/env python
0
+'''
0
+/**
0
+* Test Python File
0
+* @module testpy
0
+*/
0
+'''
0
+import os, sys, string, shutil, urllib2, urllib, pprint, simplejson, datetime
0
+from cStringIO import StringIO
0
+from subprocess import call, PIPE, Popen
0
+
0
+'''
0
+/**
0
+* This is a test class
0
+* @class TestPy
0
+* @namespace Python
0
+*/
0
+'''
0
+
0
+'''
0
+/**
0
+* Test Method
0
+* @method test
0
+*/
0
+'''
0
+def test():
0
+    pass
0
test/lang/ruby/test.rb
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
0
@@ -0,0 +1,73 @@
0
+#!/usr/bin/env ruby -w
0
+
0
+=begin
0
+/**
0
+* Module Info for test Ruby File
0
+* @module rubytest
0
+*/
0
+=end
0
+
0
+require 'rubygems'
0
+require 'grit'
0
+require 'optparse'
0
+require 'logger'
0
+require 'fileutils'
0
+
0
+
0
+module RubyTest
0
+=begin
0
+/**
0
+* Class Information
0
+* @class test
0
+* @namespace Ruby
0
+*/
0
+=end
0
+    class Test
0
+=begin
0
+/**
0
+* Execute desc
0
+* @method execute
0
+*/
0
+=end
0
+
0
+        def self.execute
0
+            #foo
0
+        end
0
+=begin
0
+/**
0
+* Parse desc
0
+* @method parse
0
+*/
0
+=end
0
+        
0
+        def self.parse(args)
0
+            #foo
0
+        end
0
+=begin
0
+/**
0
+* Initialize Method
0
+* @method initialize
0
+*/
0
+=end
0
+
0
+        def initialize(args)
0
+=begin
0
+/**
0
+* Args Property
0
+* @property args
0
+*/
0
+=end
0
+            @args = args.foo
0
+=begin
0
+/**
0
+* Bar Property
0
+* @property bar
0
+*/
0
+=end
0
+            @bar = 'Bar'
0
+        end
0
+
0
+    end
0
+end
0
+
0
+

Comments

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