summaryrefslogtreecommitdiff
path: root/web/views/taginfo/apidoc.erb
blob: 864dacce0ed82de7465559fadb1dc72d270e6351 (plain)
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
<h1 class="section">API Documentation</h1>

<p>See <a href="http://wiki.openstreetmap.org/wiki/Taginfo/API">the OSM wiki</a> for general information about the API.</p>

<% if params[:show_deprecated] %>
<p><span class="button"><a href="/taginfo/apidoc">Do not show deprecated API calls</a></span></p>
<% else %>
<p><span class="button"><a href="/taginfo/apidoc?show_deprecated=true">Also show deprecated API calls</a></span></p>
<% end %>

<h2>Table of Contents</h2>

<p style="color: red;">This list of API calls and their descriptions are not complete!</p>

<ul>
<% API.paths.keys.sort.each do |version|
       API.paths[version].keys.sort.each do |path|
           doc = API.paths[version][path]
           if !doc.deprecated? || params[:show_deprecated] %>
    <li><a href="#<%= doc.complete_path.tr('/', '_')[1,1000] %>"><%= doc.complete_path %></a><%= doc.deprecated? ? " <span class='bad'>Deprecated. Use <a href='##{ doc.superseded_by.tr('/', '_')[1,1000] }'>#{ doc.superseded_by }</a> instead.</span>" : '' %></li>
<%         end
       end
   end %>
</ul>

<% API.paths.keys.sort.each do |version|
       API.paths[version].keys.sort.each do |path|
           doc = API.paths[version][path]
           if !doc.deprecated? || params[:show_deprecated] %>
<a name="<%= doc.complete_path.tr('/', '_')[1,1000] %>"></a>
<h2><%= doc.complete_path %><%= doc.deprecated? ? " <span class='bad'>Deprecated. Use <a href='##{ doc.superseded_by.tr('/', '_')[1,1000] }'>#{ doc.superseded_by }</a> instead.</span>" : '' %></h2>
<table class="desc">
    </tr>
    <tr>
    <tr>
        <th>Path:</th>
        <td><tt><%= doc.complete_path %></tt></td>
    </tr>
    <tr>
        <th>Description:</th>
        <td><%= doc.description %></td>
    </tr>
    <tr>
        <th>Parameters:</th>
        <td><%= doc.show_parameters %></td>
    </tr>
    <tr>
        <th>Paging:</th>
        <td><%= doc.show_paging %></td>
    </tr>
    <tr>
        <th>Filter:</th>
        <td><%= doc.show_filter %></td>
    </tr>
    <tr>
        <th>Sort:</th>
        <td><%= doc.show_sort %></td>
    </tr>
    <tr>
        <th>Result:</th>
        <td><%= doc.show_result %></td>
    </tr>
    <tr>
        <th>Example:</th>
        <td><a rel="nofollow" href="<%= doc.show_example %>" target="_blank"><%= doc.show_example %></a></td>
    </tr>
    <tr>
        <th title="User interface page where this API is used">UI Example:</th>
        <td><a href="<%= doc.show_ui %>" target="_blank"><%= doc.show_ui %></a></td>
    </tr>
</table>
<%         end
       end
  end %>