Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
ApiDocs: Don't link to code
Browse files Browse the repository at this point in the history
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 16, 2017
1 parent 3ef6a28 commit 22770a3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 39 deletions.
14 changes: 0 additions & 14 deletions r2/r2/controllers/api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 0 additions & 21 deletions r2/r2/public/static/css/reddit.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions r2/r2/templates/apihelp.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 22770a3

Please sign in to comment.