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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd232240b5668fc37f4552d6ee419f46028815c0aec5015fd7f70dd4a110c3cc
4
- data.tar.gz: f68b54e05dd2cd7d32fc3f3f0c48b852ab50e3d4ec7cda4bcf54c1891ef0d8f1
3
+ metadata.gz: 56ea4590d0248f86318077efc14189c789e881dad32a862e12eb7fe509ca6b3c
4
+ data.tar.gz: bbd598ecf9ad35e2500299add61b55482da3e767c041f179b59abd8c9d858705
5
5
  SHA512:
6
- metadata.gz: a7ddcf13d9d125c3071507ebaca379af4bfc41933df4f4920c6be70f8e12053e804cd586146da565389d9f29cc8fb7e6f174db2d4db129105a66cbc02447e1d2
7
- data.tar.gz: 19432fd2fac94e39a36d4c20ac45870d45733b904f3485f4dc37413b8fa47664e6b92bae2603a6a583867ff0fa9385871e289ef139c804b679585445477e51e1
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("./README.adoc")
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
- Asciidoctor::Extensions.register do
8
- treeprocessor Asciidoctor::InterdocReftext::Processor
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
@@ -3,6 +3,6 @@
3
3
  module Asciidoctor
4
4
  module InterdocReftext
5
5
  # Version of the asciidoctor-interdoc-reftext gem.
6
- VERSION = '0.3.0'.freeze
6
+ VERSION = '0.4.0'
7
7
  end
8
8
  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.3.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-06-19 00:00:00.000000000 Z
11
+ date: 2018-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor