summaryrefslogtreecommitdiff
path: root/_includes/sb_sidebar_settings.html
blob: 5f04c92d14e9acdd3eeef83bd15447bbf96ada27 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
<h4>Quick Nav</h4>

<p>
{% assign temp = page.content | split: "
"
%}{% for line in temp
%}{%   assign header = line | normalize_whitespace | truncate: 4, ""
%}{%   if header == "## ["
%}{%     assign category = line | normalize_whitespace | replace: "## [" | replace: "]"
%}{%     assign all_categories = all_categories | append: " " | append: category
%}{%   endif
%}{% endfor
%}{% assign all_categories = all_categories | split: " " | sort | join: " " | prepend: "ALL " | split: " "
%}{% for cat in all_categories
%}
	<select name="{% if cat == "ALL" %}all{% else %}cat_{{ cat }}{% endif %}"  onchange="location.hash='#' + options[options.selectedIndex].value;selectedIndex=0">
	<option class="header" value="">[-- {{ cat | downcase }} --]</option>{%
       capture cat_settings
%}{%     for line in temp
%}{%       assign header = line | normalize_whitespace | truncate: 4, ""
%}{%       if header == "## ["
%}{%         assign category = line | normalize_whitespace | replace: "## [" | replace: "]"
%}{%       endif
%}{%       if category == cat or cat == "ALL"
%}{%         assign is_anchor = line | normalize_whitespace | truncate: 3, ""
%}{%         assign is_setting = line | normalize_whitespace | truncate: 2, ""
%}{%         if is_anchor == "{:#"
%}{%           assign anchor = line | normalize_whitespace | replace: "{:#" | replace: "}"
%}{%         elsif is_setting == "` "
%}{%           assign setting0 = line | split: " "
%}{%           assign setting = setting0[1]
%}{%           if setting == anchor %}{{ setting | downcase }}#{{ setting }}
{%             else %}#error#{{ setting }}{%
               endif
%}{%         else
%}{%           assign anchor =
%}{%           assign setting =
%}{%         endif
%}{%       endif
%}{%     endfor
%}{%   endcapture
%}{%   assign cat_settings = cat_settings | normalize_whitespace | split: " " | sort
%}{%   for sort_setting in cat_settings
%}{%     assign sort_setting0 = sort_setting | split: "#"
%}{%     assign setting = sort_setting0[1] %}
	<option value="{{ setting }}">{{ setting }}</option>{%
       endfor
%}
	</select>{% if cat == "ALL" %}</p><p>{% endif %}
{%   endfor
%}</p>{% comment %}







{% endcomment %}
<h4>Appendices</h4>
<p>
{% comment %}







{% endcomment
%}{% assign is_next = 0
%}{% assign app_title =
%}{% for line in temp
%}{%   assign is_app = line | normalize_whitespace | truncate: 12, ""
%}{%   assign is_anchor = line | normalize_whitespace | truncate: 3, ""
%}{%   if is_app == "## Appendix "
%}{%     assign app_title = line | normalize_whitespace | replace: "## Appendix "
%}{%   elsif is_anchor == "{:#" and app_title
%}{%     assign anchor = line | normalize_whitespace | replace: "{:#" | replace: "}"
%}{%     if is_next == 1 %}<br />{% else %}{% assign is_next = 1 %}{% endif %}
	<a href="#{{ anchor }}">{{ app_title }}</a>
{%     else
%}{%     assign app_title =
%}{%     assign anchor =
%}{%   endif
%}{% endfor %}
</p>