Skip to content

Commit 5948f5d

Browse files
asciidoctor tab extension (#25)
* integrate Asciidoctor Tabs * add tabs styles * update asciidoctor-tabs dependency --------- Co-authored-by: Dan Allen <[email protected]>
1 parent b60b172 commit 5948f5d

File tree

9 files changed

+97
-1
lines changed

9 files changed

+97
-1
lines changed

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@fontsource/material-icons-outlined": "~5.0",
2020
"@fontsource/roboto-flex": "~5.0",
2121
"@fontsource/roboto-mono": "~5.0",
22+
"@asciidoctor/tabs": "1.0.0-beta.6",
2223
"autoprefixer": "~9.7",
2324
"browser-pack-flat": "~3.4",
2425
"browserify": "~16.5",

preview-src/index.adoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,24 @@ Contains more than one block.
455455

456456
=== Example: Overflow tabset
457457

458-
[tabs]
458+
[tabs.overflow]
459+
======
460+
Tab Name:: Contents of Tab.
461+
462+
Longer Tab Name::
463+
+
464+
Contents of Longer Tab.
465+
466+
An Even Longer Tab Name::
467+
+
468+
Contents of Even Longer Tab.
469+
470+
This Is The Longest Tab Name::
471+
+
472+
Contents of The Longest Tab.
473+
======
474+
475+
[tabs.wrapping]
459476
======
460477
Tab Name:: Contents of Tab.
461478

preview-src/tux.png

21.6 KB
Loading

preview-src/ui-model.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
antoraVersion: '1.0.0'
2+
asciidoc:
3+
extensions:
4+
- '@asciidoctor/tabs'
25
site:
36
url: http://localhost:5252
47
title: Brand Docs

src/css/vendor/tabs.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
@import "@asciidoctor/tabs";
2+
3+
/* Datastax styles */
4+
5+
.tabpanel {
6+
padding: var(--ds-space-2) 0;
7+
border: none;
8+
border-top: 1px solid var(--ds-divider);
9+
}
10+
11+
.tablist > ul li {
12+
background-color: transparent;
13+
border: none;
14+
font-weight: normal;
15+
color: var(--ds-text-primary);
16+
padding: var(--ds-space-1) var(--ds-space-1h);
17+
}
18+
19+
.tablist.ulist > ul li + li {
20+
margin: 0;
21+
}
22+
23+
.tabs .tablist li::after {
24+
height: calc(2 / var(--rem-base) * 1rem);
25+
}
26+
27+
.tabs.is-loading .tablist li:not(:first-child),
28+
.tabs:not(.is-loading) .tablist li:not(.is-selected) {
29+
color: var(--ds-text-tertiary);
30+
background-color: transparent;
31+
}
32+
33+
.tabs.is-loading .tablist li:first-child::after,
34+
.tabs:not(.is-loading) .tablist li.is-selected::after {
35+
background-color: var(--ds-text-primary);
36+
}
37+
38+
/* overflow tab title */
39+
.tabs.overflow .tablist > ul li p {
40+
max-width: var(--ds-space-15);
41+
overflow: hidden;
42+
display: -webkit-box;
43+
-webkit-box-orient: vertical;
44+
-webkit-line-clamp: 1;
45+
}
46+
47+
/* wrapping tab title */
48+
.tabs.wrapping .tablist > ul li p {
49+
max-width: var(--ds-space-15);
50+
display: flex;
51+
}
52+
53+
.tabs.overflow .tablist > ul,
54+
.tabs.wrapping .tablist > ul {
55+
flex-wrap: nowrap;
56+
}

src/js/vendor/tabs.bundle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('@asciidoctor/tabs')

src/partials/footer-scripts.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script id="site-script" src="{{{uiRootPath}}}/js/site.js" data-ui-root-path="{{{uiRootPath}}}"></script>
2+
<script async src="{{{uiRootPath}}}/js/vendor/tabs.js"></script>
23
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
34

45
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>

src/partials/head-styles.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
<link rel="stylesheet" href="{{{uiRootPath}}}/css/site.css">
2+
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/tabs.css">

0 commit comments

Comments
 (0)