asciidoctor-confluence_publisher 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c02a16d80d2c6942088552370ab3f10033ec630caaaf6972830e48c1a11ceee3
4
- data.tar.gz: 8a14b5a3ad568ce9fd8cc1151b5ad36a76ef3533bc24b4462ab78e351d6e2482
3
+ metadata.gz: 359010b3692d9380e1f7931460aca85de9f2bbb04056675facb6defeb99c464d
4
+ data.tar.gz: ac6328db049cd58b385e24ce5a4f99bd7a662ba4736e777d1c947f9a59dd1aae
5
5
  SHA512:
6
- metadata.gz: e7bb82e7e9159b8a9c9a319fdb82ff6684d61c9af1fce1e85227fd9645e606cd547d549dc971d4c388c17c367a57af6fde3aa5f0154c979a0bcebf050da707f0
7
- data.tar.gz: 2ec63862b46679825befa2c4aa878bead193426cf81c471791b275ac8c8e931486fc3de0401c3dc5ea478f97cb3040b13e91b3fc9b1ab40af589beca770de676
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
@@ -2,6 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
  $LOAD_PATH.unshift File.expand_path '../../lib', __FILE__
4
4
  require 'asciidoctor/confluence_publisher/command'
5
- require 'pry-byebug'
6
5
 
7
6
  Asciidoctor::ConfluencePublisher::Command.execute ARGV
@@ -18,22 +18,15 @@ module Asciidoctor
18
18
  source_dir = nil
19
19
  2.times do
20
20
  result = options.parse! args
21
- if result.is_a? Integer
22
- if args.size == 1
23
- file = args.first
24
- fstat = ::File.stat file
25
- if fstat.ftype == 'directory' && (input_files = parse_directory_files(file)).size > 0
26
- source_dir = file
27
- orig_args.reject! { |_arg| file == _arg }
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 = []
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module ConfluencePublisher
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -15,4 +15,4 @@
15
15
  %ac:structured-macro{"ac:name" => "noformat"}
16
16
  - if title?
17
17
  %ac:parameter{"ac:name" => "title"}= title
18
- %ac:plain-text-body= "<![CDATA[#{content}]]>"
18
+ %ac:plain-text-body= "<![CDATA[#{raw_content}]]>"
@@ -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.0
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-06-20 00:00:00.000000000 Z
11
+ date: 2020-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor