asciidoctor-tabs 1.0.0.alpha.3 → 1.0.0.alpha.4
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.adoc +22 -1
- data/README.adoc +4 -1
- data/data/css/tabs.css +6 -3
- data/data/js/tabs.js +1 -1
- data/lib/asciidoctor/tabs/block.rb +2 -1
- data/lib/asciidoctor/tabs/docinfo.rb +6 -8
- data/lib/asciidoctor/tabs/extensions.rb +3 -0
- data/lib/asciidoctor/tabs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e968b72b74144aad60adceb6290712b43017a61b74cc80c73793f474473e59c3
|
4
|
+
data.tar.gz: c7a33865929a61775548be25bda28627c6d9687e68e5d498134d3d87a4eef82b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afdc6a70cec6b9a9519a9f8d72a29e234099ab3b58ed0cceabdcfff3a14574ad905214af88b6c32ffa527994607d30d3ed66403c22f4c60442cd318fd2f9dc7c
|
7
|
+
data.tar.gz: d09843fadb14ddee7d2fa5baf42e0125faeebe6342f7428175100ad7d0401cb6d8693045d51dfe53225e637849cefd15085ca7c7d52ec94f847d3949fc31e2a4
|
data/CHANGELOG.adoc
CHANGED
@@ -4,6 +4,27 @@
|
|
4
4
|
This document provides a curated view of the changes to Asciidoctor Tabs per release.
|
5
5
|
For a detailed view of what has changed, refer to the {url-repo}/commits/main[commit history] on GitHub.
|
6
6
|
|
7
|
+
== 1.0.0-alpha.4 (2022-10-08) - @mojavelinux
|
8
|
+
|
9
|
+
=== Added
|
10
|
+
|
11
|
+
* Define exports for behavior (tabs.js) and style (tabs.css) in npm package
|
12
|
+
|
13
|
+
=== Changed
|
14
|
+
|
15
|
+
* Use value of `idseparator` attribute in front of tabset number in auto-generated ID (#16)
|
16
|
+
* Add aliases for `Block` and `Docinfo` classes to `Extensions` class; remove workaround in js module
|
17
|
+
* Move `margin-bottom` style to tabset element
|
18
|
+
* Move behavior (tabs.js) and style (tabs.css) to dist folder in npm package
|
19
|
+
|
20
|
+
=== Fixed
|
21
|
+
|
22
|
+
* Increase specificity of sibling selector for tab to work with Antora default UI
|
23
|
+
|
24
|
+
=== Details
|
25
|
+
|
26
|
+
{url-repo}/releases/tag/v1.0.0-alpha.4[git tag] | {url-repo}/compare/v1.0.0-alpha.3\...v1.0.0-alpha.4[full diff]
|
27
|
+
|
7
28
|
== 1.0.0-alpha.3 (2022-10-05) - @mojavelinux
|
8
29
|
|
9
30
|
=== Added
|
@@ -18,6 +39,7 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co
|
|
18
39
|
|
19
40
|
=== Fixed
|
20
41
|
|
42
|
+
* Preserve text of dlist item for tab if item has both text and blocks (#13)
|
21
43
|
* Create empty pane instead of crashing if dlist item has term only / no description
|
22
44
|
|
23
45
|
=== Details
|
@@ -40,7 +62,6 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co
|
|
40
62
|
|
41
63
|
=== Fixed
|
42
64
|
|
43
|
-
* Preserve text of dlist item for tab if item has both text and blocks (#13)
|
44
65
|
* Honor explicit ID on tabs block and use it as ID prefix for tabs
|
45
66
|
* Register reference for tabset in document catalog
|
46
67
|
* Autogenerate IDs for tabsets and tabs in a manner consistent with section ID generation (#2)
|
data/README.adoc
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
= Asciidoctor Tabs
|
2
2
|
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>
|
3
|
-
v1.0.0-alpha.
|
3
|
+
v1.0.0-alpha.4, 2022-10-08
|
4
4
|
:idprefix:
|
5
5
|
:idseparator: -
|
6
6
|
ifndef::env-github[:icons: font]
|
7
7
|
ifdef::env-github[]
|
8
8
|
:note-caption: :paperclip:
|
9
|
+
:tip-caption: :bulb:
|
9
10
|
endif::[]
|
10
11
|
|
11
12
|
An Asciidoctor extension that adds a tabs block to the AsciiDoc syntax.
|
@@ -14,6 +15,8 @@ Each set of tabs (a "tabset") is constructed from a dlist enclosed in an example
|
|
14
15
|
NOTE: This extension is intended to be used with HTML backends (e.g., `html`).
|
15
16
|
For other backends (i.e., filetype is not html), the example block enclosure will be taken away and the dlist will be converted normally.
|
16
17
|
|
18
|
+
TIP: This extension is also published as an npm package named `@asciidoctor/tabs` for use with Asciidoctor.js (and thus Antora).
|
19
|
+
|
17
20
|
== Install
|
18
21
|
|
19
22
|
=== Using gem command
|
data/data/css/tabs.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Asciidoctor Tabs
|
1
|
+
/*! Asciidoctor Tabs | Copyright (c) 2018-present Dan Allen | MIT License */
|
2
2
|
.tabs > ul {
|
3
3
|
display: flex;
|
4
4
|
flex-wrap: wrap;
|
@@ -25,10 +25,14 @@
|
|
25
25
|
margin-bottom: 0;
|
26
26
|
}
|
27
27
|
|
28
|
-
.tabs > ul li + li {
|
28
|
+
.tabs > ul li + li[id] {
|
29
29
|
margin-top: 0;
|
30
30
|
}
|
31
31
|
|
32
|
+
.tabset {
|
33
|
+
margin-bottom: 1.25em;
|
34
|
+
}
|
35
|
+
|
32
36
|
.tabset.is-loading .tabs li:not(:first-child),
|
33
37
|
.tabset:not(.is-loading) .tabs li:not(.is-active) {
|
34
38
|
background-color: black;
|
@@ -50,7 +54,6 @@
|
|
50
54
|
.tabset > .content {
|
51
55
|
border: 1px solid gray;
|
52
56
|
padding: 1.25em;
|
53
|
-
margin-bottom: 1.25em;
|
54
57
|
}
|
55
58
|
|
56
59
|
.tabset.is-loading .tab-pane:not(:first-child),
|
data/data/js/tabs.js
CHANGED
@@ -16,7 +16,8 @@ module Asciidoctor
|
|
16
16
|
return source_tabs
|
17
17
|
end
|
18
18
|
tabset_number = doc.counter 'tabset-number'
|
19
|
-
id = attrs['id'] ||
|
19
|
+
id = attrs['id'] ||
|
20
|
+
%(#{doc.attributes['idprefix'] || '_'}tabset#{doc.attributes['idseparator'] || '_'}#{tabset_number})
|
20
21
|
parent << (create_html_fragment parent, %(<div id="#{id}" class="tabset is-loading">))
|
21
22
|
(tabs = create_list parent, :ulist).add_role 'tabs'
|
22
23
|
panes = {}
|
@@ -5,10 +5,8 @@ module Asciidoctor
|
|
5
5
|
module Docinfo
|
6
6
|
if RUBY_ENGINE == 'opal'
|
7
7
|
DATA_DIR = ::File.absolute_path '../data', %x(__dirname)
|
8
|
-
FILE_READ_MODE = 'r'
|
9
8
|
else
|
10
9
|
DATA_DIR = ::File.join (::File.absolute_path '../../..', __dir__), 'data'
|
11
|
-
FILE_READ_MODE = 'rb:utf-8:utf-8'
|
12
10
|
end
|
13
11
|
|
14
12
|
class Styles < ::Asciidoctor::Extensions::DocinfoProcessor
|
@@ -19,10 +17,9 @@ module Asciidoctor
|
|
19
17
|
|
20
18
|
def process doc
|
21
19
|
return unless (path = doc.attr 'tabs-stylesheet')
|
22
|
-
styles = path.empty? ?
|
23
|
-
(
|
24
|
-
(doc.read_contents path, start: (doc.attr 'stylesdir'), warn_on_failure: true, label: 'tabs stylesheet')
|
25
|
-
return unless styles
|
20
|
+
return unless (styles = path.empty? ?
|
21
|
+
(doc.read_asset DEFAULT_STYLESHEET_FILE) :
|
22
|
+
(doc.read_contents path, start: (doc.attr 'stylesdir'), warn_on_failure: true, label: 'tabs stylesheet'))
|
26
23
|
%(<style>\n#{styles.chomp}\n</style>)
|
27
24
|
end
|
28
25
|
end
|
@@ -33,8 +30,9 @@ module Asciidoctor
|
|
33
30
|
|
34
31
|
JAVASCRIPT_FILE = ::File.join DATA_DIR, 'js/tabs.js'
|
35
32
|
|
36
|
-
def process
|
37
|
-
|
33
|
+
def process doc
|
34
|
+
return unless (script = doc.read_asset JAVASCRIPT_FILE)
|
35
|
+
%(<script>\n#{script.chomp}\n</script>)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-tabs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.alpha.
|
4
|
+
version: 1.0.0.alpha.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|