asciidoctor-html 2.2.1 → 2.2.2
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 +5 -0
- data/assets/css/jupyterlite-repl.css +1 -1
- data/assets/css/styles.css +2 -2
- data/lib/asciidoctor/html/book.rb +0 -2
- data/lib/asciidoctor/html/flip.rb +0 -21
- data/lib/asciidoctor/html/version.rb +1 -1
- metadata +2 -3
- data/lib/asciidoctor/html/reuse_block_macro.rb +0 -39
|
@@ -9,7 +9,6 @@ require_relative "cref_inline_macro"
|
|
|
9
9
|
require_relative "bi_inline_macro"
|
|
10
10
|
require_relative "text_inline_macro"
|
|
11
11
|
require_relative "subnav_block_macro"
|
|
12
|
-
require_relative "reuse_block_macro"
|
|
13
12
|
require_relative "book_template"
|
|
14
13
|
require_relative "pagination"
|
|
15
14
|
require_relative "search"
|
|
@@ -28,7 +27,6 @@ module Asciidoctor
|
|
|
28
27
|
inline_macro TextInlineMacro
|
|
29
28
|
inline_macro BiInlineMacro
|
|
30
29
|
block_macro SubnavBlockMacro
|
|
31
|
-
block_macro ReuseBlockMacro
|
|
32
30
|
end
|
|
33
31
|
|
|
34
32
|
DOCATTRS = {
|
|
@@ -92,25 +92,6 @@ module Asciidoctor
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
function reuseElements() {
|
|
96
|
-
focusEl.querySelectorAll(':scope > .flip.d-block .reuse').forEach(target => {
|
|
97
|
-
const link = target && target.querySelector('a.reuse-link');
|
|
98
|
-
if(!link) return;
|
|
99
|
-
|
|
100
|
-
const source = document.getElementById(link.hash.substring(1));
|
|
101
|
-
let reuse = source && source.parentElement;
|
|
102
|
-
if(!reuse) return;
|
|
103
|
-
|
|
104
|
-
if(!reuse.classList.contains('reuse')) {
|
|
105
|
-
reuse = document.createElement('div');
|
|
106
|
-
reuse.classList.add('reuse');
|
|
107
|
-
source.replaceWith(reuse);
|
|
108
|
-
}
|
|
109
|
-
reuse.replaceChildren(...target.children);
|
|
110
|
-
target.replaceChildren(source);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
95
|
function flip(e) {
|
|
115
96
|
if(!page.classList.contains('multi')) {
|
|
116
97
|
focusOnLoad();
|
|
@@ -147,8 +128,6 @@ module Asciidoctor
|
|
|
147
128
|
}
|
|
148
129
|
}
|
|
149
130
|
|
|
150
|
-
reuseElements();
|
|
151
|
-
|
|
152
131
|
nav.forEach(el => {
|
|
153
132
|
const a = el.querySelector('a');
|
|
154
133
|
a && a.hash && el.classList.toggle('active', id == a.hash.substring(1));
|
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.2.
|
|
4
|
+
version: 2.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ravi Rajani
|
|
@@ -126,7 +126,6 @@ files:
|
|
|
126
126
|
- lib/asciidoctor/html/pagination.rb
|
|
127
127
|
- lib/asciidoctor/html/popovers.rb
|
|
128
128
|
- lib/asciidoctor/html/ref_tree_processor.rb
|
|
129
|
-
- lib/asciidoctor/html/reuse_block_macro.rb
|
|
130
129
|
- lib/asciidoctor/html/scroll.rb
|
|
131
130
|
- lib/asciidoctor/html/search.rb
|
|
132
131
|
- lib/asciidoctor/html/sidebar.rb
|
|
@@ -161,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
160
|
- !ruby/object:Gem::Version
|
|
162
161
|
version: '0'
|
|
163
162
|
requirements: []
|
|
164
|
-
rubygems_version: 3.6.
|
|
163
|
+
rubygems_version: 3.6.9
|
|
165
164
|
specification_version: 4
|
|
166
165
|
summary: An AsciiDoc-to-HTML static site generator based on Asciidoctor.
|
|
167
166
|
test_files: []
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "asciidoctor"
|
|
4
|
-
require_relative "utils"
|
|
5
|
-
|
|
6
|
-
module Asciidoctor
|
|
7
|
-
module Html
|
|
8
|
-
# Reuse blocks, especially useful in multi mode
|
|
9
|
-
class ReuseBlockMacro < Asciidoctor::Extensions::BlockMacroProcessor
|
|
10
|
-
use_dsl
|
|
11
|
-
|
|
12
|
-
named :reuse
|
|
13
|
-
name_positional_attributes "reftext"
|
|
14
|
-
|
|
15
|
-
def process(parent, target, attrs)
|
|
16
|
-
if target.empty?
|
|
17
|
-
content = Utils.show_error "Missing target."
|
|
18
|
-
else
|
|
19
|
-
el = parent.document.catalog[:refs][target]
|
|
20
|
-
reftext = el && (attrs["reftext"] || Utils.reftext(el))
|
|
21
|
-
title = %(<div class="block-title">#{parent.apply_subs attrs["title"]}</div>) if attrs.include?("title")
|
|
22
|
-
content = if reftext
|
|
23
|
-
id = %( id="#{attrs["id"]}") if attrs.include?("id")
|
|
24
|
-
classes = %( #{attrs["role"]}) if attrs.include?("role")
|
|
25
|
-
<<~HTML
|
|
26
|
-
<div#{id} class="reuse#{classes}">
|
|
27
|
-
#{title}
|
|
28
|
-
<p><a class="reuse-link" href="##{target}">#{reftext}</a></p>
|
|
29
|
-
</div>
|
|
30
|
-
HTML
|
|
31
|
-
else
|
|
32
|
-
Utils.show_error "Invalid ID."
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
create_pass_block parent, content, attrs, subs: nil
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|