The default site Sphinx uses is rfc.net, but that site is giving a timeout
error right now. I'm not sure how long it has been down and/or if its just
temporary, but decided to use ietf.org to link to instead. I'm using
Python's string formatting to insert the RFC number into the default base
URL (allowing for more flexibility in regard to sites with different URI
structures).

I haven't had a look at the in-depth mechanics of the code yet, but wrote a
quick hack that fixes this for me and attached it to this message as a diff.

Regards,

Filip de Waard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

diff -r d5ba35b0a24c sphinx/environment.py
--- a/sphinx/environment.py	Sat Feb 07 20:38:56 2009 +0100
+++ b/sphinx/environment.py	Sun Feb 08 18:35:28 2009 +0100
@@ -51,7 +51,7 @@
     'embed_stylesheet': False,
     'cloak_email_addresses': True,
     'pep_base_url': 'http://www.python.org/dev/peps/',
-    'rfc_base_url': 'http://rfc.net/',
+    'rfc_base_url': 'http://tools.ietf.org/html/rfc%i',
     'input_encoding': 'utf-8',
     'doctitle_xform': False,
     'sectsubtitle_xform': False,
diff -r d5ba35b0a24c sphinx/roles.py
--- a/sphinx/roles.py	Sat Feb 07 20:38:56 2009 +0100
+++ b/sphinx/roles.py	Sun Feb 08 18:35:29 2009 +0100
@@ -79,7 +79,15 @@
             msg = inliner.reporter.error('invalid RFC number %s' % text, line=lineno)
             prb = inliner.problematic(rawtext, rawtext, msg)
             return [prb], [msg]
-        ref = inliner.document.settings.rfc_base_url + inliner.rfc_url % rfcnum
+        
+        try:
+            ref = inliner.document.settings.rfc_base_url % (rfcnum)
+        except TypeError:
+            raise TypeError('rfc_base_url (%s) setting must contain integer ' \
+                'string formatting parameter (like "%s")' % (
+                    inliner.document.settings.rfc_base_url, 
+                    "http://tools.ietf.org/html/rfc439%i";))
+        
         sn = nodes.strong('RFC '+text, 'RFC '+text)
         rn = nodes.reference('', '', refuri=ref)
         rn += sn

Reply via email to