ó ÿgdSc@sKdZddlmZmZddlmZd„Zd„Zd„ZdS(s< sphinx.ext.extlinks ~~~~~~~~~~~~~~~~~~~ Extension to save typing and prevent hard-coding of base URLs in the reST files. This adds a new config value called ``extlinks`` that is created like this:: extlinks = {'exmpl': ('http://example.com/%s.html', prefix), ...} Now you can use e.g. :exmpl:`foo` in your documents. This will create a link to ``http://example.com/foo.html``. The link caption depends on the *prefix* value given: - If it is ``None``, the caption will be the full URL. - If it is a string (empty or not), the caption will be the prefix prepended to the role content. You can also give an explicit caption, e.g. :exmpl:`Foo `. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿ(tnodestutils(tsplit_explicit_titlecsig‡‡fd†}|S(Nc sÉtj|ƒ}t|ƒ\}}} yˆ| } WnAttfk ru|jjd|ˆfd|ƒˆ| } nX|sžˆdkr‘| }qžˆ| }ntj ||dt d| ƒ} | ggfS(Nscunable to expand %s extlink with base URL %r, please make sure the base contains '%%s' exactly oncetlinetinternaltrefuri( RtunescapeRt TypeErrort ValueErrortreportertwarningtNoneRt referencetFalse( ttyptrawtextttexttlinenotinlinertoptionstcontentthas_explicit_titlettitletparttfull_urltpnode(tbase_urltprefix(s=/usr/local/lib/python2.7/site-packages/sphinx/ext/extlinks.pytrole!s    ((RRR((RRs=/usr/local/lib/python2.7/site-packages/sphinx/ext/extlinks.pytmake_link_role scCsFx?|jjjƒD]+\}\}}|j|t||ƒƒqWdS(N(tconfigtextlinkst iteritemstadd_roleR(tapptnameRR((s=/usr/local/lib/python2.7/site-packages/sphinx/ext/extlinks.pytsetup_link_roles5s%cCs'|jdidƒ|jdtƒdS(NRtenvsbuilder-inited(tadd_config_valuetconnectR$(R"((s=/usr/local/lib/python2.7/site-packages/sphinx/ext/extlinks.pytsetup9sN( t__doc__tdocutilsRRtsphinx.util.nodesRRR$R((((s=/usr/local/lib/python2.7/site-packages/sphinx/ext/extlinks.pyts