summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-06-19 19:53:05 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-06-19 19:57:11 +0200
commitfb24a38e92b5eb442008ef3739c91141b3c7c4c8 (patch)
treec29b54b1e4892d00bbef3cc403cd11e77e8794c7
parent811b6cf9981d7b778f7643fbbb10c548927560f5 (diff)
Readme: Add requirements, installation and usage for JS module
-rw-r--r--README.adoc34
1 files changed, 31 insertions, 3 deletions
diff --git a/README.adoc b/README.adoc
index 1bcadcd..77b540d 100644
--- a/README.adoc
+++ b/README.adoc
@@ -61,7 +61,9 @@ where “The First Section” is *title* of the section with id _sec1_ in _other
== Installation
-To install (or update to the latest version):
+=== Ruby
+
+Install {gem-name} from Rubygems:
[source, subs="+attributes"]
gem install {gem-name}
@@ -72,21 +74,47 @@ or to install the latest development version:
gem install {gem-name} --pre
+=== Node.js
+
+Install {gem-name} from npmjs.com:
+
+[source, sh, subs="+attributes"]
+npm install --save {gem-name}
+
+
== Usage
-Just `require '{gem-name}'`.
+=== CLI
+
If you invoke Asciidoctor from command-line, use option `-r` to load the extension:
[source, subs="+attributes"]
asciidoctor -r {gem-name} README.adoc
-If you don’t want the extension to be automatically registered in Asciidoctor, don’t _require_ `{gem-name}`, but `asciidoctor/interdoc_reftext/processor`.
+
+=== Ruby
+
+Just `require '{gem-name}'`.
+However, if you don’t want the extension to be automatically registered in Asciidoctor, `require 'asciidoctor/interdoc_reftext/processor'` instead.
IMPORTANT: Bundler automatically _requires_ all the specified gems.
To prevent it, use +
`gem '{gem-name}', require: false`.
+=== Node.js
+
+[source, js, subs="+attributes"]
+----
+// Load asciidoctor.js and {gem-name}.
+const asciidoctor = require('asciidoctor.js')()
+require('{gem-name}')
+
+// Convert the file to HTML.
+asciidoctor.convertFile("./README.adoc")
+----
+
+
== License
This project is licensed under http://opensource.org/licenses/MIT/[MIT License].