-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapiSidebar.html
47 lines (47 loc) · 2.01 KB
/
apiSidebar.html
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
<nav id="api" class="sidebar sticky">
<a href="/api/" class="item{% if page.url == '/api/index.html' %} active{% endif %}">
Introduction
</a>
<a href="/api/bdd/" class="item{% if page.url == '/api/bdd/' %} active{% endif %}">
Expect / Should
</a>
<a href="/api/assert/" class="item{% if page.url == '/api/assert/' %} active{% endif %}">
Assert
</a>
<a href="/api/plugins/" class="item{% if page.url == '/api/plugins/' %} active{% endif %}">
Plugin Utilities
</a>
<a href="/api/test/" class="item{% if page.url == '/api/test/' %} active{% endif %}">
Online Test Suite
</a>
{% if page.api_namespace %}
<div class="list box-wrap antiscroll-wrap" style="height: 338px;">
<div class="box">
<div class="antiscroll-inner" style="height: 338px; width: 225px;">
<div class="box-inner">
{% assign items = "" %}
{% for method in site.data.chai %}
{% assign render = false %}
{% assign name = false %}
{% for tag in method.tags %}
{% if tag.type == "namespace" and tag.string == page.api_namespace %}
{% assign render = true %}
{% endif %}
{% if tag.type == "name" %}
{% capture name %}{{ tag.string }}{% endcapture %}
{% endif %}
{% endfor %}
{% if render %}
{% capture items %}{{ items | append: ", " | append: name }}{% endcapture %}
{% endif %}
{% endfor %}
{% assign items = items | remove_first: ", " | split: ", " | sort_natural %}
{% for name in items %}
<a href="#method_{{ name | slugify }}" class="scroll item">{{ name }}</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
</nav>