Skip to content

Commit 6658d6d

Browse files
josuebranYosoyfr
andauthored
asciidoctor-tabs extension (#81)
* Add asciidocs-tabs extension * Dark mode for tabs * install gcx/styles modules * Dark mode updates * Fix dependency --------- Co-authored-by: Francisco Suarez <[email protected]>
1 parent 561b53c commit 6658d6d

File tree

9 files changed

+394
-234
lines changed

9 files changed

+394
-234
lines changed

gcx/gulpfile.js

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,132 @@
1-
const { src, dest, series, parallel } = require('gulp');
2-
const concat = require('gulp-concat');
3-
var clean = require('gulp-clean');
4-
const zip = require('gulp-zip');
5-
const unzip = require('gulp-unzip');
1+
const { src, dest, series, parallel } = require('gulp')
2+
const concat = require('gulp-concat')
3+
var clean = require('gulp-clean')
4+
const zip = require('gulp-zip')
5+
const unzip = require('gulp-unzip')
66

77
// cleans up the tempBuild folder
88
const cleanTempBuild = () => {
9-
return src('tempBuild', { read: false, allowEmpty: true })
10-
.pipe(clean());
9+
return src('tempBuild', { read: false, allowEmpty: true })
10+
.pipe(clean())
1111
}
1212

1313
// cleans up the ui-bundle folder
1414
const cleanUiBuild = () => {
15-
return src('build/*', { read: false, allowEmpty: true })
16-
.pipe(clean());
15+
return src('build/*', { read: false, allowEmpty: true })
16+
.pipe(clean())
1717
}
1818

1919
// unzips the antora ui-bundle into the tempBuild folder
2020
const unzipBundle = () => {
21-
return src('../build/ui-bundle.zip')
22-
.pipe(unzip())
23-
.pipe(dest('./tempBuild'));
24-
};
21+
return src('../build/ui-bundle.zip')
22+
.pipe(unzip())
23+
.pipe(dest('./tempBuild'))
24+
}
2525

2626
const cleanImg = () => {
27-
return src('tempBuild/img', { read: false, allowEmpty: true })
28-
.pipe(clean());
27+
return src('tempBuild/img', { read: false, allowEmpty: true })
28+
.pipe(clean())
2929
}
3030

3131
const cleanHBLayouts = () => {
32-
return src(['tempBuild/layouts','tempBuild/partials'],{read:false,allowEmpty:true})
33-
.pipe(clean());
32+
return src(['tempBuild/layouts', 'tempBuild/partials'], { read: false, allowEmpty: true })
33+
.pipe(clean())
3434
}
3535

3636
const cleanBuild = () => {
37-
return src('styles/build',{read:false,allowEmpty:true})
38-
.pipe(clean());
37+
return src('styles/build', { read: false, allowEmpty: true })
38+
.pipe(clean())
3939
}
4040

41+
// eslint-disable-next-line no-unused-vars
4142
const bundleJSsrc = () =>
42-
src('styles/src/js/*.js')
43+
src('styles/src/js/*.js')
4344
.pipe(concat('site.js'))
44-
.pipe(dest('styles/build/js'));
45+
.pipe(dest('styles/build/js'))
4546

