@asciidoctor/core 3.0.0-alpha.3 → 3.0.0-rc.1

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.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Asciidoctor core
2
+
3
+ This package provides Asciidoctor core functionality:
4
+
5
+ * parser
6
+ * built-in converters
7
+ * extensions
8
+
9
+ ## Install
10
+
11
+ ```console
12
+ $ npm i @asciidoctor/core --save
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ Here is a simple example that converts AsciiDoc to HTML5:
18
+
19
+ **sample.js**
20
+
21
+ ```javascript
22
+ const asciidoctor = require('@asciidoctor/core')() // ①
23
+ const content = 'http://asciidoctor.org[*Asciidoctor*] ' +
24
+ 'running on https://opalrb.com[_Opal_] ' +
25
+ 'brings AsciiDoc to Node.js!'
26
+ const html = asciidoctor.convert(content) // ②
27
+ console.log(html) // ③
28
+ ```
29
+ 1. Instantiate the Asciidoctor.js library
30
+ 2. Convert AsciiDoc content to HTML5 using Asciidoctor.js
31
+ 3. Print the HTML5 output to the console
32
+
33
+ Save the file as _sample.js_ and run it using the `node` command:
34
+
35
+ ```console
36
+ $ node sample.js
37
+ ```
38
+
39
+ You should see the following output in your terminal:
40
+
41
+ ```html
42
+ <div class="paragraph">
43
+ <p><a href="http://asciidoctor.org"><strong>Asciidoctor</strong></a> running on <a href="http://opalrb.com"><em>Opal</em></a> brings AsciiDoc to Node.js!</p>
44
+ </div>
45
+ ```
46
+
47
+ If you want to know more about Asciidoctor.js, please read the [User Manual](https://asciidoctor-docs.netlify.com/asciidoctor.js/).
48
+
49
+ ## Changelog
50
+
51
+ Refer to the [CHANGELOG](https://github.com/asciidoctor/asciidoctor.js/blob/main/CHANGELOG.adoc) for a complete list of changes.