comparison doc/ext.py @ 913:7edb78ba4c5b

Changed epy.doc slightly; commented a part concerning a wiki which does not seem to exist anymore; changed THEANO_API_ROOT to PYLEARN_API_ROOT
author fsavard
date Thu, 18 Mar 2010 15:39:32 -0400
parents 0354b682c289
children
comparison
equal deleted inserted replaced
912:0354b682c289 913:7edb78ba4c5b
4 import os 4 import os
5 from docutils import nodes, utils 5 from docutils import nodes, utils
6 from docutils.parsers.rst import roles 6 from docutils.parsers.rst import roles
7 import epydoc.docwriter.xlink as xlink 7 import epydoc.docwriter.xlink as xlink
8 8
9 def role_fn(name, rawtext, text, lineno, inliner, 9 #def role_fn(name, rawtext, text, lineno, inliner,
10 options={}, content=[]): 10 # options={}, content=[]):
11 node = nodes.reference(rawtext, text, refuri = "http://pylearn.org/theano/wiki/%s" % text) 11 # node = nodes.reference(rawtext, text, refuri = "http://pylearn.org/theano/wiki/%s" % text)
12 return [node], [] 12 # return [node], []
13 13
14 14
15 _TARGET_RE = re.compile(r'^(.*?)\s*<(?:URI:|URL:)?([^<>]+)>$') 15 _TARGET_RE = re.compile(r'^(.*?)\s*<(?:URI:|URL:)?([^<>]+)>$')
16 def create_api_role(name, problematic): 16 def create_api_role(name, problematic):
17 """ 17 """
60 60
61 def setup(app): 61 def setup(app):
62 62
63 try: 63 try:
64 xlink.set_api_file('api', os.path.join(app.outdir, 'api', 'api-objects.txt')) 64 xlink.set_api_file('api', os.path.join(app.outdir, 'api', 'api-objects.txt'))
65 apiroot = os.getenv('THEANO_API_ROOT') 65 apiroot = os.getenv('PYLEARN_API_ROOT')
66 if not apiroot: 66 if not apiroot:
67 apiroot = os.path.join(os.path.realpath('api'), '') 67 apiroot = os.path.join(os.path.realpath('api'), '')
68 xlink.set_api_root('api', apiroot) 68 xlink.set_api_root('api', apiroot)
69 #xlink.create_api_role('api', True) 69 #xlink.create_api_role('api', True)
70 create_api_role('api', True) 70 create_api_role('api', True)
71 except IOError: 71 except IOError:
72 print >>sys.stderr, 'WARNING: Could not find api file! API links will not work.' 72 print >>sys.stderr, 'WARNING: Could not find api file! API links will not work.'
73 73
74 app.add_role("wiki", role_fn) 74 #app.add_role("wiki", role_fn)
75