asciidoctor-html 2.1.4 → 2.1.6
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/CHANGELOG.md +11 -0
- data/asciidoctor-html.svg +3 -0
- data/assets/css/styles.css +2 -2
- data/assets/favicon/apple-touch-icon.png +0 -0
- data/assets/favicon/favicon-96x96.png +0 -0
- data/assets/favicon/favicon.ico +0 -0
- data/assets/favicon/favicon.svg +1 -0
- data/assets/favicon/web-app-manifest-192x192.png +0 -0
- data/assets/favicon/web-app-manifest-512x512.png +0 -0
- data/lib/asciidoctor/html/book_template.rb +6 -4
- data/lib/asciidoctor/html/cli.rb +1 -1
- data/lib/asciidoctor/html/converter.rb +14 -5
- data/lib/asciidoctor/html/search.rb +1 -1
- data/lib/asciidoctor/html/subnav_block_macro.rb +1 -1
- data/lib/asciidoctor/html/utils.rb +9 -1
- data/lib/asciidoctor/html/version.rb +1 -1
- data/lib/asciidoctor/html/webmanifest.rb +7 -2
- metadata +6 -5
- data/assets/favicon/android-chrome-192x192.png +0 -0
- data/assets/favicon/android-chrome-512x512.png +0 -0
- data/assets/favicon/favicon-16x16.png +0 -0
- data/assets/favicon/favicon-32x32.png +0 -0
|
Binary file
|
|
Binary file
|
data/assets/favicon/favicon.ico
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35.631 35.631" width="35.631" height="35.631"><metadata><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Description><dc:creator>RealFaviconGenerator</dc:creator><dc:source>https://realfavicongenerator.net</dc:source></rdf:Description></rdf:RDF></metadata><path d="M31.25 102.847 22.278 92.04l8.972-10.597h3.514l-9.007 10.632 9.007 10.773zm5.598-8.424h14.13v2.508h-14.13Zm0-6.464h14.13v2.49h-14.13ZM56.84 102.9h-3.514l8.972-10.826-8.972-10.632h3.514l8.937 10.597z" style="fill:#d63384;stroke-width:.5" transform="matrix(.811 0 0 1.23303 -17.891 -95.835)"></path></svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -186,10 +186,12 @@ module Asciidoctor
|
|
|
186
186
|
#{%(<meta name="description" content="#{opts[:description]}">) if opts[:description]}
|
|
187
187
|
#{%(<meta name="author" content="#{opts[:authors]}">) if opts[:authors]}
|
|
188
188
|
<title>#{opts[:title]}</title>
|
|
189
|
-
<link rel="
|
|
190
|
-
<link rel="icon" type="image/
|
|
191
|
-
<link rel="icon"
|
|
192
|
-
<link rel="
|
|
189
|
+
<link rel="icon" type="image/png" href="#{FAVICON_PATH}/favicon-96x96.png" sizes="96x96" />
|
|
190
|
+
<link rel="icon" type="image/svg+xml" href="#{FAVICON_PATH}/favicon.svg" />
|
|
191
|
+
<link rel="shortcut icon" href="#{FAVICON_PATH}/favicon.ico" />
|
|
192
|
+
<link rel="apple-touch-icon" sizes="180x180" href="#{FAVICON_PATH}/apple-touch-icon.png" />
|
|
193
|
+
<meta name="apple-mobile-web-app-title" content="#{opts[:short_title]}" />
|
|
194
|
+
<link rel="manifest" href="site.webmanifest" />
|
|
193
195
|
<link rel="stylesheet" href="#{CSS_PATH}/styles.css">
|
|
194
196
|
#{highlightjs(opts)}
|
|
195
197
|
<script>
|
data/lib/asciidoctor/html/cli.rb
CHANGED
|
@@ -82,7 +82,7 @@ module Asciidoctor
|
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
def self.generate_webmanifest(outdir, name, short_name)
|
|
85
|
-
filename = "#{outdir}
|
|
85
|
+
filename = "#{outdir}/site.webmanifest"
|
|
86
86
|
puts "Generating\n #{filename}"
|
|
87
87
|
puts
|
|
88
88
|
File.write filename, Webmanifest.generate(name, short_name)
|
|
@@ -38,14 +38,17 @@ module Asciidoctor
|
|
|
38
38
|
document = node.document
|
|
39
39
|
level = node.level
|
|
40
40
|
show_sectnum = node.numbered && level <= (document.attr("sectnumlevels") || 1).to_i
|
|
41
|
-
tag_level = [level == 1 ? level + 1 : level + 2, 6].min
|
|
42
|
-
tag_name = %(h#{tag_level})
|
|
43
41
|
classes = "section#{" flip" if level == 1}#{" #{node.role}" if node.role}"
|
|
44
42
|
display_sectnum = Utils.display_sectnum(node, level) if show_sectnum
|
|
45
|
-
|
|
43
|
+
title = "#{display_sectnum}#{node.title}"
|
|
44
|
+
content = "#{Utils.heading node, title}#{node.content}"
|
|
46
45
|
Utils.wrap_id_classes content, node.id, classes, :section
|
|
47
46
|
end
|
|
48
47
|
|
|
48
|
+
def convert_floating_title(node)
|
|
49
|
+
Utils.heading node, node.title, discrete: true
|
|
50
|
+
end
|
|
51
|
+
|
|
49
52
|
def convert_paragraph(node)
|
|
50
53
|
content = %(<p#{Utils.dyn_id_class_attr_str node, node.role}>#{node.content}</p>\n)
|
|
51
54
|
Utils.wrap_node_with_title content, node
|
|
@@ -81,7 +84,7 @@ module Asciidoctor
|
|
|
81
84
|
|
|
82
85
|
def convert_sidebar(node)
|
|
83
86
|
classes = ["aside", node.role].compact.join(" ")
|
|
84
|
-
title = node.title? ? %(<
|
|
87
|
+
title = node.title? ? %(<h4 class="aside-title">#{node.title}</h4>\n) : ""
|
|
85
88
|
content = "#{title}#{node.content}"
|
|
86
89
|
%(<aside#{Utils.id_class_attr_str node.id, classes}>\n#{content}\n</aside>\n)
|
|
87
90
|
end
|
|
@@ -166,7 +169,13 @@ module Asciidoctor
|
|
|
166
169
|
end
|
|
167
170
|
|
|
168
171
|
def convert_example(node)
|
|
169
|
-
Utils.
|
|
172
|
+
content = Utils.display_title(node) + node.content
|
|
173
|
+
if node.option?("unstyled")
|
|
174
|
+
classes = %(block#{" #{node.role}" if node.role})
|
|
175
|
+
return Utils.wrap_id_classes(content, node.id, classes)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
Utils.wrap_node content, node
|
|
170
179
|
end
|
|
171
180
|
|
|
172
181
|
def convert_image(node)
|
|
@@ -23,7 +23,7 @@ module Asciidoctor
|
|
|
23
23
|
</form>
|
|
24
24
|
</div>
|
|
25
25
|
<div id="search-results-container" class="hidden">
|
|
26
|
-
<
|
|
26
|
+
<h4 class="search-matches-title">Found <span id="search-nmatches">0 matches</span></h4>
|
|
27
27
|
<ul id="search-results" class="search-results list-group list-group-flush"></ul>
|
|
28
28
|
</div>
|
|
29
29
|
HTML
|
|
@@ -14,7 +14,7 @@ module Asciidoctor
|
|
|
14
14
|
|
|
15
15
|
def process(parent, target, attrs)
|
|
16
16
|
doc_key = Pathname(target).sub_ext "" unless target.empty?
|
|
17
|
-
title = %(<
|
|
17
|
+
title = %(<h4 class="block-title">#{parent.apply_subs attrs["title"]}</h4>) if attrs.include?("title")
|
|
18
18
|
bordered_class = " bordered" if attrs.include?("border")
|
|
19
19
|
border_width = attrs["border"].to_i if bordered_class
|
|
20
20
|
style = %( style="border-top-width: #{border_width}px; border-bottom-width: #{border_width}px;") if border_width
|
|
@@ -34,7 +34,7 @@ module Asciidoctor
|
|
|
34
34
|
def self.display_title(node)
|
|
35
35
|
prefix = display_title_prefix node
|
|
36
36
|
suffix = display_title_suffix node
|
|
37
|
-
show_title?(node) ? %(<
|
|
37
|
+
show_title?(node) ? %(<h5 class="block-title">#{prefix}#{node.title}#{suffix}</h5>\n) : ""
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def self.display_title_suffix(node)
|
|
@@ -103,6 +103,14 @@ module Asciidoctor
|
|
|
103
103
|
def self.line_number_attr(line_number, live: false)
|
|
104
104
|
live ? %( data-line-number="#{line_number}") : ""
|
|
105
105
|
end
|
|
106
|
+
|
|
107
|
+
def self.heading(node, title, discrete: false)
|
|
108
|
+
level = node.level
|
|
109
|
+
tag_level = [level + 1, 6].min
|
|
110
|
+
tag_name = %(h#{tag_level})
|
|
111
|
+
classes = %( class="#{node.role}") if discrete && node.role
|
|
112
|
+
%(<#{tag_name}#{classes}>#{title}</#{tag_name}>\n)
|
|
113
|
+
end
|
|
106
114
|
end
|
|
107
115
|
end
|
|
108
116
|
end
|
|
@@ -4,14 +4,19 @@ require "json"
|
|
|
4
4
|
|
|
5
5
|
module Asciidoctor
|
|
6
6
|
module Html
|
|
7
|
-
# Generates the site.webmanifest
|
|
7
|
+
# Generates the site.webmanifest
|
|
8
8
|
module Webmanifest
|
|
9
9
|
def self.generate(name, short_name)
|
|
10
10
|
{
|
|
11
11
|
name:,
|
|
12
12
|
short_name:,
|
|
13
13
|
icons: %w[192x192 512x512].map do |sizes|
|
|
14
|
-
{
|
|
14
|
+
{
|
|
15
|
+
src: "#{FAVICON_PATH}/web-app-manifest-#{sizes}.png",
|
|
16
|
+
sizes:,
|
|
17
|
+
type: "image/png",
|
|
18
|
+
purpose: "maskable"
|
|
19
|
+
}
|
|
15
20
|
end,
|
|
16
21
|
theme_color: "#ffffff",
|
|
17
22
|
background_color: "#ffffff",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: asciidoctor-html
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ravi Rajani
|
|
@@ -94,16 +94,17 @@ files:
|
|
|
94
94
|
- LICENSE.txt
|
|
95
95
|
- README.md
|
|
96
96
|
- Rakefile
|
|
97
|
+
- asciidoctor-html.svg
|
|
97
98
|
- assets/css/fonts/bootstrap-icons.woff
|
|
98
99
|
- assets/css/fonts/bootstrap-icons.woff2
|
|
99
100
|
- assets/css/jupyterlite.css
|
|
100
101
|
- assets/css/styles.css
|
|
101
|
-
- assets/favicon/android-chrome-192x192.png
|
|
102
|
-
- assets/favicon/android-chrome-512x512.png
|
|
103
102
|
- assets/favicon/apple-touch-icon.png
|
|
104
|
-
- assets/favicon/favicon-
|
|
105
|
-
- assets/favicon/favicon-32x32.png
|
|
103
|
+
- assets/favicon/favicon-96x96.png
|
|
106
104
|
- assets/favicon/favicon.ico
|
|
105
|
+
- assets/favicon/favicon.svg
|
|
106
|
+
- assets/favicon/web-app-manifest-192x192.png
|
|
107
|
+
- assets/favicon/web-app-manifest-512x512.png
|
|
107
108
|
- exe/adoctohtml
|
|
108
109
|
- exe/build-jupyterlite
|
|
109
110
|
- jupyterlite/.gitignore
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|