'use strict'
-// NOTE remove patch after upgrading from asciidoctor.js to @asciidoctor/core
-Error.call = (self, ...args) => {
- const err = new Error(...args)
- return Object.assign(self, { message: err.message, stack: err.stack })
-}
-
-const asciidoctor = require('asciidoctor.js')()
+const Asciidoctor = require('@asciidoctor/core')()
const fs = require('fs-extra')
const handlebars = require('handlebars')
const merge = require('merge-stream')
if (file.stem === '404') {
uiModel.page = { layout: '404', title: 'Page Not Found' }
} else {
- const doc = asciidoctor.load(file.contents, { safe: 'safe', attributes: ASCIIDOC_ATTRIBUTES })
+ const doc = Asciidoctor.load(file.contents, { safe: 'safe', attributes: ASCIIDOC_ATTRIBUTES })
uiModel.page.attributes = Object.entries(doc.getAttributes())
.filter(([name, val]) => name.startsWith('page-'))
.reduce((accum, [name, val]) => {
"requires": true,
"lockfileVersion": 1,
"dependencies": {
+ "@asciidoctor/core": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/@asciidoctor/core/-/core-2.2.5.tgz",
+ "integrity": "sha512-jtQPQ5EivgFbwvSyGKas4ANnMGGHPbmu791H9xrZKooA65JNI30jM2em5MvUXTTetSPgb6saUf+PJibEuSB6uw==",
+ "dev": true,
+ "requires": {
+ "asciidoctor-opal-runtime": "0.3.3",
+ "unxhr": "1.0.1"
+ }
+ },
"@babel/code-frame": {
"version": "7.14.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz",
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
"dev": true
},
- "asciidoctor.js": {
- "version": "1.5.9",
- "resolved": "https://registry.npmjs.org/asciidoctor.js/-/asciidoctor.js-1.5.9.tgz",
- "integrity": "sha512-k5JgwyV82TsiCpnYbDPReuHhzf/vRUt6NaZ+OGywkDDGeGG/CPfvN2Gd1MJ0iIZKDyuk4iJHOdY/2x1KBrWMzA==",
+ "asciidoctor-opal-runtime": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/asciidoctor-opal-runtime/-/asciidoctor-opal-runtime-0.3.3.tgz",
+ "integrity": "sha512-/CEVNiOia8E5BMO9FLooo+Kv18K4+4JBFRJp8vUy/N5dMRAg+fRNV4HA+o6aoSC79jVU/aT5XvUpxSxSsTS8FQ==",
"dev": true,
"requires": {
- "opal-runtime": "1.0.11"
+ "glob": "7.1.3",
+ "unxhr": "1.0.1"
+ },
+ "dependencies": {
+ "glob": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
+ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ }
}
},
"asn1.js": {
}
}
},
- "glob": {
- "version": "6.0.4",
- "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
- "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=",
- "dev": true,
- "requires": {
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "2 || 3",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
"glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"mimic-fn": "^2.1.0"
}
},
- "opal-runtime": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/opal-runtime/-/opal-runtime-1.0.11.tgz",
- "integrity": "sha512-L+6pnRvXPlDtbamBRnJAnB9mEMXmsIQ/b+0r/2xJ5/n/nxheEkLo+Pm5QNQ08LEbEN9TI6/kedhIspqRRu6tXA==",
- "dev": true,
- "requires": {
- "glob": "6.0.4",
- "xmlhttprequest": "1.8.0"
- }
- },
"optionator": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
}
}
},
+ "unxhr": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/unxhr/-/unxhr-1.0.1.tgz",
+ "integrity": "sha512-MAhukhVHyaLGDjyDYhy8gVjWJyhTECCdNsLwlMoGFoNJ3o79fpQhtQuzmAE4IxCMDwraF4cW8ZjpAV0m9CRQbg==",
+ "dev": true
+ },
"upath": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
"typedarray-to-buffer": "^3.1.5"
}
},
- "xmlhttprequest": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
- "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=",
- "dev": true
- },
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"last 2 versions"
],
"devDependencies": {
- "asciidoctor.js": "1.5.9",
+ "@asciidoctor/core": "~2.2",
"autoprefixer": "~9.7",
"browser-pack-flat": "~3.4",
"browserify": "~16.5",
Eum an doctus <<liber-recusabo,maiestatis efficiantur>>.
Eu mea inani iriure.footnote:[Quisque porta facilisis tortor, vitae bibendum velit fringilla vitae! Lorem ipsum dolor sit amet, consectetur adipiscing elit.]
-[source,json]
+[,json]
----
{
"name": "module-name",
----
.Example paragraph syntax
-[source,asciidoc]
+[,asciidoc]
----
.Optional title
[example]
[example]
This is an example paragraph.
-++++
-<details>
-<summary class="title">Summary</summary>
-<div class="content">
-<div class="paragraph">
-<p>Details</p>
-</div>
-<details class="result">
-<summary class="title">Summary</summary>
-<div class="content">
-<div class="paragraph">
-<p>Details</p>
-</div>
-</div>
-</details>
-</div>
-</details>
-++++
+.Summary *Spoiler Alert!*
+[%collapsible]
+====
+Details.
+
+Loads of details.
+====
+
+[,asciidoc]
+----
+Voila!
+----
+
+.Result
+[%collapsible.result]
+====
+Voila!
+====
=== Some Code
How about some code?
-[source,js]
+[,js]
----
vfs
.src('js/vendor/*.js', { cwd: 'src', cwdbase: true, read: false })
- .pipe(tap((file) => { // <1>
+ .pipe(tap((file) => { // <.>
file.contents = browserify(file.relative, { basedir: 'src', detectGlobals: false }).bundle()
}))
- .pipe(buffer()) // <2>
+ .pipe(buffer()) // <.>
.pipe(uglify())
.pipe(gulp.dest('build'))
----
-<1> The `tap` function is used to wiretap the data in the pipe.
-<2> Wrap each streaming file in a buffer so the files can be processed by uglify.
+<.> The `tap` function is used to wiretap the data in the pipe.
+<.> Wrap each streaming file in a buffer so the files can be processed by uglify.
Uglify can only work with buffers, not streams.
Execute these commands to validate and build your site:
l|foo
bar
a|
-[source,ruby]
+[,ruby]
----
puts "foo\nbar"
----
Eos suscipit scaevola at.
****
+[.rolename]
=== Liber recusabo
No sea, at invenire voluptaria mnesarchum has.
Altera atomorum his ex, has cu elitr melius propriae.
Eos suscipit scaevola at.
-[, 'Famous Person. Cum dicat putant ne.', 'Cum dicat putant ne. https://example.com[Famous Person Website]']
+[,'Famous Person. Cum dicat putant ne.','Cum dicat putant ne. https://example.com[Famous Person Website]']
____
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Mauris eget leo nunc, nec tempus mi? Curabitur id nisl mi, ut vulputate urna.