origen_doc_helpers 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/origen_doc_helpers/guide_index.rb +26 -9
- data/templates/shared/_searchable.html.erb +5 -1
- 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: c9913b384df5e46cc7aaa1a413e4bdebf5707074
|
4
|
+
data.tar.gz: 0eec0a9f93a7760a5d19a833f12d4aa88c3221bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 201b1b79b0c2ca2b556536ca635c1602154901fd25511f43a576f14ad805c7d5bc50dc97464c3229f4eed04ea2c966b581327618aaf2c2aa214f66a87c0123fc
|
7
|
+
data.tar.gz: 60ec544a89a90dfb5a3a040a2f7ca747f7d51e12ed488c58f0bcbd95187cea043243d1d9b4d1b3c47c0288f0df81647e047090c92999d33fdd2ccc4fe2306107
|
data/config/version.rb
CHANGED
@@ -10,6 +10,23 @@ module OrigenDocHelpers
|
|
10
10
|
@pending_pages = []
|
11
11
|
end
|
12
12
|
|
13
|
+
# Force any pending sections and pages into the index, these will be added
|
14
|
+
# at the end since their :after/:before reference is not valid
|
15
|
+
def force_pending
|
16
|
+
@force_pending = true
|
17
|
+
@pending_sections.each do |id, opts, blk|
|
18
|
+
section(id, opts, &blk)
|
19
|
+
end
|
20
|
+
@pending_pages.each do |section_id, id, opts|
|
21
|
+
@current_section_id = section_id
|
22
|
+
@current_section = @index[section_key]
|
23
|
+
page(id, opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
@force_pending = nil
|
27
|
+
self
|
28
|
+
end
|
29
|
+
|
13
30
|
def section(id, options = {}, &block)
|
14
31
|
@current_section_id = id
|
15
32
|
if options[:heading]
|
@@ -29,14 +46,14 @@ module OrigenDocHelpers
|
|
29
46
|
@section_keys[id] ||= @section_keys[id].to_s if @section_keys[id]
|
30
47
|
section_pending = false
|
31
48
|
unless @index[section_key]
|
32
|
-
if options[:after]
|
49
|
+
if options[:after] && !@force_pending
|
33
50
|
if has_key?(:@index, section_key(options[:after]))
|
34
51
|
insert_after(:@index, section_key, section_key(options[:after]), {})
|
35
52
|
else
|
36
53
|
@pending_sections << [id, options.dup, block] unless @no_pending
|
37
54
|
section_pending = true
|
38
55
|
end
|
39
|
-
elsif options[:before]
|
56
|
+
elsif options[:before] && !@force_pending
|
40
57
|
if has_key?(:@index, section_key(options[:before]))
|
41
58
|
insert_before(:@index, section_key, section_key(options[:before]), {})
|
42
59
|
else
|
@@ -52,7 +69,7 @@ module OrigenDocHelpers
|
|
52
69
|
@current_section = nil
|
53
70
|
|
54
71
|
# See if any pending sections can now be inserted
|
55
|
-
unless @no_pending
|
72
|
+
unless @no_pending || @force_pending
|
56
73
|
@pending_sections.each do |id, opts, blk|
|
57
74
|
@no_pending = true
|
58
75
|
section(id, opts, &blk)
|
@@ -70,18 +87,18 @@ module OrigenDocHelpers
|
|
70
87
|
value = options[:heading] || id
|
71
88
|
value = value.to_s if value
|
72
89
|
page_pending = false
|
73
|
-
if options[:after]
|
90
|
+
if options[:after] && !@force_pending
|
74
91
|
if has_key?(:@current_section, topic_key(options[:after]))
|
75
92
|
insert_after(:@current_section, topic_key, topic_key(options[:after]), value)
|
76
93
|
else
|
77
|
-
@pending_pages << [id, options.dup] unless @no_page_pending
|
94
|
+
@pending_pages << [@current_section_id, id, options.dup] unless @no_page_pending
|
78
95
|
page_pending = true
|
79
96
|
end
|
80
|
-
elsif options[:before]
|
97
|
+
elsif options[:before] && !@force_pending
|
81
98
|
if has_key?(:@current_section, topic_key(options[:before]))
|
82
99
|
insert_before(:@current_section, topic_key, topic_key(options[:before]), value)
|
83
100
|
else
|
84
|
-
@pending_pages << [id, options.dup] unless @no_page_pending
|
101
|
+
@pending_pages << [@current_section_id, id, options.dup] unless @no_page_pending
|
85
102
|
page_pending = true
|
86
103
|
end
|
87
104
|
else
|
@@ -92,8 +109,8 @@ module OrigenDocHelpers
|
|
92
109
|
@index[section_key] = @current_section unless page_pending
|
93
110
|
|
94
111
|
# See if any pending pages can now be inserted
|
95
|
-
unless @no_page_pending
|
96
|
-
@pending_pages.each do |id, opts|
|
112
|
+
unless @no_page_pending || @force_pending
|
113
|
+
@pending_pages.each do |section_id, id, opts|
|
97
114
|
@no_page_pending = true
|
98
115
|
page(id, opts)
|
99
116
|
@no_page_pending = false
|
@@ -1,7 +1,11 @@
|
|
1
1
|
% options[:root] ||= "docs"
|
2
2
|
% options[:path_separator] ||= "_"
|
3
3
|
% pdf_filename = ::OrigenDocHelpers::PDF.register(options)
|
4
|
-
%
|
4
|
+
% if options[:index].is_a?(OrigenDocHelpers::GuideIndex)
|
5
|
+
% options[:index] = options[:index].force_pending.to_h
|
6
|
+
% else
|
7
|
+
% options[:index] = options[:index].to_h
|
8
|
+
% end
|
5
9
|
|
6
10
|
<div class="row">
|
7
11
|
<div class="col-md-3 sidebar-nav-container">
|
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.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|