4647
// Bundle a site.js for the 404 error page, excluding 01-nav.js
47-
const bundleJS404 = () =>{
48-
return src(['styles/src/js/*.js','!styles/src/js/01-nav.js', '!styles/src/js/08-gcx-helios.js'])
48+
const bundleJS404 = () => {
49+
return src(['styles/src/js/*.js', '!styles/src/js/01-nav.js', '!styles/src/js/08-gcx-helios.js'])
4950
.pipe(concat('site404.js'))
50-
.pipe(dest('build/js'));
51+
.pipe(dest('build/js'))
5152
}
5253

53-
54-
5554
const mergeJS = () => {
56-
return src(['tempBuild/js/site.js',
55+
return src(['tempBuild/js/site.js',
56+
'node_modules/@asciidoctor/tabs/dist/js/tabs.js',
5757
'node_modules/swiper/swiper-bundle.min.js',
5858
'styles/src/js/06-tabs-block.js',
5959
'styles/src/js/07-copy-to-clipboard.js',
60-
'styles/src/js/08-gcx-helios.js',])
60+
'styles/src/js/08-gcx-helios.js'])
6161
.pipe(concat('site.js'))
62-
.pipe(dest('build/js'));
62+
.pipe(dest('build/js'))
6363
}
6464

65-
6665
const bundleJShelpers = () => {
67-
return src([
68-
'../src/helpers/**/*.js',
69-
], {base: '../src/'})
70-
.pipe(dest('build/'));
66+
return src([
67+
'../src/helpers/**/*.js',
68+
], { base: '../src/' })
69+
.pipe(dest('build/'))
7170
}
7271

7372
const bundleStencil = () => {
74-
return src([
75-
'styles/src/js/vendor/**/*.js',
76-
], {base: 'styles/src/'})
77-
.pipe(dest('build/'));
73+
return src([
74+
'styles/src/js/vendor/**/*.js',
75+
], { base: 'styles/src/' })
76+
.pipe(dest('build/'))
7877
}
7978

8079
const cleanHighlight = () => {
81-
return src('build/js/vendor/highlight.bundle.js')
82-
.pipe(clean({force:true}))
80+
return src('build/js/vendor/highlight.bundle.js')
81+
.pipe(clean({ force: true }))
8382
}
8483

8584
const cleanCSS = () => {
86-
return src('build/css/site.css',{force:true,allowEmpty:true})
85+
return src('build/css/site.css', { force: true, allowEmpty: true })
8786
.pipe(clean())
8887
}
8988

9089
const bundleCSS = () =>
91-
src(['styles/src/css/**/*.css','!styles/src/css/**/helios-gcx.css','!styles/src/css/**/highlight.css'])
90+
src(['styles/src/css/**/*.css', '!styles/src/css/**/helios-gcx.css', '!styles/src/css/**/highlight.css'])
9291
.pipe(concat('siteTemp.css'))
93-
.pipe(dest('styles/build/css'));
92+
.pipe(dest('styles/build/css'))
9493

9594
const bundleHeliosCSS = () =>
96-
src(['styles/build/css/siteTemp.css',
95+
src(['styles/build/css/siteTemp.css',
9796
'styles/src/css/helios-gcx-*.css'])
9897
.pipe(concat('site.css'))
99-
.pipe(dest('build/css'));
98+
.pipe(dest('build/css'))
10099

101100
const bundleHB = () => {
102-
return src([
103-
'styles/src/layouts/**/*.hbs',
104-
'styles/src/partials/**/*.hbs'
105-
], {base: 'styles/src/'})
106-
.pipe(dest('build/'));
101+
return src([
102+
'styles/src/layouts/**/*.hbs',
103+
'styles/src/partials/**/*.hbs',
104+
], { base: 'styles/src/' })
105+
.pipe(dest('build/'))
107106
}
108107

109108
const bundleImg = () => {
110-
return src([
111-
'styles/src/img/**/*.*'
112-
], {base: 'styles/src/'})
113-
.pipe(dest('build/'));
109+
return src([
110+
'styles/src/img/**/*.*',
111+
], { base: 'styles/src/' })
112+
.pipe(dest('build/'))
114113
}
115114

116115
const zipBundle = () => {
117-
return src('build/**/*.*')
116+
return src('build/**/*.*')
118117
.pipe(zip('ui-bundle.zip'))
119-
.pipe(dest('build/'));
118+
.pipe(dest('build/'))
120119
}
121120

122121
const cleanHeliosBuild = () => {
123-
return src(['build/css',
122+
return src(['build/css',
124123
'build/helpers',
125124
'build/img',
126125
'build/js',
127126
'build/layouts',
128-
'build/partials'],{read:false,allowEmpty:true})
129-
.pipe(clean());
127+
'build/partials'], { read: false, allowEmpty: true })
128+
.pipe(clean())
130129
}
131130

132-
exports.bundle = series(cleanTempBuild,cleanUiBuild,unzipBundle,cleanImg,cleanHBLayouts,cleanBuild,cleanCSS,bundleCSS,bundleHeliosCSS, parallel(bundleStencil),bundleJS404, bundleJShelpers, mergeJS, cleanHighlight, bundleHB, bundleImg, zipBundle, cleanTempBuild, cleanHeliosBuild);
131+
// eslint-disable-next-line max-len
132+
exports.bundle = series(cleanTempBuild, cleanUiBuild, unzipBundle, cleanImg, cleanHBLayouts, cleanBuild, cleanCSS, bundleCSS, bundleHeliosCSS, parallel(bundleStencil), bundleJS404, bundleJShelpers, mergeJS, cleanHighlight, bundleHB, bundleImg, zipBundle, cleanTempBuild, cleanHeliosBuild)

gcx/package-lock.json

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

gcx/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"author": "",
1111
"license": "ISC",
1212
"devDependencies": {
13+
"@asciidoctor/core": "~2.2",
14+
"@asciidoctor/tabs": "1.0.0-beta.5",
1315
"gulp": "^4.0.2",
1416
"gulp-clean": "^0.4.0",
1517
"gulp-concat": "^2.6.1",

0 commit comments

Comments
 (0)