asciidoctor-confluence_publisher 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/test.yml +24 -0
  3. data/.gitignore +14 -0
  4. data/Gemfile +7 -0
  5. data/README.md +54 -0
  6. data/Rakefile +10 -0
  7. data/asciidoctor-confluence_publisher.gemspec +31 -0
  8. data/bin/confluence-publisher +7 -0
  9. data/lib/asciidoctor/confluence_publisher.rb +12 -0
  10. data/lib/asciidoctor/confluence_publisher/asciidoc.rb +39 -0
  11. data/lib/asciidoctor/confluence_publisher/command.rb +59 -0
  12. data/lib/asciidoctor/confluence_publisher/confluence_api.rb +236 -0
  13. data/lib/asciidoctor/confluence_publisher/invoker.rb +154 -0
  14. data/lib/asciidoctor/confluence_publisher/model/ancestor.rb +9 -0
  15. data/lib/asciidoctor/confluence_publisher/model/attachment.rb +15 -0
  16. data/lib/asciidoctor/confluence_publisher/model/base.rb +21 -0
  17. data/lib/asciidoctor/confluence_publisher/model/page.rb +26 -0
  18. data/lib/asciidoctor/confluence_publisher/model/property.rb +14 -0
  19. data/lib/asciidoctor/confluence_publisher/model/space.rb +9 -0
  20. data/lib/asciidoctor/confluence_publisher/model/version.rb +9 -0
  21. data/lib/asciidoctor/confluence_publisher/version.rb +5 -0
  22. data/lib/asciidoctor_confluence_publisher.rb +1 -0
  23. data/template/block_admonition.html.haml +6 -0
  24. data/template/block_example.haml.haml +4 -0
  25. data/template/block_image.html.haml +10 -0
  26. data/template/block_listing.html.haml +18 -0
  27. data/template/block_olist.html.haml +8 -0
  28. data/template/block_paragraph.html.haml +4 -0
  29. data/template/block_preamble.html.haml +1 -0
  30. data/template/block_quote.html.haml +9 -0
  31. data/template/block_stem.html.haml +3 -0
  32. data/template/block_table.html.haml +24 -0
  33. data/template/block_toc.html.haml +7 -0
  34. data/template/block_ulist.html.haml +15 -0
  35. data/template/block_verse.html.haml +9 -0
  36. data/template/block_video.html.haml +11 -0
  37. data/template/document.html.haml +1 -0
  38. data/template/embedded.html.haml +4 -0
  39. data/template/helpers.rb +171 -0
  40. data/template/inline_anchor.html.haml +20 -0
  41. data/template/inline_image.html.haml +7 -0
  42. data/template/section.html.haml +6 -0
  43. metadata +143 -0
@@ -0,0 +1,20 @@
1
+ - case type
2
+ - when :xref
3
+ - if target.end_with? ".html"
4
+ %ac:link
5
+ %ri:page{ "ri:content-title" => target }
6
+ %ac:plain-text-link-body="<![CDATA[#{(xref_text || %([#{attr :refid}]))}]]>"
7
+ - else
8
+ %ac:link{ "ac:anchor" => (anchor_name(target)) }
9
+ %ac:plain-text-link-body="<![CDATA[#{(xref_text || %([#{attr :refid}]))}]]>"
10
+ - when :ref
11
+ %ac:structured-macro{ "ac:name" => "anchor" }
12
+ %ac:parameter=(anchor_name target)
13
+ - else
14
+ - if uri_link? target
15
+ %a{href: target}=text
16
+ - else
17
+ %ac:link
18
+ %ri:attachment{ "ri:filename" => File.basename(target) }
19
+ - if target != text
20
+ %ac:plain-text-link-body="<![CDATA[#{text}]]>"
@@ -0,0 +1,7 @@
1
+ - haml_tag_if((attr? :link), :a, {href: (attr :link)}) do
2
+ - href_target = target
3
+ %ac:image{ "ac:alt" => (attr :alt), "ac:height" => (attr :height), "ac:width" => (attr :width) }
4
+ - if uri_link? href_target
5
+ %ri:url{ "ri:value" => href_target }/
6
+ - else
7
+ %ri:attachment{ "ri:filename" => File.basename(href_target) }/
@@ -0,0 +1,6 @@
1
+ - haml_tag "h#{section_level}##{@id}" do
2
+ %ac:structured-macro{"ac:name" => "anchor"}
3
+ %ac:parameter{"ac:name" => ""}
4
+ =anchor_name(id)
5
+ =section_title
6
+ =content
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asciidoctor-confluence_publisher
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - polarlights
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-06-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: asciidoctor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: haml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 5.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 5.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rest-client
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 2.1.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.8.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.8.0
69
+ description: Asciidoctor-Confluence parse asciidoc and publish the document to confluence.
70
+ email:
71
+ - godhuyang@hotmail.com
72
+ executables:
73
+ - confluence-publisher
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".github/workflows/test.yml"
78
+ - ".gitignore"
79
+ - Gemfile
80
+ - README.md
81
+ - Rakefile
82
+ - asciidoctor-confluence_publisher.gemspec
83
+ - bin/confluence-publisher
84
+ - lib/asciidoctor/confluence_publisher.rb
85
+ - lib/asciidoctor/confluence_publisher/asciidoc.rb
86
+ - lib/asciidoctor/confluence_publisher/command.rb
87
+ - lib/asciidoctor/confluence_publisher/confluence_api.rb
88
+ - lib/asciidoctor/confluence_publisher/invoker.rb
89
+ - lib/asciidoctor/confluence_publisher/model/ancestor.rb
90
+ - lib/asciidoctor/confluence_publisher/model/attachment.rb
91
+ - lib/asciidoctor/confluence_publisher/model/base.rb
92
+ - lib/asciidoctor/confluence_publisher/model/page.rb
93
+ - lib/asciidoctor/confluence_publisher/model/property.rb
94
+ - lib/asciidoctor/confluence_publisher/model/space.rb
95
+ - lib/asciidoctor/confluence_publisher/model/version.rb
96
+ - lib/asciidoctor/confluence_publisher/version.rb
97
+ - lib/asciidoctor_confluence_publisher.rb
98
+ - template/block_admonition.html.haml
99
+ - template/block_example.haml.haml
100
+ - template/block_image.html.haml
101
+ - template/block_listing.html.haml
102
+ - template/block_olist.html.haml
103
+ - template/block_paragraph.html.haml
104
+ - template/block_preamble.html.haml
105
+ - template/block_quote.html.haml
106
+ - template/block_stem.html.haml
107
+ - template/block_table.html.haml
108
+ - template/block_toc.html.haml
109
+ - template/block_ulist.html.haml
110
+ - template/block_verse.html.haml
111
+ - template/block_video.html.haml
112
+ - template/document.html.haml
113
+ - template/embedded.html.haml
114
+ - template/helpers.rb
115
+ - template/inline_anchor.html.haml
116
+ - template/inline_image.html.haml
117
+ - template/section.html.haml
118
+ homepage: https://github.com/polarlights/asciidoctor-confluence_publisher
119
+ licenses: []
120
+ metadata:
121
+ homepage_uri: https://github.com/polarlights/asciidoctor-confluence_publisher
122
+ source_code_uri: https://github.com/polarlights/asciidoctor-confluence_publisher
123
+ changelog_uri: https://github.com/polarlights/asciidoctor-confluence_publisher/releases
124
+ post_install_message:
125
+ rdoc_options: []
126
+ require_paths:
127
+ - lib
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 2.0.0
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubygems_version: 3.0.8
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: Parse asciidoc and publish the document to confluence.
143
+ test_files: []