docxify 0.0.8 → 0.0.9
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/CHANGELOG.md +1 -1
- data/lib/docxify/element/page_layout.rb +34 -0
- data/lib/docxify/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c43501f65a265d3e8ce49ae0c5081d425c838465e31392b8e17c66c5d32214f9
|
4
|
+
data.tar.gz: efff6888d11c6ba8d9984150c0589d57e960b0e04fdc3daa79a2a458517b0fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8dae5642665518f3c8be12d9a3d16a54ab626e3601b0b1073583f5c6f67cc80e31215e045f9ce593e520db7e35349d55363fee1f4713be4bb8eb7a704081780
|
7
|
+
data.tar.gz: 2d6aca43dba5dbe008f58e83a7bac426d6edb43aac83ba9812dc3eb1ab9bbe9218d128f88d6dfbd78fafaef38f8be32b1a97a47ba1519d13f4c86b81417c62c7
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Word PageLayouts are a weird concept; instead of a wrapping element or a
|
2
|
+
# "this applies to content from here on down", it's applied retrospectively
|
3
|
+
# to the content that came before it.
|
4
|
+
module DocXify
|
5
|
+
module Element
|
6
|
+
class PageLayout < Base
|
7
|
+
attr_accessor :width, :height, :orientation
|
8
|
+
|
9
|
+
def initialize(options = {})
|
10
|
+
super()
|
11
|
+
@document = options[:document]
|
12
|
+
@margins = @document.margins
|
13
|
+
@width = options[:width] || @document&.width || DocXify::A4_PORTRAIT_WIDTH
|
14
|
+
@height = options[:height] || @document&.height || DocXify::A4_PORTRAIT_HEIGHT
|
15
|
+
@orientation = options[:orientation] || :portrait
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_s(_container = nil)
|
19
|
+
<<~XML
|
20
|
+
<w:p>
|
21
|
+
<w:pPr>
|
22
|
+
<w:sectPr>
|
23
|
+
<w:pgSz w:w="#{@width}" w:h="#{@height}" w:orient="#{@orientation}"/>
|
24
|
+
<w:pgMar w:bottom="#{DocXify.cm2dxa @margins[:bottom]}" w:footer="708" w:gutter="0" w:header="708" w:left="#{DocXify.cm2dxa @margins[:left]}" w:right="#{DocXify.cm2dxa @margins[:right]}" w:top="#{DocXify.cm2dxa @margins[:top]}"/>
|
25
|
+
<w:cols w:space="708"/>
|
26
|
+
<w:docGrid w:linePitch="360"/>
|
27
|
+
</w:sectPr>
|
28
|
+
</w:pPr>
|
29
|
+
</w:p>
|
30
|
+
XML
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/docxify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docxify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/docxify/element/file.rb
|
47
47
|
- lib/docxify/element/image.rb
|
48
48
|
- lib/docxify/element/page_break.rb
|
49
|
+
- lib/docxify/element/page_layout.rb
|
49
50
|
- lib/docxify/element/paragraph.rb
|
50
51
|
- lib/docxify/element/table.rb
|
51
52
|
- lib/docxify/element/table_cell.rb
|
@@ -74,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
75
|
- !ruby/object:Gem::Version
|
75
76
|
version: '0'
|
76
77
|
requirements: []
|
77
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.17
|
78
79
|
signing_key:
|
79
80
|
specification_version: 4
|
80
81
|
summary: DocXify is a gem to help you generate Word documents from Ruby.
|