xantora 0.1.0 → 0.2.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.md +3 -3
- data/lib/xantora/cli.rb +8 -8
- data/lib/xantora/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b6544ba69c27e9bd6d6395d26ea28fd7a079c53a5e397de7aa03175e016f762
|
4
|
+
data.tar.gz: d1f69ad17bbb6ee8b58daf37cc0f3c51c9060a63f73957fd7f2dbcc2978d667a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df2c234502ef88e5f16e96bbdac1ca6a083cfb11506fd24b2f75f31583d85d31b853a35d111fe636ce4a7092fcce3a9c9d808687141ab4ecac6ea1ce2c81de99
|
7
|
+
data.tar.gz: f5a93f5486f7eed96e43c7f058ada1aad59b20412843d0623fa7bf8155885927bffeda789881cc10717646ec0ec043c1657f1a2e938419d2c5fb0eb97916bb92
|
data/README.md
CHANGED
@@ -17,19 +17,19 @@ gem install xantora
|
|
17
17
|
Convert a single AsciiDoc document:
|
18
18
|
|
19
19
|
```bash
|
20
|
-
xantora convert
|
20
|
+
xantora convert modules/user-guide/pages/index.adoc
|
21
21
|
```
|
22
22
|
|
23
23
|
Convert a all documents within an Antora component:
|
24
24
|
|
25
25
|
```bash
|
26
|
-
xantora convert
|
26
|
+
xantora convert modules/
|
27
27
|
```
|
28
28
|
|
29
29
|
Convert all documents and store PDF's in the attachment folders (using option `--to-attachments` or `-A`):
|
30
30
|
|
31
31
|
```bash
|
32
|
-
xantora convert
|
32
|
+
xantora convert modules/ --to-attachments
|
33
33
|
```
|
34
34
|
|
35
35
|
See `xantora help` for more usage instructions.
|
data/lib/xantora/cli.rb
CHANGED
@@ -20,11 +20,11 @@ module Xantora
|
|
20
20
|
end
|
21
21
|
map %w[--version -v] => :version
|
22
22
|
|
23
|
-
desc "convert", "Convert Antora document(s) to PDF"
|
24
|
-
option :source,
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
desc "convert SOURCE (.adoc or modules-path)", "Convert Antora a document(s) to PDF. SOURCE can be an AsciiDoc-file or an Antora modules-path."
|
24
|
+
# option :source,
|
25
|
+
# desc: "Antora document (.adoc) or modules path",
|
26
|
+
# aliases: %w[-s],
|
27
|
+
# required: true
|
28
28
|
option :output,
|
29
29
|
desc: "destination file or directory",
|
30
30
|
aliases: %w[-o],
|
@@ -39,12 +39,12 @@ module Xantora
|
|
39
39
|
type: :boolean,
|
40
40
|
aliases: %w[-A],
|
41
41
|
default: false
|
42
|
-
def convert
|
43
|
-
if File.directory? options[:source]
|
42
|
+
def convert(source)
|
43
|
+
if File.directory? source #options[:source]
|
44
44
|
puts "[.] Scanning module directory for .adoc files ..."
|
45
45
|
Dir.glob("#{options[:source]}/**/pages/*.adoc") { |file| convert_document(file, options) }
|
46
46
|
elsif options[:source].end_with? ".adoc"
|
47
|
-
convert_document(
|
47
|
+
convert_document(source, options)
|
48
48
|
else
|
49
49
|
puts "[error] No valid source detected."
|
50
50
|
exit 1
|
data/lib/xantora/version.rb
CHANGED