asciidoctor-confluence_publisher 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/bin/confluence-publisher +0 -1
- data/lib/asciidoctor/confluence_publisher/command.rb +18 -15
- data/lib/asciidoctor/confluence_publisher/version.rb +1 -1
- data/template/block_listing.html.haml +1 -1
- data/template/helpers.rb +10 -0
- 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: 359010b3692d9380e1f7931460aca85de9f2bbb04056675facb6defeb99c464d
|
4
|
+
data.tar.gz: ac6328db049cd58b385e24ce5a4f99bd7a662ba4736e777d1c947f9a59dd1aae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d0357a11d1a2483d249526ebf10ee5ff308cc5e99b0db7d1875e7bb410e0fc83b40d82c6ecf6ea795208bb1eee5b138f9b3e7d536be723a05c87f7fb53f837a
|
7
|
+
data.tar.gz: 80e29b8e1a2b6f7b9b06086c8c906890693ef95dfd006a6db7bf490005902e2a0140446ed91abf388fcf3c7b9ea5ca5b01a4133b01464cc62ceb0b1b04bc4859
|
data/README.md
CHANGED
@@ -5,6 +5,8 @@ generate confluence compatible html and upload the content and attachment to con
|
|
5
5
|
|
6
6
|
This repo inspired by [confluence-publisher](https://github.com/confluence-publisher/confluence-publisher)
|
7
7
|
|
8
|
+
**It requires Ruby 2.x. works for Confluence 6+.**
|
9
|
+
|
8
10
|
## Installation
|
9
11
|
|
10
12
|
```ruby
|
data/bin/confluence-publisher
CHANGED
@@ -18,22 +18,15 @@ module Asciidoctor
|
|
18
18
|
source_dir = nil
|
19
19
|
2.times do
|
20
20
|
result = options.parse! args
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
orig_args.concat input_files
|
29
|
-
args = orig_args
|
30
|
-
else
|
31
|
-
exit result
|
32
|
-
end
|
33
|
-
else
|
34
|
-
exit result
|
35
|
-
end
|
21
|
+
break unless result.is_a? Integer
|
22
|
+
|
23
|
+
can_retry = false
|
24
|
+
if args.size == 1
|
25
|
+
source_dir = args.first
|
26
|
+
args = convert_directory_to_files(source_dir, orig_args)
|
27
|
+
can_retry = true
|
36
28
|
end
|
29
|
+
exit result unless can_retry
|
37
30
|
end
|
38
31
|
|
39
32
|
options[:asciidoc_source_dir] = source_dir
|
@@ -43,6 +36,16 @@ module Asciidoctor
|
|
43
36
|
end
|
44
37
|
|
45
38
|
private
|
39
|
+
|
40
|
+
def self.convert_directory_to_files(file, orig_args)
|
41
|
+
fstat = ::File.stat file
|
42
|
+
if fstat.ftype == 'directory' && (input_files = parse_directory_files(file)).size > 0
|
43
|
+
orig_args.reject! { |_arg| file == _arg }
|
44
|
+
orig_args.concat input_files
|
45
|
+
return orig_args
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
46
49
|
# hack asciidoctor to support folder
|
47
50
|
def self.parse_directory_files(directory)
|
48
51
|
infiles = []
|
data/template/helpers.rb
CHANGED
@@ -65,6 +65,16 @@ module Haml::Helpers
|
|
65
65
|
supported.include? lang
|
66
66
|
end
|
67
67
|
|
68
|
+
# default block list with *specialcharactor* substitution, in confluence just keep it as it is.
|
69
|
+
def raw_content
|
70
|
+
return content if attr? 'subs'
|
71
|
+
orig_subs = @subs
|
72
|
+
@subs = []
|
73
|
+
result = content
|
74
|
+
@subs = orig_subs
|
75
|
+
return result
|
76
|
+
end
|
77
|
+
|
68
78
|
#--------------------------------------------------------
|
69
79
|
# block_table
|
70
80
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-confluence_publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- polarlights
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|