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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e54b98be52c3c109ba512fb7a63fa6767b7b57d
4
- data.tar.gz: 25ba92c48b8cf8a858d6d53968d5f0d28f682bbc
3
+ metadata.gz: 48520b052df0e116bbf93270ef15f94264871673
4
+ data.tar.gz: 0973fb0a443a176ecb3496ef4ac45345b6482e2e
5
5
  SHA512:
6
- metadata.gz: acffc77fa08ae7e206e7c18fb4b123596611a0c3a949b6fb6a3294cb3d91ae5740400ad71cf768960d921a8f23f3b61fd642621a2f92e30fcf122678e0ce2caf
7
- data.tar.gz: e3e12e2e3a7311e37914a762f18eaa60aef34bda254b2212a67df5f8c5d9df7c5ba9510ee2696309e6ed829a079bf345c50838d7a9ebfbdc6f24d7d7d08b60cc
6
+ metadata.gz: e71e63f47668884cd275a504c194bc7f474f2751b66e307d21f0cab105147a380f16185d07f7192f7df916c5b64bfb1940210bed9c0f2c21b44e0c7f6a53f7d4
7
+ data.tar.gz: 53eebddf7b35d85d714c6342046ea9cb8c394db4f8fcbcfd49c809f834f5d09f6ff539a6fbac8cedd3200043ce1d8169eeb2ecb1ff5c4af8ab6cf6e84dc8f69d
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module OrigenDocHelpers
2
2
  MAJOR = 0
3
3
  MINOR = 4
4
- BUGFIX = 2
4
+ BUGFIX = 3
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -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 - Each wrapped document will have the heading (e.g. "First Item") inserted at the top of the page,
51
- to override it supply this option. A common example would be if the topic is long and
52
- so an abbreviated version has been used in the index. e.g. "First Item and Other Stuff"
53
- :topic - Each wrapped document will have the topic (e.g. "Topic 1") inserted at the top of the page,
54
- to override it supply this option. A common example would be if the topic is long and
55
- so an abbreviated version has been used in the index. e.g. "Topic 1 and Other Stuff"
56
- :root - override the top-level folder containing your documents, e.g. "tutorials/guides"
57
- :tab - the helper should automatically work out what tab to select for each document, however
58
- if it is struggling for some reason you can force it by supplying the hash key from the
59
- index that the given document should be associated with, e.g. :topic1_item1
60
- :prompt - the search box prompt, by default is "Search these docs..."
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.2
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-06-23 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen