asciidoctor-interdoc-reftext 0.3.0 → 0.4.0
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/README.adoc +33 -2
- data/lib/asciidoctor/interdoc_reftext.rb +7 -4
- data/lib/asciidoctor/interdoc_reftext/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: 56ea4590d0248f86318077efc14189c789e881dad32a862e12eb7fe509ca6b3c
|
4
|
+
data.tar.gz: bbd598ecf9ad35e2500299add61b55482da3e767c041f179b59abd8c9d858705
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c620dc7f8d9ec2848a76916bae54feeeba6f651cf4992830da2b59fdcd02833f37d5ddcf55ad95bcf8c0885f1fa27ffee90f9227de310f80841ad39cd9f980d2
|
7
|
+
data.tar.gz: f5180bb615e0b28f65b157c14859988ad0526fd771bcb8b4675a80be29bc94afe40ecd7d9f27ca3cc43235ccbe451d7313c08745e1bfa7ee57f4c8720afb8317
|
data/README.adoc
CHANGED
@@ -109,11 +109,42 @@ IMPORTANT: Bundler automatically _requires_ all the specified gems.
|
|
109
109
|
----
|
110
110
|
// Load asciidoctor.js and {gem-name}.
|
111
111
|
const asciidoctor = require('asciidoctor.js')()
|
112
|
-
require('{gem-name}')
|
112
|
+
const interdocReftextExt = require('{gem-name}')
|
113
|
+
|
114
|
+
// See documentation at the end of this section.
|
115
|
+
const options = {
|
116
|
+
asciidocExts: ['.adoc'],
|
117
|
+
}
|
118
|
+
|
119
|
+
// Configure the extension and register it into the global registry.
|
120
|
+
interdocReftextExt.register(asciidoctor.Extensions, options)
|
113
121
|
|
114
122
|
// Convert the file to HTML.
|
115
|
-
asciidoctor.convertFile(
|
123
|
+
asciidoctor.convertFile('./README.adoc')
|
124
|
+
----
|
125
|
+
|
126
|
+
If you don’t want to register the extension globally, you can also pass a custom registry to the `register` function:
|
127
|
+
|
128
|
+
[source, js]
|
116
129
|
----
|
130
|
+
// ...
|
131
|
+
|
132
|
+
const registry = asciidoctor.Extensions.create()
|
133
|
+
interdocReftextExt.register(registry, options)
|
134
|
+
|
135
|
+
const html = asciidoctor.convertFile('./README.adoc', {
|
136
|
+
'extension_registry': registry,
|
137
|
+
})
|
138
|
+
----
|
139
|
+
|
140
|
+
.*Options:*
|
141
|
+
asciidocExts::
|
142
|
+
AsciiDoc file extensions (e.g. `.adoc`).
|
143
|
+
Default is `['.adoc', '.asciidoc', '.ad']`.
|
144
|
+
|
145
|
+
raiseExceptions::
|
146
|
+
Whether to raise exceptions (`true`), or just log them (`false`).
|
147
|
+
Default is `true`.
|
117
148
|
|
118
149
|
|
119
150
|
== License
|
@@ -1,9 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'asciidoctor' unless RUBY_PLATFORM == 'opal'
|
3
|
-
require 'asciidoctor/extensions' unless RUBY_PLATFORM == 'opal'
|
4
2
|
require 'asciidoctor/interdoc_reftext/version'
|
5
3
|
require 'asciidoctor/interdoc_reftext/processor'
|
6
4
|
|
7
|
-
|
8
|
-
|
5
|
+
unless RUBY_PLATFORM == 'opal'
|
6
|
+
require 'asciidoctor'
|
7
|
+
require 'asciidoctor/extensions'
|
8
|
+
|
9
|
+
Asciidoctor::Extensions.register do
|
10
|
+
treeprocessor Asciidoctor::InterdocReftext::Processor
|
11
|
+
end
|
9
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-interdoc-reftext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Jirutka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|