origen_doc_helpers 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/templates/shared/_searchable.html.erb +3 -2
- data/templates/web/helpers/searchable/intro.md.erb +30 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48520b052df0e116bbf93270ef15f94264871673
|
4
|
+
data.tar.gz: 0973fb0a443a176ecb3496ef4ac45345b6482e2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e71e63f47668884cd275a504c194bc7f474f2751b66e307d21f0cab105147a380f16185d07f7192f7df916c5b64bfb1940210bed9c0f2c21b44e0c7f6a53f7d4
|
7
|
+
data.tar.gz: 53eebddf7b35d85d714c6342046ea9cb8c394db4f8fcbcfd49c809f834f5d09f6ff539a6fbac8cedd3200043ce1d8169eeb2ecb1ff5c4af8ab6cf6e84dc8f69d
|
data/config/version.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
% options[:root] ||= "docs"
|
2
|
+
% options[:path_separator] ||= "_"
|
2
3
|
% pdf_filename = ::OrigenDocHelpers::PDF.register(options)
|
3
4
|
|
4
5
|
<div class="row">
|
@@ -28,7 +29,7 @@
|
|
28
29
|
<div class="panel-body">
|
29
30
|
<ul class="nav nav-list">
|
30
31
|
% sections.each do |tab, section|
|
31
|
-
% paths = tab.to_s.split(
|
32
|
+
% paths = tab.to_s.split(options[:path_separator])
|
32
33
|
<li class="<%= tab == _resolve_tab(options) ? 'active' : '' %>"><a href="<%= path "/#{_root_path(options)}/#{paths[0]}/#{paths[1]}" %>"><%= section %></a></li>
|
33
34
|
% end
|
34
35
|
</ul>
|
@@ -38,7 +39,7 @@
|
|
38
39
|
% else
|
39
40
|
<ul class="nav nav-list">
|
40
41
|
% sections.each do |tab, section|
|
41
|
-
% paths = tab.to_s.split(
|
42
|
+
% paths = tab.to_s.split(options[:path_separator])
|
42
43
|
<li class="<%= tab == _resolve_tab(options) ? 'active' : '' %>"><a href="<%= path "/#{_root_path(options)}/#{paths[0]}/#{paths[1]}" %>"><%= section %></a></li>
|
43
44
|
% end
|
44
45
|
</ul>
|
@@ -30,6 +30,20 @@ the document with title "Second Item" should live in <code>_documents_root_/topi
|
|
30
30
|
By default the root is <code>"#{Origen.root}/templates/web/docs"</code> but this can be overridden
|
31
31
|
by supplying a <code>:root</code> option which should describe the relative path from <code>"#{Origen.root}/templates/web"</code>.
|
32
32
|
|
33
|
+
By default, the sub_hash key will be split by the '_' character to find the <code>_directory_/_file_</code>
|
34
|
+
as shown above but this can be overridden by supplying the <code>:path_separator</code> option. For example,
|
35
|
+
using <code>path_separator: '__'</code> (double underscore) with the index used below would result in the
|
36
|
+
the document with title "Second Item" living now at <code>_documents_root_/topic1/second_item.md.erb</code>
|
37
|
+
|
38
|
+
~~~ruby
|
39
|
+
index = {}
|
40
|
+
index["Topic 1"] = {
|
41
|
+
topic1__first_item: "First Item",
|
42
|
+
topic1__second_item: "Second Item",
|
43
|
+
}
|
44
|
+
~~~
|
45
|
+
|
46
|
+
|
33
47
|
### The Layout Helper
|
34
48
|
|
35
49
|
A layout helper is provided to include a document in the search and wrap it
|
@@ -47,17 +61,22 @@ The <code>:index</code> option is mandatory, but the following are optional:
|
|
47
61
|
|
48
62
|
~~~text
|
49
63
|
%#:pdf_title - PDF creation is enabled by providing a title via this option, e.g. "My Application Guides"
|
50
|
-
:heading
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
64
|
+
:heading - Each wrapped document will have the heading (e.g. "First Item") inserted at
|
65
|
+
the top of the page, to override it supply this option. A common example would
|
66
|
+
be if the topic is long and so an abbreviated version has been used in the
|
67
|
+
index. e.g. "First Item and Other Stuff"
|
68
|
+
:topic - Each wrapped document will have the topic (e.g. "Topic 1") inserted at the top
|
69
|
+
of the page, to override it supply this option. A common example would be if
|
70
|
+
the topic is long and so an abbreviated version has been used in the
|
71
|
+
index. e.g. "Topic 1 and Other Stuff"
|
72
|
+
:root - override the top-level folder containing your documents, e.g. "tutorials/guides"
|
73
|
+
:tab - the helper should automatically work out what tab to select for each document,
|
74
|
+
however if it is struggling for some reason you can force it by supplying the
|
75
|
+
hash key from the index that the given document should be associated
|
76
|
+
with, e.g. :topic1_item1
|
77
|
+
:prompt - the search box prompt, by default is "Search these docs..."
|
78
|
+
:path_separator - override how the sub-hash key in the index will be split (which character will
|
79
|
+
be used) to generate the location of the document
|
61
80
|
~~~
|
62
81
|
|
63
82
|
### Incorporating in Your Own Layout
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origen_doc_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|