"),c.on("blur.tt",function(a){var e,f,g;e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # robots.txt for http://www.arduinolibraries.info/
2 | User-agent: *
3 | Allow: /
4 |
5 | Sitemap: http://www.arduinolibraries.info/sitemap.xml
6 |
--------------------------------------------------------------------------------
/public/style.css:
--------------------------------------------------------------------------------
1 | .feed {
2 | color: #FFF;
3 | background: #f60;
4 | margin: 0.7em 0 0.7em 0;
5 | padding: 0.2em 0.35em;
6 | float: right;
7 | font-family: sans-serif;
8 | font-size: 10pt;
9 | font-weight: bold;
10 | }
11 |
12 | .feed:hover {
13 | color: #DDD;
14 | text-decoration: none;
15 | }
16 |
17 | .footer {
18 | padding-top: 50px;
19 | padding-bottom: 50px;
20 | margin-top: 100px;
21 | color: #ffffff;
22 | text-align: center;
23 | background-color: #2c3e50;
24 | }
25 |
26 | /* Improve alignment of search button */
27 | .add-on .input-group-btn > .btn {
28 | border-left-width: 0;
29 | left: -2px;
30 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
31 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
32 | z-index: 10;
33 | }
34 |
35 | /* stop the glowing blue shadow */
36 | .add-on .form-control:focus {
37 | box-shadow: none;
38 | -webkit-box-shadow: none;
39 | border-color: rgb(220, 228, 236)
40 | }
41 |
--------------------------------------------------------------------------------
/public/typeaheadjs.css:
--------------------------------------------------------------------------------
1 | /*
2 | CSS code for using typeahead.js with Bootstrap 3
3 |
4 | Downloaded from:
5 | https://github.com/bassjobsen/typeahead.js-bootstrap-css
6 |
7 | */
8 |
9 | span.twitter-typeahead .tt-menu,
10 | span.twitter-typeahead .tt-dropdown-menu {
11 | position: absolute;
12 | top: 100%;
13 | left: 0;
14 | z-index: 1000;
15 | display: none;
16 | float: left;
17 | min-width: 160px;
18 | padding: 5px 0;
19 | margin: 2px 0 0;
20 | list-style: none;
21 | font-size: 14px;
22 | text-align: left;
23 | background-color: #ffffff;
24 | border: 1px solid #cccccc;
25 | border: 1px solid rgba(0, 0, 0, 0.15);
26 | border-radius: 4px;
27 | -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
28 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
29 | background-clip: padding-box;
30 | }
31 | span.twitter-typeahead .tt-suggestion {
32 | display: block;
33 | padding: 3px 20px;
34 | clear: both;
35 | font-weight: normal;
36 | line-height: 1.42857143;
37 | color: #333333;
38 | white-space: nowrap;
39 | }
40 | span.twitter-typeahead .tt-suggestion.tt-cursor,
41 | span.twitter-typeahead .tt-suggestion:hover,
42 | span.twitter-typeahead .tt-suggestion:focus {
43 | color: #ffffff;
44 | text-decoration: none;
45 | outline: 0;
46 | background-color: #337ab7;
47 | }
48 | .input-group.input-group-lg span.twitter-typeahead .form-control {
49 | height: 46px;
50 | padding: 10px 16px;
51 | font-size: 18px;
52 | line-height: 1.3333333;
53 | border-radius: 6px;
54 | }
55 | .input-group.input-group-sm span.twitter-typeahead .form-control {
56 | height: 30px;
57 | padding: 5px 10px;
58 | font-size: 12px;
59 | line-height: 1.5;
60 | border-radius: 3px;
61 | }
62 | span.twitter-typeahead {
63 | width: 100%;
64 | }
65 | .input-group span.twitter-typeahead {
66 | display: block !important;
67 | height: 34px;
68 | }
69 | .input-group span.twitter-typeahead .tt-menu,
70 | .input-group span.twitter-typeahead .tt-dropdown-menu {
71 | top: 32px !important;
72 | }
73 | .input-group span.twitter-typeahead:not(:first-child):not(:last-child) .form-control {
74 | border-radius: 0;
75 | }
76 | .input-group span.twitter-typeahead:first-child .form-control {
77 | border-top-left-radius: 4px;
78 | border-bottom-left-radius: 4px;
79 | border-top-right-radius: 0;
80 | border-bottom-right-radius: 0;
81 | }
82 | .input-group span.twitter-typeahead:last-child .form-control {
83 | border-top-left-radius: 0;
84 | border-bottom-left-radius: 0;
85 | border-top-right-radius: 4px;
86 | border-bottom-right-radius: 4px;
87 | }
88 | .input-group.input-group-sm span.twitter-typeahead {
89 | height: 30px;
90 | }
91 | .input-group.input-group-sm span.twitter-typeahead .tt-menu,
92 | .input-group.input-group-sm span.twitter-typeahead .tt-dropdown-menu {
93 | top: 30px !important;
94 | }
95 | .input-group.input-group-lg span.twitter-typeahead {
96 | height: 46px;
97 | }
98 | .input-group.input-group-lg span.twitter-typeahead .tt-menu,
99 | .input-group.input-group-lg span.twitter-typeahead .tt-dropdown-menu {
100 | top: 46px !important;
101 | }
102 |
--------------------------------------------------------------------------------
/views/architecture_variants.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <% sorted_architectures.each do |architecture| %>
5 |
6 |
14 |
15 |
16 |
17 |
18 | <% architectures[architecture].sort.each do |key| %>
19 | <% library = libraries[key.to_sym] %>
20 |
21 | <%== link_to(library[:name], :href => "/libraries/#{key}") %>
22 | <%== link_to(library[:github]) %>
23 |
24 | <% end %>
25 |
26 |
27 |
28 |
29 |
30 | <% end %>
31 |
32 |
33 |
--------------------------------------------------------------------------------
/views/author.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% if author[:name] %>
3 | Name <%= author[:name] %>
4 | <% end %>
5 | <% if author[:location] %>
6 | Location <%= author[:location] %>
7 | <% end %>
8 | <% if author[:homepage] and author[:github] != author[:homepage] %>
9 | Homepage <%== link_to(author[:homepage]) %>
10 | <% end %>
11 | GitHub <%== link_to(author[:github]) %>
12 | <% if author[:twitter] %>
13 | Twitter <%== link_to("@#{author[:twitter]}", :href => "https://twitter.com/#{author[:twitter]}") %>
14 | <% end %>
15 |
16 |
17 |
18 |
Libraries
19 |
20 | <% author[:libraries].sort.each do |key| %>
21 | <% library = libraries[key.to_sym] %>
22 |
23 | <%== link_to(library[:name], :href => "/libraries/#{key}") %>
24 | <%= library[:sentence] %>
25 |
26 | <% end %>
27 |
28 |
--------------------------------------------------------------------------------
/views/authors.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% authors.keys.sort.each do |username| %>
3 | <% author = authors[username] %>
4 |
5 | <%= username %>:
6 | <%== link_to(author[:name], :href => "/authors/#{username}") %>
7 | (<%= author[:libraries].count %>)
8 |
9 | <% end %>
10 |
11 |
--------------------------------------------------------------------------------
/views/feed.xml.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | https://www.arduinolibraries.info/feed
5 | Latest Arduino Library Releases
6 |
7 |
8 | <%= pub_date %>
9 |
10 | <% libraries.each do |library| %>
11 |
12 | https://www.arduinolibraries.info/libraries/<%= library[:key] %>#v<%= library[:version] %>
13 | <%= library[:name] %> v<%= library[:version] %> released
14 |
15 | <%= library[:author] %>
16 |
17 | <%= library[:sentence] %>
18 |
19 | <%= library[:release_date] %>
20 | <%= library[:release_date] %>
21 |
22 |
23 | <% end %>
24 |
25 |
--------------------------------------------------------------------------------
/views/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 | This site is generated automatically from the <%= @count %> libraries
3 | registered in the Arduino Library Manager .
4 |
5 |
6 |
7 |
8 |
9 |
10 | Most Recent
11 |
12 | RSS
13 |
14 |
15 | <% most_recent.each_with_index do |library, index| %>
16 |
17 | <%= index + 1 %>.
18 |
19 | <%== link_to(library[:name], :href => "/libraries/#{library[:key]}") %>
20 | v<%= library[:version] %>
21 |
22 |
23 | <%= days_ago(library[:release_date]) %>
24 |
25 |
26 | <% end %>
27 |
28 |
29 |
30 |
31 |
32 | Most Starred
33 |
34 |
35 |
36 | <% most_stars.each_with_index do |library, index| %>
37 |
38 | <%= index + 1 %>.
39 | <%== link_to(library[:name], :href => "/libraries/#{library[:key]}") %>
40 | <%= library[:stargazers_count] %>
41 |
42 | <% end %>
43 |
44 |
45 |
46 |
47 |
48 | Most Forked
49 |
50 |
51 |
52 | <% most_forked.each_with_index do |library, index| %>
53 |
54 | <%= index + 1 %>.
55 | <%== link_to(library[:name], :href => "/libraries/#{library[:key]}") %>
56 | <%= library[:forks] %>
57 |
58 | <% end %>
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | By Category
70 |
71 |
72 |
73 | <% @categories.keys.sort.each do |category| %>
74 |
75 | <%== link_to(category, :href => "/categories/#{category.to_s.keyize}") %>
76 | (<%= @categories[category].count %>)
77 |
78 | <% end %>
79 |
80 |
81 |
82 |
83 |
84 | By Type
85 |
86 |
87 |
88 | <% @types.keys.sort.each do |type| %>
89 |
90 | <%== link_to(type, :href => "/types/#{type.to_s.keyize}") %>
91 | (<%= @types[type].count %>)
92 |
93 | <% end %>
94 |
95 |
96 |
97 | By License
98 |
99 |
100 |
101 | <% @licenses.keys.sort.each do |license| %>
102 |
103 | <%== link_to(license.to_s.gsub('-',' '), :href => "/licenses/#{license.to_s.keyize}") %>
104 | (<%= @licenses[license].count %>)
105 |
106 | <% end %>
107 |
108 |
109 |
110 |
111 |
112 | By Architecture
113 |
114 |
115 |
116 | <% @architectures.keys.sort.each do |architecture| %>
117 |
118 | <%== link_to(architecture, :href => "/architectures/#{architecture.to_s.keyize}") %>
119 | (<%= @architectures[architecture].count %>)
120 |
121 | <% end %>
122 |
123 |
124 |
125 |
126 |
127 |
128 | ... or you can view all <%== link_to("#{@count} libraries", :href => "/libraries") %>, or
129 | <%== link_to("#{@authors.count} authors", :href => "/authors") %> in a great big long list.
130 |
131 |
--------------------------------------------------------------------------------
/views/layout.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
<%= title %> - Arduino Libraries
9 |
10 | <% if description %>
11 |
12 |
13 |
14 |
15 |
16 | <% end %>
17 |
18 |
19 |
20 |
21 | <% if rss_url %>
22 |
23 | <% end %>
24 |
25 |
26 |
27 |
28 |
29 |
30 | <% if jsonld %>
31 |
32 |
33 | <% end %>
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
54 |
55 |
56 |
57 |
58 | <% unless @categories.nil? %>
59 |
60 | Categories
61 |
66 |
67 | <% end %>
68 | <% unless @types.nil? %>
69 |
70 | Types
71 |
76 |
77 | <% end %>
78 | <% unless @architectures.nil? %>
79 |
80 | Architectures
81 |
86 |
87 | <% end %>
88 | Authors
89 |
90 |
91 |
92 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
<%= title %>
110 | <%== yield %>
111 |
112 |
113 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
148 |
149 | <% unless jsonld.nil? %>
150 |
151 |
154 | <% end %>
155 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/views/list.html.erb:
--------------------------------------------------------------------------------
1 |
<%== synopsis %>
2 |
3 |
4 | <% keys.sort.each do |key| %>
5 | <% library = libraries[key] %>
6 |
7 | <%== link_to(library[:name], :href => "/libraries/#{key}") %>
8 | <%= library[:sentence] %>
9 |
10 | <% end %>
11 |
12 |
--------------------------------------------------------------------------------
/views/show.html.erb:
--------------------------------------------------------------------------------
1 | <% if library[:paragraph].nil? || library[:paragraph].index(library[:sentence]).nil? %>
2 |
<%= library[:sentence] %>
3 | <% end %>
4 |
5 |
6 | Author <%== link_to(library[:author], :href => "/authors/#{library[:username]}") %>
7 | <% if library[:maintainer] != library[:author] %>
8 | Maintainer <%= library[:maintainer] %>
9 | <% end %>
10 | Website <%== link_to(library[:website]) %>
11 | <% if library[:github] != library[:website] %>
12 | Github <%== link_to(library[:github]) %>
13 | <% end %>
14 | Category <%== link_to_category(library[:category]) %>
15 | License <%== link_to_license(library[:license]) %>
16 | Library Type <%== pretty_list(library[:types]) %>
17 | Architectures <%== pretty_list(library[:architectures]) %>
18 |
19 |
20 |
<%= library[:paragraph] %>
21 |
22 |
Downloads
23 |
24 |
25 |
26 | Filename
27 | Release Date
28 | File Size
29 |
30 |
31 |
32 |
33 | <% library[:versions].each do |version| %>
34 |
35 | <%== link_to(version[:archiveFileName], :href => version[:url]) %>
36 |
37 | <% if version[:release_date] %>
38 | <%== link_to(Time.parse(version[:release_date]).strftime('%Y-%m-%d'), :href => version[:github]) %>
39 | <% else %>
40 |
41 | <% end %>
42 |
43 | <%= format_filesize(version[:size]) %>
44 |
45 | <% end %>
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------