1
- ctrlKey = if $ .isMac () then ' cmd' else ' ctrl'
2
- navKey = if $ .isMac () then ' cmd' else ' alt'
1
+ app .templates .helpPage = ->
2
+ ctrlKey = if $ .isMac () then ' cmd' else ' ctrl'
3
+ navKey = if $ .isMac () then ' cmd' else ' alt'
3
4
4
- app .templates .helpPage = """
5
+ aliases_one = {}
6
+ aliases_two = {}
7
+ keys = Object .keys (app .models .Entry .ALIASES )
8
+ middle = Math .ceil (keys .length / 2 ) - 1
9
+ for key, i in keys
10
+ (if i > middle then aliases_two else aliases_one)[key] = app .models .Entry .ALIASES [key]
11
+
12
+ """
5
13
<nav class="_toc" role="directory">
6
14
<h3 class="_toc-title">Table of Contents</h3>
7
15
<ul class="_toc-list">
16
+ <li><a href="#managing-documentations">Managing Documentations</a>
8
17
<li><a href="#search">Search</a>
9
18
<li><a href="#shortcuts">Keyboard Shortcuts</a>
10
19
<li><a href="#aliases">Search Aliases</a>
11
20
</ul>
12
21
</nav>
13
22
14
- <h1 class="_lined-heading">Help</h2>
23
+ <h1 class="_lined-heading">User Guide</h2>
24
+
25
+ <h2 class="_block-heading" id="managing-documentations">Managing Documentations</h2>
26
+ <p>
27
+ Documentations can be enabled and disabled in the <a href="/settings">Preferences</a>.
28
+ Alternatively, you can enable a documentation by searching for it in the main search
29
+ and clicking the "Enable" link in the results.
30
+ For faster and better search, only enable the documentations you plan on actively using.
31
+ <p>
32
+ Once a documentation is enabled, it becomes part of the search and its content can be downloaded for offline access — and faster page loads when online — in the <a href="/offline">Offline</a> area.
15
33
16
34
<h2 class="_block-heading" id="search">Search</h2>
17
35
<p>
18
- The search is case-insensitive. It supports fuzzy matching
36
+ The search is case-insensitive and ignores whitespace . It supports fuzzy matching
19
37
(e.g. <code class="_label">bgcp</code> matches <code class="_label">background-clip</code>)
20
- and aliases (<a href="#aliases">full list </a> below ).
38
+ as well as aliases (full list <a href="#aliases">below </a>).
21
39
<dl>
22
40
<dt id="doc_search">Searching a single documentation
23
41
<dd>
24
- You can scope the search to a single documentation by typing its name (or an abbreviation)
25
- and pressing <code class="_label">Tab </code> (<code class="_label">Space </code> on mobile devices ).
42
+ The search can be scoped to a single documentation by typing its name (or an abbreviation)
43
+ and pressing <code class="_label">tab </code> (<code class="_label">space </code> on mobile).
26
44
For example, to search the JavaScript documentation, enter <code class="_label">javascript</code>
27
- or <code class="_label">js</code>, then <code class="_label">Tab</code>.<br>
28
- To clear the current scope, empty the search field and hit <code class="_label">Backspace</code>.
45
+ or <code class="_label">js</code>, then <code class="_label">tab</code>.<br>
46
+ To clear the current scope, empty the search field and hit <code class="_label">backspace</code> or
47
+ <code class="_label">esc</code>.
29
48
<dt id="url_search">Prefilling the search field
30
49
<dd>
31
- The search field can be prefilled from the URL by visiting <a href="/#q=keyword" target="_top">devdocs.io/#q=keyword</a>.
50
+ The search can be prefilled from the URL by visiting <a href="/#q=keyword" target="_top">devdocs.io/#q=keyword</a>.
32
51
Characters after <code class="_label">#q=</code> will be used as search query.<br>
33
- To search a single documentation, add its name and a space before the keyword:
52
+ To search a single documentation, add its name (or an abbreviation) and a space before the keyword:
34
53
<a href="/#q=js%20date" target="_top">devdocs.io/#q=js date</a>.
35
54
<dt id="browser_search">Searching using the address bar
36
55
<dd>
37
56
DevDocs supports OpenSearch. It can easily be installed as a search engine on most web browsers:
38
57
<ul>
39
- <li>On Chrome, the setup is done automatically. Simply press <code class="_label">Tab </code> when devdocs.io is autocompleted
58
+ <li>On Chrome, the setup is done automatically. Simply press <code class="_label">tab </code> when devdocs.io is autocompleted
40
59
in the omnibox (to set a custom keyword, click <em>Manage search engines\u 2026</em> in Chrome's settings).
41
60
<li>On Firefox, open the search engine list (icon in the search bar) and click <em>Add "DevDocs Search"</em>.
42
61
DevDocs is now available in the search bar. You can also search from the location bar by following
43
62
<a href="https://support.mozilla.org/en-US/kb/how-search-from-address-bar">these instructions</a>.
44
63
</dl>
64
+ <p>
65
+ <i>Note: the above search features only work for documentations that are enabled.</i>
45
66
46
67
<h2 class="_block-heading" id="shortcuts">Keyboard Shortcuts</h2>
47
68
<h3 class="_shortcuts-title">Sidebar</h3>
@@ -95,8 +116,8 @@ app.templates.helpPage = """
95
116
<code class="_shortcut-code">ctrl + ,</code>
96
117
<dd class="_shortcuts-dd">Open preferences
97
118
<dt class="_shortcuts-dt">
98
- <code class="_shortcut-code">escape </code>
99
- <dd class="_shortcuts-dd">Reset UI
119
+ <code class="_shortcut-code">esc </code>
120
+ <dd class="_shortcuts-dd">Clear search field / reset UI
100
121
<dt class="_shortcuts-dt">
101
122
<code class="_shortcut-code">?</code>
102
123
<dd class="_shortcuts-dd">Show this page
@@ -118,11 +139,19 @@ app.templates.helpPage = """
118
139
continue to type and it will refocus the search field and start showing new results.
119
140
120
141
<h2 class="_block-heading" id="aliases">Search Aliases</h2>
121
- <table>
122
- <tr>
123
- <th>Word
124
- <th>Alias
125
- #{ (" <tr><td class=\" _code\" >#{ key} <td class=\" _code\" >#{ value} " for key, value of app .models .Entry .ALIASES ).join (' ' )}
126
- </table>
142
+ <div class="_aliases">
143
+ <table>
144
+ <tr>
145
+ <th>Word
146
+ <th>Alias
147
+ #{ (" <tr><td class=\" _code\" >#{ key} <td class=\" _code\" >#{ value} " for key, value of aliases_one).join (' ' )}
148
+ </table>
149
+ <table>
150
+ <tr>
151
+ <th>Word
152
+ <th>Alias
153
+ #{ (" <tr><td class=\" _code\" >#{ key} <td class=\" _code\" >#{ value} " for key, value of aliases_two).join (' ' )}
154
+ </table>
155
+ </div>
127
156
<p>Feel free to suggest new aliases on <a href="https://github.com/Thibaut/devdocs/issues/new">GitHub</a>.
128
157
"""
0 commit comments