/usr/share/doc/sphinx-doc/html/ext/linkcode.html is in sphinx-doc 1.2.3+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sphinx.ext.linkcode – Add external links to source code — Sphinx 1.2.3 documentation</title>
<link rel="stylesheet" href="../_static/sphinx13.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.2.3',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Sphinx 1.2.3 documentation"
href="../_static/opensearch.xml"/>
<link rel="top" title="Sphinx 1.2.3 documentation" href="../index.html" />
<link rel="up" title="Sphinx Extensions" href="../extensions.html" />
<link rel="next" title="sphinx.ext.oldcmarkup – Compatibility extension for old C markup" href="oldcmarkup.html" />
<link rel="prev" title="sphinx.ext.viewcode – Add links to highlighted source code" href="viewcode.html" />
<style type="text/css">
table.right { float: right; margin-left: 20px; }
table.right td { border: 1px solid #ccc; }
</style>
<script type="text/javascript">
// intelligent scrolling of the sidebar content
$(window).scroll(function() {
var sb = $('.sphinxsidebarwrapper');
var win = $(window);
var sbh = sb.height();
var offset = $('.sphinxsidebar').position()['top'];
var wintop = win.scrollTop();
var winbot = wintop + win.innerHeight();
var curtop = sb.position()['top'];
var curbot = curtop + sbh;
// does sidebar fit in window?
if (sbh < win.innerHeight()) {
// yes: easy case -- always keep at the top
sb.css('top', $u.min([$u.max([0, wintop - offset - 10]),
$(document).height() - sbh - 200]));
} else {
// no: only scroll if top/bottom edge of sidebar is at
// top/bottom edge of window
if (curtop > wintop && curbot > winbot) {
sb.css('top', $u.max([wintop - offset - 10, 0]));
} else if (curtop < wintop && curbot < winbot) {
sb.css('top', $u.min([winbot - sbh - offset - 20,
$(document).height() - sbh - 200]));
}
}
});
</script>
</head>
<body>
<div class="pageheader">
<ul>
<li><a href="../index.html">Home</a></li>
<li><a href="../install.html">Get it</a></li>
<li><a href="../contents.html">Docs</a></li>
<li><a href="../develop.html">Extend/Develop</a></li>
</ul>
<div>
<a href="../index.html">
<img src="../_static/sphinxheader.png" alt="SPHINX" />
</a>
</div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="oldcmarkup.html" title="sphinx.ext.oldcmarkup – Compatibility extension for old C markup"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="viewcode.html" title="sphinx.ext.viewcode – Add links to highlighted source code"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">Sphinx home</a> |</li>
<li><a href="../contents.html">Documentation</a> »</li>
<li><a href="../extensions.html" accesskey="U">Sphinx Extensions</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="viewcode.html"
title="previous chapter"><tt class="docutils literal"><span class="pre">sphinx.ext.viewcode</span></tt> – Add links to highlighted source code</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="oldcmarkup.html"
title="next chapter"><tt class="docutils literal"><span class="pre">sphinx.ext.oldcmarkup</span></tt> – Compatibility extension for old C markup</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/ext/linkcode.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-sphinx.ext.linkcode">
<span id="sphinx-ext-linkcode-add-external-links-to-source-code"></span><h1><a class="reference internal" href="#module-sphinx.ext.linkcode" title="sphinx.ext.linkcode: Add external links to source code."><tt class="xref py py-mod docutils literal"><span class="pre">sphinx.ext.linkcode</span></tt></a> – Add external links to source code<a class="headerlink" href="#module-sphinx.ext.linkcode" title="Permalink to this headline">¶</a></h1>
<p><em>Module author: Pauli Virtanen</em></p>
<div class="versionadded">
<p><span class="versionmodified">New in version 1.2.</span></p>
</div>
<p>This extension looks at your object descriptions (<tt class="docutils literal"><span class="pre">..</span> <span class="pre">class::</span></tt>,
<tt class="docutils literal"><span class="pre">..</span> <span class="pre">function::</span></tt> etc.) and adds external links to code hosted
somewhere on the web. The intent is similar to the
<tt class="docutils literal"><span class="pre">sphinx.ext.viewcode</span></tt> extension, but assumes the source code can be
found somewhere on the Internet.</p>
<p>In your configuration, you need to specify a <a class="reference internal" href="#confval-linkcode_resolve"><tt class="xref std std-confval docutils literal"><span class="pre">linkcode_resolve</span></tt></a>
function that returns an URL based on the object.</p>
<dl class="confval">
<dt id="confval-linkcode_resolve">
<tt class="descname">linkcode_resolve</tt><a class="headerlink" href="#confval-linkcode_resolve" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a function <tt class="docutils literal"><span class="pre">linkcode_resolve(domain,</span> <span class="pre">info)</span></tt>,
which should return the URL to source code corresponding to
the object in given domain with given information.</p>
<p>The function should return <tt class="docutils literal"><span class="pre">None</span></tt> if no link is to be added.</p>
<p>The argument <tt class="docutils literal"><span class="pre">domain</span></tt> specifies the language domain the object is
in. <tt class="docutils literal"><span class="pre">info</span></tt> is a dictionary with the following keys guaranteed to
be present (dependent on the domain):</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">py</span></tt>: <tt class="docutils literal"><span class="pre">module</span></tt> (name of the module), <tt class="docutils literal"><span class="pre">fullname</span></tt> (name of the object)</li>
<li><tt class="docutils literal"><span class="pre">c</span></tt>: <tt class="docutils literal"><span class="pre">names</span></tt> (list of names for the object)</li>
<li><tt class="docutils literal"><span class="pre">cpp</span></tt>: <tt class="docutils literal"><span class="pre">names</span></tt> (list of names for the object)</li>
<li><tt class="docutils literal"><span class="pre">javascript</span></tt>: <tt class="docutils literal"><span class="pre">object</span></tt> (name of the object), <tt class="docutils literal"><span class="pre">fullname</span></tt> (name of the item)</li>
</ul>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">linkcode_resolve</span><span class="p">(</span><span class="n">domain</span><span class="p">,</span> <span class="n">info</span><span class="p">):</span>
<span class="k">if</span> <span class="n">domain</span> <span class="o">!=</span> <span class="s">'py'</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">None</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">info</span><span class="p">[</span><span class="s">'module'</span><span class="p">]:</span>
<span class="k">return</span> <span class="bp">None</span>
<span class="n">filename</span> <span class="o">=</span> <span class="n">info</span><span class="p">[</span><span class="s">'module'</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">'.'</span><span class="p">,</span> <span class="s">'/'</span><span class="p">)</span>
<span class="k">return</span> <span class="s">"http://somesite/sourcerepo/</span><span class="si">%s</span><span class="s">.py"</span> <span class="o">%</span> <span class="n">filename</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="oldcmarkup.html" title="sphinx.ext.oldcmarkup – Compatibility extension for old C markup"
>next</a> |</li>
<li class="right" >
<a href="viewcode.html" title="sphinx.ext.viewcode – Add links to highlighted source code"
>previous</a> |</li>
<li><a href="../index.html">Sphinx home</a> |</li>
<li><a href="../contents.html">Documentation</a> »</li>
<li><a href="../extensions.html" >Sphinx Extensions</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2007-2014, Georg Brandl and the Sphinx team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>
|