caracal 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +6 -3
- data/lib/caracal/renderers/document_renderer.rb +2 -2
- data/lib/caracal/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa886d1701a3fd3be57df67220f491dc020759ff
|
4
|
+
data.tar.gz: 0819776425e4c055c74946f6cf9c73622b8964cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01bbb4a1ea7264b9f95363005af6acaa76796a1085a6ef3264645b4cd29f586a79bddcf87d458ae69d63fefd3570908367e7982cdf1705d608d5ab15dd593482
|
7
|
+
data.tar.gz: 8d116facbd2f0a0c7de17a85cf6694ffca5d8fd88799ccfd20159dbb13402f2e9ef6f57979d6982d2e462682749a93364e0323544602176396a1ce3a3a0c54c1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -12,6 +12,9 @@ Caracal is not a magical HTML to Word translator. Instead, it is a markup langua
|
|
12
12
|
|
13
13
|
Or, said differently, if you use [Prawn](https://github.com/prawnpdf/prawn) for PDF generation, you'll probably like Caracal. Only you'll probably like it better. :)
|
14
14
|
|
15
|
+
Please see the [caracal-example](https://github.com/trade-informatics/caracal-example) repository for
|
16
|
+
a working demonstration of the library's capabilities.
|
17
|
+
|
15
18
|
|
16
19
|
## Teaser
|
17
20
|
|
@@ -42,7 +45,7 @@ Caracal::Document.save 'example.docx' do |docx|
|
|
42
45
|
li 'Item 2'
|
43
46
|
end
|
44
47
|
docx.p
|
45
|
-
docx.img
|
48
|
+
docx.img 'https://www.example.com/logo.png', width: 500, height: 300
|
46
49
|
end
|
47
50
|
```
|
48
51
|
|
@@ -533,7 +536,7 @@ Images can be added by using the `img` method. The method accepts several optio
|
|
533
536
|
*Caracal will automatically embed the image in the Word document.*
|
534
537
|
|
535
538
|
```ruby
|
536
|
-
docx.img
|
539
|
+
docx.img 'https://www.example.com/logo.png' do
|
537
540
|
data raw_data # sets the file data directly instead of opening the url
|
538
541
|
width 396 # sets the image width. units specified in pixels.
|
539
542
|
height 216 # sets the image height. units specified in pixels.
|
@@ -609,7 +612,7 @@ c1 = Caracal::Core::Models:TableCellModel.new do
|
|
609
612
|
|
610
613
|
p 'This is a sentence above an image.'
|
611
614
|
p
|
612
|
-
img
|
615
|
+
img 'https://www.example.com/logo.png', width: 200, height: 100
|
613
616
|
end
|
614
617
|
```
|
615
618
|
|
@@ -123,11 +123,11 @@ module Caracal
|
|
123
123
|
xml.send 'pic:pic' do
|
124
124
|
xml.send 'pic:nvPicPr' do
|
125
125
|
xml.send 'pic:cNvPr', { id: rel_id, name: rel_name }
|
126
|
-
xml.send 'pic:cNvPicPr'
|
126
|
+
xml.send 'pic:cNvPicPr'
|
127
127
|
end
|
128
128
|
xml.send 'pic:blipFill' do
|
129
129
|
xml.send 'a:blip', { 'r:embed' => rel.formatted_id }
|
130
|
-
xml.send 'a:srcRect'
|
130
|
+
xml.send 'a:srcRect'
|
131
131
|
xml.send 'a:stretch' do
|
132
132
|
xml.send 'a:fillRect'
|
133
133
|
end
|
data/lib/caracal/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caracal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trade Infomatics
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -257,3 +257,4 @@ test_files:
|
|
257
257
|
- spec/lib/caracal/core/text_spec.rb
|
258
258
|
- spec/lib/caracal/errors_spec.rb
|
259
259
|
- spec/spec_helper.rb
|
260
|
+
has_rdoc:
|