ascii_binder 0.1.15.1 → 0.1.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +4 -4
- data/bin/asciibinder +9 -0
- data/lib/ascii_binder/engine.rb +9 -11
- data/lib/ascii_binder/helpers.rb +4 -0
- data/lib/ascii_binder/topic_entity.rb +2 -6
- data/lib/ascii_binder/version.rb +1 -1
- data/templates/_templates/_breadcrumb.html.erb +14 -0
- data/templates/_templates/_nav.html.erb +10 -27
- data/templates/_templates/_title.html.erb +8 -0
- data/templates/_templates/page.html.erb +7 -12
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4ac203ed7b94c0bb9d43493fda6eb22519bdada13bf2fa0ce55b3d8b5fb0766
|
4
|
+
data.tar.gz: aa1e116ec3dddc817f60f33d5877ec49877ae792f601b7ec4d886f926b46cd6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88367857d4d8fa53510222743248e8290ca0327777ad1dadf06b85a6bfd945ddd63f8746a0900b27f431dde371e983c570116387c082d9f602408b0e4a192bf7
|
7
|
+
data.tar.gz: 9e9b30b36d938e8d3116fa71f09112c0c651a9c8a59bc27b9f86758b0fbe240de802b88dae490b83ff49ef0db4f045bce4df787f85dc1625be0e7d119ccfa18c
|
data/README.adoc
CHANGED
@@ -4,17 +4,17 @@ image:https://badge.fury.io/rb/ascii_binder.svg["Gem Version", link="https://bad
|
|
4
4
|
|
5
5
|
AsciiBinder is an AsciiDoc-based system for authoring and publishing closely related documentation sets from a single source.
|
6
6
|
|
7
|
+
This product is no longer actively maintained.
|
8
|
+
|
7
9
|
== Learn More
|
8
10
|
|
9
|
-
*
|
10
|
-
* Have a gander at the http://www.asciibinder.org/latest/welcome/[AsciiBinder documentation].
|
11
|
-
* Or just take the https://rubygems.org/gems/ascii_binder[ascii_binder Ruby Gem] for a spin.
|
11
|
+
* Take the https://rubygems.org/gems/ascii_binder[ascii_binder Ruby Gem] for a spin.
|
12
12
|
|
13
13
|
The AsciiBinder system was initially developed for https://github.com/openshift/openshift-docs[OpenShift documentation], but has been revised to work for documenting a wide variety of complex, multi-versioned software projects.
|
14
14
|
|
15
15
|
== Contributing
|
16
16
|
|
17
|
-
We are using the https://github.com/redhataccess/ascii_binder/issues[Issues] page to track bugs and feature ideas on the code, so have a look and feel free to ask questions there.
|
17
|
+
We are using the https://github.com/redhataccess/ascii_binder/issues[Issues] page to track bugs and feature ideas on the code, so have a look and feel free to ask questions there.
|
18
18
|
|
19
19
|
== License
|
20
20
|
|
data/bin/asciibinder
CHANGED
@@ -133,6 +133,7 @@ EOF
|
|
133
133
|
opt :distro, "Instead of building all distros, build branches only for the specified distro.", :default => ''
|
134
134
|
opt :page, "Build only the specified page for all distros and only the current working branch.", :default => ''
|
135
135
|
opt :log_level, "Set the logging output level for this operation.", :default => 'warn'
|
136
|
+
opt :toc_depth, "Maximum depth of topics allowed. Use 0 for infinite depth.", :default => 3
|
136
137
|
conflicts :distro, :page
|
137
138
|
end
|
138
139
|
when "create"
|
@@ -207,6 +208,7 @@ Options:
|
|
207
208
|
EOF
|
208
209
|
opt :site, "Instead of packaging every docs site, package the specified site only.", :default => ''
|
209
210
|
opt :log_level, "Set the logging output level for this operation.", :default => 'warn'
|
211
|
+
opt :toc_depth, "Maximum depth of topics allowed. Use 0 for infinite depth.", :default => 3
|
210
212
|
end
|
211
213
|
when "help"
|
212
214
|
Trollop::educate
|
@@ -274,6 +276,13 @@ unless cmd_opts.nil? or cmd_opts[:log_level].nil?
|
|
274
276
|
end
|
275
277
|
set_log_level(user_log_level)
|
276
278
|
|
279
|
+
# Set the depth level
|
280
|
+
user_depth = 3
|
281
|
+
unless cmd_opts.nil? or cmd_opts[:toc_depth].nil?
|
282
|
+
user_depth = cmd_opts[:toc_depth].to_i
|
283
|
+
end
|
284
|
+
set_depth(user_depth)
|
285
|
+
|
277
286
|
|
278
287
|
# Cloning? Time to try it.
|
279
288
|
if cmd == 'clone'
|
data/lib/ascii_binder/engine.rb
CHANGED
@@ -188,12 +188,13 @@ module AsciiBinder
|
|
188
188
|
args[:breadcrumb_root], args[:breadcrumb_group], args[:breadcrumb_subgroup], args[:breadcrumb_topic] = extract_breadcrumbs(args)
|
189
189
|
|
190
190
|
args[:breadcrumb_subgroup_block] = ''
|
191
|
-
args[:subtopic_shim] = ''
|
192
191
|
if args[:breadcrumb_subgroup]
|
193
192
|
args[:breadcrumb_subgroup_block] = "<li class=\"hidden-xs active\">#{args[:breadcrumb_subgroup]}</li>"
|
194
|
-
args[:subtopic_shim] = '../'
|
195
193
|
end
|
196
194
|
|
195
|
+
args[:subtopic_shim] = '../' * (args[:topic_id].split('::').length - 2)
|
196
|
+
args[:subtopic_shim] = '' if args[:subtopic_shim].nil?
|
197
|
+
|
197
198
|
template_path = File.expand_path("#{docs_root_dir}/_templates/page.html.erb")
|
198
199
|
template_renderer.render(template_path, args)
|
199
200
|
end
|
@@ -466,10 +467,6 @@ module AsciiBinder
|
|
466
467
|
article_title = doc.doctitle || topic.name
|
467
468
|
|
468
469
|
topic_html = doc.render
|
469
|
-
dir_depth = ''
|
470
|
-
if branch_config.dir.split('/').length > 1
|
471
|
-
dir_depth = '../' * (branch_config.dir.split('/').length - 1)
|
472
|
-
end
|
473
470
|
|
474
471
|
# This is logic bridges newer arbitrary-depth-tolerant code to
|
475
472
|
# older depth-limited code. Truly removing depth limitations will
|
@@ -484,8 +481,9 @@ module AsciiBinder
|
|
484
481
|
if breadcrumb.length == 3
|
485
482
|
subgroup_title = breadcrumb[1][:name]
|
486
483
|
subgroup_id = breadcrumb[1][:id]
|
487
|
-
dir_depth = '../' + dir_depth
|
488
484
|
end
|
485
|
+
dir_depth = '../' * topic.breadcrumb[-1][:id].split('::').length
|
486
|
+
dir_depth = '' if dir_depth.nil?
|
489
487
|
|
490
488
|
preview_path = topic.preview_path(distro.id,branch_config.dir)
|
491
489
|
topic_publish_url = topic.topic_publish_url(distro.site.url,branch_config.dir)
|
@@ -508,10 +506,10 @@ module AsciiBinder
|
|
508
506
|
:group_id => group_id,
|
509
507
|
:subgroup_id => subgroup_id,
|
510
508
|
:topic_id => topic_id,
|
511
|
-
:css_path => "
|
512
|
-
:javascripts_path => "
|
513
|
-
:images_path => "
|
514
|
-
:site_home_path => "
|
509
|
+
:css_path => "#{dir_depth}#{branch_config.dir}/#{STYLESHEET_DIRNAME}/",
|
510
|
+
:javascripts_path => "#{dir_depth}#{branch_config.dir}/#{JAVASCRIPT_DIRNAME}/",
|
511
|
+
:images_path => "#{dir_depth}#{branch_config.dir}/#{IMAGE_DIRNAME}/",
|
512
|
+
:site_home_path => "#{dir_depth}index.html",
|
515
513
|
:template_path => template_dir,
|
516
514
|
:repo_path => topic.repo_path,
|
517
515
|
}
|
data/lib/ascii_binder/helpers.rb
CHANGED
@@ -239,12 +239,8 @@ module AsciiBinder
|
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
242
|
-
# Check the depth.
|
243
|
-
|
244
|
-
# [<group>,<subgroup>,<topic>]
|
245
|
-
#
|
246
|
-
# But this limit will be lifted in the next major version
|
247
|
-
if depth > 2
|
242
|
+
# Check the depth.
|
243
|
+
if (depth > AsciiBinder::DEPTH) and (AsciiBinder::DEPTH != 0)
|
248
244
|
if verbose
|
249
245
|
errors << "#{entity_id} exceeds the maximum nested depth."
|
250
246
|
else
|
data/lib/ascii_binder/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
<%- navigation.each do |topic_group| -%>
|
2
|
+
<%- if topic_id.start_with?(topic_group[:id]) %>
|
3
|
+
<li class="hidden-xs active">
|
4
|
+
<%- if topic_group.has_key?(:topics) -%>
|
5
|
+
<a href="<%= subtopic_shim %><%= topic_group[:path] %>"><%= topic_group[:name] %></a>
|
6
|
+
<%- else -%>
|
7
|
+
<%= topic_group[:name] %>
|
8
|
+
<%- end -%>
|
9
|
+
</li>
|
10
|
+
<%- end -%>
|
11
|
+
<%- if topic_group.has_key?(:topics) -%>
|
12
|
+
<%= render("_templates/_breadcrumb.html.erb", :navigation => topic_group[:topics], :topic_id => topic_id, :subtopic_shim => subtopic_shim) %>
|
13
|
+
<%- end -%>
|
14
|
+
<%- end -%>
|
@@ -1,31 +1,14 @@
|
|
1
|
-
|
2
|
-
<%-
|
3
|
-
|
1
|
+
<%- navigation.each do |topic_group| -%>
|
2
|
+
<%- if not topic_group.has_key?(:topics) -%>
|
3
|
+
<li><a class="<%= topic_id.start_with?(topic_group[:id]) ? ' active' : '' %>" href="<%= subtopic_shim %><%= topic_group[:path] %>"><%= topic_group[:name] %></a></li>
|
4
|
+
<%- else -%>
|
4
5
|
<li class="nav-header">
|
5
|
-
<a class="" href="#" data-toggle="collapse" data-target="#topicGroup
|
6
|
-
<span id="
|
6
|
+
<a class="" href="#" data-toggle="collapse" data-target="#topicGroup-<%= topic_group[:id].hash %>">
|
7
|
+
<span id="sgSpan-<%= topic_group[:id].hash %>" class="fa <%= topic_id.start_with?(topic_group[:id]) ? 'fa-caret-down' : 'fa-caret-right' %>"></span> <%= topic_group[:name] %>
|
7
8
|
</a>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<%- current_topic = current_group && (topic[:id] == topic_id) -%>
|
12
|
-
<li><a class="<%= current_topic ? ' active' : '' %>" href="<%= subtopic_shim %><%= topic[:path] %>"><%= topic[:name] %></a></li>
|
13
|
-
<%- else -%>
|
14
|
-
<%- current_subgroup = topic[:id] == subgroup_id -%>
|
15
|
-
<li class="nav-header">
|
16
|
-
<a class="" href="#" data-toggle="collapse" data-target="#topicSubGroup-<%= groupidx %>-<%= topicidx %>">
|
17
|
-
<span id="sgSpan-<%= groupidx %>-<%= topicidx %>" class="fa <%= current_subgroup ? 'fa-caret-down' : 'fa-caret-right' %>"></span> <%= topic[:name] %>
|
18
|
-
</a>
|
19
|
-
<ul id="topicSubGroup-<%= groupidx %>-<%= topicidx %>" class="nav-tertiary list-unstyled collapse<%= current_subgroup ? ' in' : '' %>">
|
20
|
-
<%- topic[:topics].each do |subtopic| -%>
|
21
|
-
<%- current_subtopic = current_group && current_subgroup && (subtopic[:id] == topic_id) %>
|
22
|
-
<li><a class="<%= current_subtopic ? ' active' : '' %>" href="<%= subtopic_shim %><%= subtopic[:path] %>"><%= subtopic[:name] %></a></li>
|
23
|
-
<%- end -%>
|
24
|
-
</ul>
|
25
|
-
</li>
|
26
|
-
<%- end -%>
|
27
|
-
<%- end -%>
|
28
|
-
</ul>
|
9
|
+
<ul id="topicGroup-<%= topic_group[:id].hash %>" class="collapse <%= topic_id.start_with?(topic_group[:id]) ? 'in' : '' %> list-unstyled">
|
10
|
+
<%= render("_templates/_nav.html.erb", :navigation => topic_group[:topics], :topic_id => topic_id, :subtopic_shim => subtopic_shim) %>
|
11
|
+
</ul>
|
29
12
|
</li>
|
30
13
|
<%- end -%>
|
31
|
-
|
14
|
+
<%- end -%>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%- navigation.each do |topic_group| -%>
|
2
|
+
<%- if topic_id.start_with?(topic_group[:id]) %>
|
3
|
+
| <%= topic_group[:name] %>
|
4
|
+
<%- end -%>
|
5
|
+
<%- if topic_group.has_key?(:topics) -%>
|
6
|
+
<%= render("_templates/_title.html.erb", :navigation => topic_group[:topics], :topic_id => topic_id) %>
|
7
|
+
<%- end -%>
|
8
|
+
<%- end -%>
|
@@ -4,7 +4,9 @@
|
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
6
6
|
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
7
|
-
<title><%= distro %> <%= version %>
|
7
|
+
<title><%= distro %> <%= version %>
|
8
|
+
<%= render("_templates/_title.html.erb", :navigation => navigation, :topic_id => topic_id) %>
|
9
|
+
</title>
|
8
10
|
|
9
11
|
<!-- Bootstrap -->
|
10
12
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
|
@@ -39,20 +41,13 @@
|
|
39
41
|
<li class="sitename">
|
40
42
|
<a href="<%= site_home_path %>"><%= site_name %></a>
|
41
43
|
</li>
|
42
|
-
|
43
|
-
<%= breadcrumb_root %>
|
44
|
-
</li>
|
45
|
-
<li class="hidden-xs active">
|
46
|
-
<%= breadcrumb_group %>
|
47
|
-
</li>
|
48
|
-
<%= breadcrumb_subgroup_block %>
|
49
|
-
<li class="hidden-xs active">
|
50
|
-
<%= breadcrumb_topic %>
|
51
|
-
</li>
|
44
|
+
<%= render("_templates/_breadcrumb.html.erb", :navigation => navigation, :topic_id => topic_id, :subtopic_shim => subtopic_shim) %>
|
52
45
|
</ol>
|
53
46
|
<div class="row row-offcanvas row-offcanvas-left">
|
54
47
|
<div class="col-xs-8 col-sm-3 col-md-3 sidebar sidebar-offcanvas">
|
55
|
-
|
48
|
+
<ul class="nav nav-sidebar">
|
49
|
+
<%= render("_templates/_nav.html.erb", :navigation => navigation, :topic_id => topic_id, :subtopic_shim => subtopic_shim) %>
|
50
|
+
</ul>
|
56
51
|
</div>
|
57
52
|
<div class="col-xs-12 col-sm-9 col-md-9 main">
|
58
53
|
<div class="page-header">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ascii_binder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.15.
|
4
|
+
version: 0.1.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- N. Harrison Ripps
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2019-09-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -323,8 +323,10 @@ files:
|
|
323
323
|
- templates/_javascripts/.gitkeep
|
324
324
|
- templates/_javascripts/bootstrap-offcanvas.js
|
325
325
|
- templates/_stylesheets/asciibinder.css
|
326
|
+
- templates/_templates/_breadcrumb.html.erb
|
326
327
|
- templates/_templates/_css.html.erb
|
327
328
|
- templates/_templates/_nav.html.erb
|
329
|
+
- templates/_templates/_title.html.erb
|
328
330
|
- templates/_templates/page.html.erb
|
329
331
|
- templates/_topic_map.yml
|
330
332
|
- templates/index-main.html
|
@@ -348,8 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
350
|
- !ruby/object:Gem::Version
|
349
351
|
version: '0'
|
350
352
|
requirements: []
|
351
|
-
|
352
|
-
rubygems_version: 2.7.4
|
353
|
+
rubygems_version: 3.0.3
|
353
354
|
signing_key:
|
354
355
|
specification_version: 4
|
355
356
|
summary: AsciiBinder is an AsciiDoc-based system for authoring and publishing closely
|