Skip to content

Commit 5298363

Browse files
mojavelinuxosfameron
authored andcommitted
upgrade UI preview to Asciidoctor.js 2
1 parent 99bafcf commit 5298363

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

gulp.d/tasks/build-preview-pages.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
'use strict'
22

3-
// NOTE remove patch after upgrading from asciidoctor.js to @asciidoctor/core
4-
Error.call = (self, ...args) => {
5-
const err = new Error(...args)
6-
return Object.assign(self, { message: err.message, stack: err.stack })
7-
}
8-
9-
const asciidoctor = require('asciidoctor.js')()
3+
const Asciidoctor = require('@asciidoctor/core')()
104
const File = require('vinyl')
115
const fs = require('fs-extra')
126
const handlebars = require('handlebars')
@@ -84,7 +78,7 @@ module.exports =
8478
uiModel.page = { layout: '404', title: 'Page Not Found' }
8579
} else {
8680
const pageModel = (uiModel.page = { ...uiModel.page })
87-
const doc = asciidoctor.load(file.contents, { safe: 'safe', attributes: ASCIIDOC_ATTRIBUTES })
81+
const doc = Asciidoctor.load(file.contents, { safe: 'safe', attributes: ASCIIDOC_ATTRIBUTES })
8882
const attributes = doc.getAttributes()
8983
pageModel.layout = doc.getAttribute('page-layout', 'default')
9084
pageModel.title = doc.getDocumentTitle()

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@fortawesome/free-regular-svg-icons": "~5.13",
2121
"@fortawesome/free-solid-svg-icons": "~5.13",
2222
"@octokit/rest": "~18.0",
23-
"asciidoctor.js": "1.5.9",
23+
"@asciidoctor/core": "~2.2",
2424
"autoprefixer": "~9.8",
2525
"browser-pack-flat": "~3.4",
2626
"browserify": "~16.5",

preview-src/index.adoc

+14-14
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ From the menu:Couchbase Web Console[Buckets] menu, click the menu:Statistics[] l
2222

2323
.Here is some {sqlpp}
2424
====
25-
[source,sqlpp]
25+
[,sqlpp]
2626
----
2727
SELECT * FROM `travel-sample` WHERE type = "airline" LIMIT 1;
2828
CREATE PRIMARY INDEX ON `users` WITH {"defer_build": true};
@@ -32,7 +32,7 @@ BUILD INDEX ON `users`(`#primary`, `ix_name`, `ix_email`);
3232

3333
.Here is some W3 Extended Backus-Naur Format
3434
====
35-
[source,ebnf]
35+
[,ebnf]
3636
----
3737
index-pair ::= '"' 'indexes' '"' ':' ( 'null'
3838
| '"' index '"'
@@ -60,7 +60,7 @@ Then click the image:arrow-small-down.svg[,16,role=icon]image:arrow-small-up.svg
6060

6161
This section demonstrates the interactive, try it now feature of the docs.
6262

63-
[source.try-it,ruby]
63+
[.try-it,ruby]
6464
----
6565
require 'couchbase'
6666
@@ -79,7 +79,7 @@ rescue Couchbase::Error::DocumentNotFound
7979
end
8080
----
8181

82-
[source.try-it,java]
82+
[.try-it,java]
8383
----
8484
import com.couchbase.client.core.error.DocumentNotFoundException;
8585
import com.couchbase.client.java.*;
@@ -362,19 +362,19 @@ With the stream-based views, data returned when `stale` is set to `ok` is closer
362362
The *Server Resources* statistics section displays the resource information on this server including swap usage, free RAM, CPU utilization percentage,and FTS RAM used.
363363

364364
.A query using the fluent API (lines are forced to wrap)
365-
[source,java]
365+
[,java]
366366
----
367367
[data-source-url=https://github.com/couchbase/docs-sdk-java/blob/20c44c9e7ca86ea475b7aa33c58d5670aa7c4495/modules/ROOT/pages/n1ql-queries-with-sdk.adoc#L53-L58]
368-
Statement statement = select("fname", "lname", "age").from(i("default")).where(x("age").gt(x("$age"))); // <1>
368+
Statement statement = select("fname", "lname", "age").from(i("default")).where(x("age").gt(x("$age"))); // <.>
369369
JsonObject placeholderValues = JsonObject.create().put("age", 22);
370-
q = N1qlQuery.parameterized(statement, placeholderValues); // <2>
371-
for (N1qlQueryRow row : bkt.query(q)) { // <3>
370+
q = N1qlQuery.parameterized(statement, placeholderValues); // <.>
371+
for (N1qlQueryRow row : bkt.query(q)) { // <.>
372372
System.out.println(row);
373373
}
374374
----
375-
<1> Defines the query.
376-
<2> Inserts placeholder values into the query.
377-
<3> Runs the query.
375+
<.> Defines the query.
376+
<.> Inserts placeholder values into the query.
377+
<.> Runs the query.
378378

379379
[#vbucket-stats]
380380
== Monitoring `vBucket` Resources
@@ -501,7 +501,7 @@ POST http://nodename:8091/settings/viewUpdateDaemon
501501
updateInterval=10000&updateMinChanges=7000
502502
----
503503

504-
[source,json5, role="no-callouts"]
504+
[.no-callouts,json5]
505505
----
506506
{
507507
"_id": "_design/myddoc",
@@ -521,7 +521,7 @@ updateInterval=10000&updateMinChanges=7000
521521
You can set this information when creating and updating design documents through the design document REST API.
522522
To perform this operation using the `curl` tool:
523523

524-
[source,console]
524+
[,console]
525525
----
526526
$ curl -X POST -v -d 'updateInterval=7000&updateMinChanges=7000' \
527527
'http://Administrator:[email protected]:8091/settings/viewUpdateDaemon'
@@ -539,7 +539,7 @@ Issues resolved in this release:
539539
* https://issues.couchbase.com/browse/KAFKAC-82[KAFKAC-82]: [FEATURE] Implement log redaction for Kafka Connector
540540
* https://issues.couchbase.com/browse/KAFKAC-90[KAFKAC-90]: [FEATURE] Source: Add config settings to enable compression
541541

542-
[source,xml]
542+
[,xml]
543543
----
544544
<dependency>
545545
<groupId>com.couchbase.client</groupId>

0 commit comments

Comments
 (0)