This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

ApiDocs: Don't link to code

The docs are generated from the production code, but the links are to the
deprecated opensource repository (github.com/reddit/reddit), so the
links and line references are wrong.
  • Loading branch information...
bsimpson63 committed Oct 14, 2017
1 parent 3ef6a28 commit 22770a32799db69cfff23a8e5a1fb9e4c7b81333
Showing with 0 additions and 39 deletions.
  1. +0 −14 r2/r2/controllers/api_docs.py
  2. +0 −21 r2/r2/public/static/css/reddit.less
  3. +0 −4 r2/r2/templates/apihelp.html
@@ -95,20 +95,6 @@ def add_metadata(api_function):
doc.update(kwargs)
doc['uses_site'] = uses_site
doc['section'] = section
doc['lineno'] = api_function.func_code.co_firstlineno
file_path = abspath(api_function.func_code.co_filename)
root_dir = g.paths['root']
if file_path.startswith(root_dir):
doc['relfilepath'] = relpath(file_path, root_dir)
doc['source_root_url'] = "https://github.com/reddit/reddit/blob/master/r2/r2/"
else:
for plugin in g.plugins:
plugin_root = plugin.path
if plugin.source_root_url and file_path.startswith(plugin_root):
doc['relfilepath'] = relpath(file_path, plugin_root)
doc['source_root_url'] = plugin.source_root_url
return api_function
return add_metadata
@@ -9073,27 +9073,6 @@ form#banned textarea {
font-weight: bold;
}
.api-help .introduction:before,
.api-help .introduction:after {
position: absolute;
display: block;
content: '';
border: 15px solid;
border-style: solid solid outset; /* mitigates firefox drawing a thicker arrow */
}
.api-help .introduction:before {
border-color: transparent #ccc transparent transparent;
left: -31px;
top: 58px;
}
.api-help .introduction:after {
border-color: transparent white transparent transparent;
left: -28px;
top: 58px;
}
.api-help .contents .overview {
h3 {
margin-top: 1.5em;
@@ -126,7 +126,6 @@ <h2 id="scope_${scope}">
<div class="contents">
<div class="section introduction">
<p>This is automatically-generated documentation for the reddit API.</p>
<p>The reddit API and code are&#32;<a href="/code">open source</a>. Found a mistake or interested in helping us improve? Have a gander at&#32;<a href="https://github.com/reddit/reddit/blob/master/r2/r2/controllers/api.py">api.py</a>&#32;and send us a pull request.</p>
<p><strong>Please take care to respect our&#32;<a href="https://github.com/reddit/reddit/wiki/API">API access rules</a>.</strong></p>
</div>
@@ -229,9 +228,6 @@ <h3 id="response_body_encoding">response body encoding</h3>
%>
<div class="endpoint" id="${api_method_id(uri, method)}">
<div class="links">
%if docs.get('lineno') and docs.get('relfilepath'):
<a href="${docs["source_root_url"]}${docs['relfilepath']}#L${docs['lineno']}">view code</a>
%endif
<a href="#${api_method_id(uri, method)}">#</a>
</div>
<h3>

0 comments on commit 22770a3

Please sign in to comment.