caracal 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/.travis.yml +20 -0
- data/README.md +750 -675
- data/Rakefile +5 -0
- data/caracal.gemspec +2 -1
- data/lib/caracal/core/images.rb +2 -3
- data/lib/caracal/core/list_styles.rb +2 -1
- data/lib/caracal/core/lists.rb +2 -2
- data/lib/caracal/core/models/base_model.rb +1 -1
- data/lib/caracal/core/models/border_model.rb +1 -1
- data/lib/caracal/core/models/image_model.rb +1 -1
- data/lib/caracal/core/models/list_item_model.rb +2 -2
- data/lib/caracal/core/models/list_model.rb +3 -3
- data/lib/caracal/core/models/list_style_model.rb +1 -1
- data/lib/caracal/core/models/margin_model.rb +1 -1
- data/lib/caracal/core/models/page_number_model.rb +1 -1
- data/lib/caracal/core/models/page_size_model.rb +1 -1
- data/lib/caracal/core/models/paragraph_model.rb +6 -6
- data/lib/caracal/core/models/style_model.rb +1 -1
- data/lib/caracal/core/models/table_cell_model.rb +7 -3
- data/lib/caracal/core/models/table_model.rb +3 -3
- data/lib/caracal/core/page_numbers.rb +1 -1
- data/lib/caracal/core/page_settings.rb +2 -2
- data/lib/caracal/core/relationships.rb +1 -1
- data/lib/caracal/core/rules.rb +1 -1
- data/lib/caracal/core/styles.rb +1 -1
- data/lib/caracal/core/tables.rb +1 -1
- data/lib/caracal/core/text.rb +3 -4
- data/lib/caracal/renderers/document_renderer.rb +30 -19
- data/lib/caracal/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59758b862e0b05d974cf9fc726a87fe910c85763
|
4
|
+
data.tar.gz: cf29ba4295b3a2e181215eedd77f878f76a1941d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6666722a221f0e572625787923f9bab053e025e6c6d7b9e25e80dfbdaa09a57a7f1e9eca72e6ea51a76ec56810eb8cc27b8c1c5dd629108082e6cc2c9b16b4e2
|
7
|
+
data.tar.gz: 7ec8fcde135be9d2b98ae9720bd9cd3f7662a8cb3e1e11ce1bd7b6541e5cc350906b4035d898d877c0d7005543200bbfc346cc892c5a5f97b75ea674e9902f53
|
data/.travis.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
rvm:
|
4
|
+
- 1.9.2
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0.0
|
7
|
+
- 2.1
|
8
|
+
- rbx-2
|
9
|
+
- ruby-head
|
10
|
+
- jruby-head
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
- rvm: jruby
|
14
|
+
env: JRUBY_OPTS="--1.9 --debug"
|
15
|
+
- rvm: jruby
|
16
|
+
env: JRUBY_OPTS="--2.0 --debug"
|
17
|
+
allow_failures:
|
18
|
+
- rvm: ruby-head
|
19
|
+
- rvm: jruby-head
|
20
|
+
fast_finish: true
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# Caracal
|
2
|
+
[![Build Status](http://img.shields.io/travis/trade-informatics/caracal.svg?style=flat)](https://travis-ci.org/trade-informatics/caracal)
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/caracal.svg?style=flat)](https://rubygems.org/gems/caracal)
|
2
4
|
|
3
5
|
Caracal is a ruby library for dynamically creating professional-quality Microsoft Word documents (.docx) using an HTML-style syntax.
|
4
6
|
|
@@ -7,12 +9,15 @@ Caracal is a ruby library for dynamically creating professional-quality Microsof
|
|
7
9
|
|
8
10
|
Add this line to your application's Gemfile:
|
9
11
|
|
10
|
-
|
12
|
+
```ruby
|
13
|
+
gem 'caracal'
|
14
|
+
```
|
11
15
|
|
12
16
|
Then execute:
|
13
17
|
|
14
|
-
|
15
|
-
|
18
|
+
```bash
|
19
|
+
bundle install
|
20
|
+
```
|
16
21
|
|
17
22
|
## Overview
|
18
23
|
|
@@ -76,7 +81,7 @@ Defines global directives for the document (e.g., whether to show background ima
|
|
76
81
|
|
77
82
|
**word/styles.xml**
|
78
83
|
Defines all paragraph and table styles used through the document. Caracal adds a default set of styles to match its HTML-like content syntax. These defaults can be overridden.
|
79
|
-
|
84
|
+
|
80
85
|
**[Content_Types].xml**
|
81
86
|
Pairs extensions and XML files with schema content types so Word can parse them correctly. *This file is generated automatically by the library based on other user directives.*
|
82
87
|
|
@@ -108,802 +113,872 @@ EMUs are a virtual unit designed to facilitate the smooth conversion between inc
|
|
108
113
|
|
109
114
|
In the following examples, the variable `docx` is assumed to be an instance of Caracal::Document.
|
110
115
|
|
111
|
-
|
116
|
+
```ruby
|
117
|
+
docx = Caracal::Document.new('example_document.docx')
|
118
|
+
```
|
112
119
|
|
113
120
|
### File Name
|
114
121
|
|
115
122
|
The final output document's title can be set at initialization or via the `file_name` method.
|
116
123
|
|
117
|
-
|
118
|
-
|
119
|
-
|
124
|
+
```ruby
|
125
|
+
docx = Caracal::Document.new('example_document.docx')
|
126
|
+
|
127
|
+
docx.file_name 'example_document.docx'
|
128
|
+
```
|
120
129
|
|
121
130
|
The current document name can be returned by invoking the `name` method:
|
122
131
|
|
123
|
-
|
124
|
-
|
132
|
+
```ruby
|
133
|
+
docx.name # => 'example_document.docx'
|
134
|
+
```
|
135
|
+
|
125
136
|
*The default file name is caracal.docx.*
|
126
137
|
|
127
138
|
### Page Size
|
128
139
|
|
129
|
-
Page dimensions can be set using the `page_size` method. The method accepts two parameters for controlling the width and height of the document.
|
140
|
+
Page dimensions can be set using the `page_size` method. The method accepts two parameters for controlling the width and height of the document.
|
130
141
|
|
131
142
|
*Pages default to the United States standard A4, portrait dimensions (8.5in x 11in).*
|
132
143
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
144
|
+
```ruby
|
145
|
+
# options via block
|
146
|
+
docx.page_size do
|
147
|
+
width 12240 # sets the page width. units in twips.
|
148
|
+
height 15840 # sets the page height. units in twips.
|
149
|
+
end
|
150
|
+
|
151
|
+
# options via hash
|
152
|
+
docx.page_size width: 12240, height: 15840
|
153
|
+
```
|
154
|
+
|
142
155
|
The `page_size` command will produce the following XML in the `document.xml` file:
|
143
156
|
|
144
|
-
|
145
|
-
|
146
|
-
|
157
|
+
```xml
|
158
|
+
<w:sectPr>
|
159
|
+
<w:pgSz w:w="12240" w:h="15840"/>
|
160
|
+
</w:sectPr>
|
161
|
+
```
|
147
162
|
|
148
163
|
### Page Margins
|
149
164
|
|
150
165
|
Page margins can be set using the `page_margins` method. The method accepts four parameters for controlling the margins of the document.
|
151
166
|
*Margins default to 1.0in for all sides.*
|
152
167
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
168
|
+
```ruby
|
169
|
+
# options via block
|
170
|
+
docx.page_margins do
|
171
|
+
left 720 # sets the left margin. units in twips.
|
172
|
+
right 720 # sets the right margin. units in twips.
|
173
|
+
top 1440 # sets the top margin. units in twips.
|
174
|
+
bottom 1440 # sets the bottom margin. units in twips.
|
175
|
+
end
|
176
|
+
|
177
|
+
# options via hash
|
178
|
+
docx.page_margins left: 720, right: 720, top: 1440, bottom: 1440
|
179
|
+
```
|
180
|
+
|
164
181
|
The `page_margins` command above will produce the following XML in the `document.xml` file:
|
165
182
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
183
|
+
```xml
|
184
|
+
<w:sectPr>
|
185
|
+
<w:pgMar w:left="720" w:right="720" w:top="1440" w:bottom="1440"/>
|
186
|
+
</w:sectPr>
|
187
|
+
```
|
188
|
+
|
170
189
|
### Page Breaks
|
171
190
|
|
172
191
|
Page breaks can be added via the `page` method. The method accepts no parameters.
|
173
192
|
|
174
|
-
|
175
|
-
|
193
|
+
```ruby
|
194
|
+
docx.page # starts a new page.
|
195
|
+
```
|
196
|
+
|
176
197
|
The `page` command will produce the following XML in the `document.xml` file:
|
177
198
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
199
|
+
```xml
|
200
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
201
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
202
|
+
<w:br w:type="page"/>
|
203
|
+
</w:r>
|
204
|
+
</w:p>
|
205
|
+
```
|
183
206
|
|
184
207
|
### Page Numbers
|
185
208
|
|
186
|
-
Page numbers can be added to the footer via the `page_numbers` method. The method accepts an optional parameter for controlling the alignment of the text.
|
209
|
+
Page numbers can be added to the footer via the `page_numbers` method. The method accepts an optional parameter for controlling the alignment of the text.
|
187
210
|
|
188
211
|
*Page numbers are turned off by default.*
|
189
212
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
<w:
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
213
|
+
```ruby
|
214
|
+
# no options
|
215
|
+
docx.page_numbers true
|
216
|
+
|
217
|
+
# options via block
|
218
|
+
docx.page_numbers true do
|
219
|
+
align :right # controls text alignment. defaults to :center.
|
220
|
+
end
|
221
|
+
|
222
|
+
# options via hash
|
223
|
+
docx.page_numbers true, align: :right
|
224
|
+
```
|
225
|
+
|
226
|
+
The default command will produce the following `footer.xml` file contents.
|
227
|
+
|
228
|
+
```xml
|
229
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
230
|
+
<w:ftr xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram">
|
231
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
232
|
+
<w:pPr>
|
233
|
+
<w:contextualSpacing w:val="0"/>
|
234
|
+
<w:jc w:val="center"/>
|
235
|
+
</w:pPr>
|
236
|
+
<w:fldSimple w:dirty="0" w:instr="PAGE" w:fldLock="0">
|
237
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
238
|
+
<w:rPr/>
|
239
|
+
</w:r>
|
240
|
+
</w:fldSimple>
|
241
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
242
|
+
<w:rPr>
|
243
|
+
<w:rtl w:val="0"/>
|
244
|
+
</w:rPr>
|
245
|
+
</w:r>
|
246
|
+
</w:p>
|
247
|
+
</w:ftr>
|
248
|
+
```
|
249
|
+
|
223
250
|
*It will also automatically add the correct notation to the `w:sectPr` node of the `document.xml` file.*
|
224
251
|
|
225
|
-
|
252
|
+
|
226
253
|
### Fonts
|
227
254
|
|
228
255
|
Fonts are added to the font table file by calling the `font` method and passing the name of the font. At present, Caracal only supports declaring the primary font name.
|
229
256
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
257
|
+
```ruby
|
258
|
+
docx.font name: 'Arial'
|
259
|
+
docx.font do
|
260
|
+
name 'Droid Serif'
|
261
|
+
end
|
262
|
+
```
|
263
|
+
|
235
264
|
These commands will produce the following `fontTable.xml` file contents:
|
236
265
|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
266
|
+
```xml
|
267
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
268
|
+
<w:fonts xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram">
|
269
|
+
<w:font w:name="Arial"/>
|
270
|
+
<w:font w:name="Droid Serif"/>
|
271
|
+
</w:fonts>
|
272
|
+
```
|
273
|
+
|
243
274
|
### Styles
|
244
275
|
|
245
276
|
Style classes can be added using the `style` method. The method accepts several optional parameters to control the rendering of text using the style.
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
277
|
+
|
278
|
+
```ruby
|
279
|
+
# options via block
|
280
|
+
docx.style do
|
281
|
+
type :paragraph # :paragraph or :table
|
282
|
+
id 'Heading1' # sets the internal identifier for the style.
|
283
|
+
name 'heading 1' # set the friendly name of the style.
|
284
|
+
color '333333' # sets the text color. values in hex RGB.
|
285
|
+
font 'Droid Serif' # sets the font family.
|
286
|
+
size 28 # set the font size. units in half points.
|
287
|
+
bold false # sets the font weight.
|
288
|
+
italic false # sets the font style.
|
289
|
+
underline false # sets whether or not to underline the text.
|
290
|
+
align :left # sets the alignment. accepts :left, :center, :right, and :both.
|
291
|
+
top 100 # sets the spacing above the paragraph. units in twips.
|
292
|
+
bottom 0 # sets the spacing below the paragraph. units in twips.
|
293
|
+
spacing 360 # sets the spacing between lines. units in twips.
|
294
|
+
end
|
295
|
+
```
|
263
296
|
|
264
297
|
The `style` command above would produce the following XML:
|
298
|
+
```xml
|
299
|
+
<w:style w:styleId="Heading1" w:type="paragraph">
|
300
|
+
<w:name w:val="heading 1"/>
|
301
|
+
<w:basedOn w:val="Normal"/>
|
302
|
+
<w:next w:val="Normal"/>
|
303
|
+
<w:pPr>
|
304
|
+
<w:keepNext w:val="0"/>
|
305
|
+
<w:keepLines w:val="0"/>
|
306
|
+
<w:widowControl w:val="0"/>
|
307
|
+
<w:contextualSpacing w:val="1"/>
|
308
|
+
</w:pPr>
|
309
|
+
<w:rPr>
|
310
|
+
<w:rFonts w:cs="Droid Serif" w:hAnsi="Droid Serif" w:eastAsia="Droid Serif" w:ascii="Droid Serif"/>
|
311
|
+
<w:sz w:val="28"/>
|
312
|
+
</w:rPr>
|
313
|
+
</w:style>
|
314
|
+
```
|
265
315
|
|
266
|
-
<w:style w:styleId="Heading1" w:type="paragraph">
|
267
|
-
<w:name w:val="heading 1"/>
|
268
|
-
<w:basedOn w:val="Normal"/>
|
269
|
-
<w:next w:val="Normal"/>
|
270
|
-
<w:pPr>
|
271
|
-
<w:keepNext w:val="0"/>
|
272
|
-
<w:keepLines w:val="0"/>
|
273
|
-
<w:widowControl w:val="0"/>
|
274
|
-
<w:contextualSpacing w:val="1"/>
|
275
|
-
</w:pPr>
|
276
|
-
<w:rPr>
|
277
|
-
<w:rFonts w:cs="Droid Serif" w:hAnsi="Droid Serif" w:eastAsia="Droid Serif" w:ascii="Droid Serif"/>
|
278
|
-
<w:sz w:val="28"/>
|
279
|
-
</w:rPr>
|
280
|
-
</w:style>
|
281
|
-
|
282
316
|
### Paragraphs
|
283
317
|
|
284
318
|
Text can be added using the `p` method. The `p` either takes a string and a `class` option or a block of `text`-like commands.
|
285
319
|
|
286
320
|
Text within a `p` block can be further defined using the `text` and `link` methods. The `text` method takes a text string and the optional parameters `style`, `color`, `size`, `bold`, `italic`, and `underline`. See below for details on the `link` method.
|
287
321
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
322
|
+
```ruby
|
323
|
+
docx.p 'some text', style: 'my_style'
|
324
|
+
|
325
|
+
docx.p do
|
326
|
+
text 'Here is a sentence with a ', style: 'my_style'
|
327
|
+
link 'link', 'https://www.example.com'
|
328
|
+
text ' to something awesome', color: '555555', size: 16, bold: true, italic: true, underline: true
|
329
|
+
end
|
330
|
+
```
|
331
|
+
|
332
|
+
|
297
333
|
A `p` block might yield the following XML:
|
298
334
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
335
|
+
```xml
|
336
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
337
|
+
<w:pPr>
|
338
|
+
<w:contextualSpacing w:val="0"/>
|
339
|
+
</w:pPr>
|
340
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
341
|
+
<w:rPr>
|
342
|
+
<w:rtl w:val="0"/>
|
343
|
+
</w:rPr>
|
344
|
+
<w:t xml:space="preserve">Here is a sentence with a </w:t>
|
345
|
+
</w:r>
|
346
|
+
<w:hyperlink r:id="rId6">
|
347
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
348
|
+
<w:rPr>
|
349
|
+
<w:color w:val="1155cc"/>
|
350
|
+
<w:u w:val="single"/>
|
351
|
+
<w:rtl w:val="0"/>
|
352
|
+
</w:rPr>
|
353
|
+
<w:t xml:space="preserve">link</w:t>
|
354
|
+
</w:r>
|
355
|
+
</w:hyperlink>
|
356
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
357
|
+
<w:rPr>
|
358
|
+
<w:b w:val="1"/>
|
359
|
+
<w:rtl w:val="0"/>
|
360
|
+
</w:rPr>
|
361
|
+
<w:t xml:space="preserve"> to something awesome.</w:t>
|
362
|
+
</w:r>
|
363
|
+
</w:p>
|
364
|
+
```
|
327
365
|
|
328
366
|
### Headers
|
329
367
|
|
330
|
-
Headers can be added using the `h1`, `h2`, etc. methods. Text within a header block can be further defined using the `text` method.
|
368
|
+
Headers can be added using the `h1`, `h2`, etc. methods. Text within a header block can be further defined using the `text` method.
|
331
369
|
|
332
370
|
*Ultimately, headers are just paragraphs that use header styles.*
|
333
371
|
|
334
|
-
|
335
|
-
|
372
|
+
```ruby
|
373
|
+
docx.h3 'Heading 3'
|
374
|
+
```
|
375
|
+
|
336
376
|
The `h3` block above will yield the following XML:
|
337
377
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
378
|
+
```xml
|
379
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
380
|
+
<w:pPr>
|
381
|
+
<w:pStyle w:val="Heading3"/>
|
382
|
+
<w:contextualSpacing w:val="0"/>
|
383
|
+
</w:pPr>
|
384
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
385
|
+
<w:rPr>
|
386
|
+
<w:rtl w:val="0"/>
|
387
|
+
</w:rPr>
|
388
|
+
<w:t xml:space="preserve">Heading 3</w:t>
|
389
|
+
</w:r>
|
390
|
+
</w:p>
|
391
|
+
```
|
392
|
+
|
351
393
|
### Links
|
352
394
|
|
353
395
|
Links can be added inside paragraphs by using the `link` method. The method accepts several optional parameters for controlling the style and behavior of the rule.
|
354
396
|
|
355
397
|
*At present, all links are assumed to be external.*
|
356
398
|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
399
|
+
```ruby
|
400
|
+
# no options
|
401
|
+
docx.p do
|
402
|
+
link 'Example Text', 'https://wwww.example.com'
|
403
|
+
end
|
404
|
+
|
405
|
+
# options via block
|
406
|
+
p do
|
407
|
+
link 'Example Text', 'https://wwww.example.com' do
|
408
|
+
style 'my_style' # sets the style class. defaults to nil.
|
409
|
+
color '0000ff' # sets the color of the text. defaults to 1155cc.
|
410
|
+
size 24 # sets the font size. units in half-points. defaults to nil.
|
411
|
+
bold false # sets whether or not the text will be bold. defaults to false.
|
412
|
+
italic false # sets whether or not the text will be italic. defaults to false.
|
413
|
+
underline true # sets whether or not the text will be underlined. defaults to true.
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
# options via hash
|
418
|
+
p do
|
419
|
+
link 'Example Text', 'https://wwww.example.com', color: '0000ff', underline: false
|
420
|
+
end
|
421
|
+
```
|
378
422
|
|
379
423
|
The `link` command with default properties will produce the following XML output:
|
380
424
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
425
|
+
```xml
|
426
|
+
<w:hyperlink r:id="rId1">
|
427
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
428
|
+
<w:rPr>
|
429
|
+
<w:color w:val="1155cc"/>
|
430
|
+
<w:u w:val="single"/>
|
431
|
+
<w:rtl w:val="0"/>
|
432
|
+
</w:rPr>
|
433
|
+
<w:t xml:space="preserve">Example Text</w:t>
|
434
|
+
</w:r>
|
435
|
+
</w:hyperlink>
|
436
|
+
```
|
391
437
|
|
392
438
|
*Caracal will automatically generate the relationship entries required by the OpenXML standard.*
|
393
439
|
|
394
|
-
|
395
|
-
|
440
|
+
```xml
|
441
|
+
<Relationship Target="https://www.example.com" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" TargetMode="External" Id="rId1"/>
|
442
|
+
```
|
443
|
+
|
396
444
|
### Images
|
397
445
|
|
398
446
|
Images can be added by using the `img` method. The method accepts several optional parameters for controlling the style and placement of the asset.
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
447
|
+
|
448
|
+
```ruby
|
449
|
+
# options via block
|
450
|
+
docx.img image_url('example.png') do
|
451
|
+
width 396 # sets the image width. units specified in pixels.
|
452
|
+
height 216 # sets the image height. units specified in pixels.
|
453
|
+
align :right # controls the justification of the image. default is :left.
|
454
|
+
top 10 # sets the top margin. units specified in pixels.
|
455
|
+
bottom 10 # sets the bottom margin. units specified in pixels.
|
456
|
+
left 10 # sets the left margin. units specified in pixels.
|
457
|
+
right 10 # sets the right margin. units specified in pixels.
|
458
|
+
end
|
459
|
+
|
460
|
+
# options via hash
|
461
|
+
docx.img image_url('example.png'), width: 396, height: 216, align: :right
|
462
|
+
```
|
413
463
|
|
414
464
|
The `img` command with default properties will produce the following XML output:
|
415
465
|
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
466
|
+
```xml
|
467
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
468
|
+
<w:pPr>
|
469
|
+
<w:spacing w:lineRule="auto" w:line="276"/>
|
470
|
+
<w:contextualSpacing w:val="0"/>
|
471
|
+
<w:jc w:val="right"/>
|
472
|
+
<w:rPr/>
|
473
|
+
</w:pPr>
|
474
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
475
|
+
<w:drawing>
|
476
|
+
<wp:inline distR="114300" distT="114300" distB="114300" distL="114300">
|
477
|
+
<wp:extent cy="2743200" cx="5029200"/>
|
478
|
+
<wp:effectExtent t="0" b="0" r="0" l="0"/>
|
479
|
+
<wp:docPr id="1" name="image00.png"/>
|
480
|
+
<a:graphic>
|
481
|
+
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
|
482
|
+
<pic:pic>
|
483
|
+
<pic:nvPicPr>
|
484
|
+
<pic:cNvPr id="0" name="image00.png"/>
|
485
|
+
<pic:cNvPicPr preferRelativeResize="0"/>
|
486
|
+
</pic:nvPicPr>
|
487
|
+
<pic:blipFill>
|
488
|
+
<a:blip r:embed="rId5"/>
|
489
|
+
<a:srcRect t="0" b="0" r="0" l="0"/>
|
490
|
+
<a:stretch>
|
491
|
+
<a:fillRect/>
|
492
|
+
</a:stretch>
|
493
|
+
</pic:blipFill>
|
494
|
+
<pic:spPr>
|
495
|
+
<a:xfrm>
|
496
|
+
<a:ext cy="2743200" cx="5029200"/>
|
497
|
+
</a:xfrm>
|
498
|
+
<a:prstGeom prst="rect"/>
|
499
|
+
<a:ln/>
|
500
|
+
</pic:spPr>
|
501
|
+
</pic:pic>
|
502
|
+
</a:graphicData>
|
503
|
+
</a:graphic>
|
504
|
+
</wp:inline>
|
505
|
+
</w:drawing>
|
506
|
+
</w:r>
|
507
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
508
|
+
<w:rPr>
|
509
|
+
<w:rtl w:val="0"/>
|
510
|
+
</w:rPr>
|
511
|
+
</w:r>
|
512
|
+
</w:p>
|
513
|
+
```
|
514
|
+
|
463
515
|
*Caracal will automatically generate the relationship entries required by the OpenXML standard.*
|
464
516
|
|
465
|
-
|
466
|
-
|
517
|
+
```xml
|
518
|
+
<Relationship Target="media/image00.png" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Id="rId5"/>
|
519
|
+
```
|
520
|
+
|
467
521
|
### Rules
|
468
522
|
|
469
523
|
Horizontal rules can be added using the `hr` method. The method accepts several optional parameters for controlling the style of the rule.
|
470
524
|
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
525
|
+
```ruby
|
526
|
+
# no options
|
527
|
+
docx.hr # defaults to a thin, single line.
|
528
|
+
|
529
|
+
# options via block
|
530
|
+
docx.hr do
|
531
|
+
color '333333' # controls the color of the line. defaults to auto.
|
532
|
+
line :double # controls the line style (single or double). defaults to single.
|
533
|
+
size 8 # controls the thickness of the line. units in 1/8 points. defaults to 4.
|
534
|
+
spacing 4 # controls the spacing around the line. units in points. defaults to 1.
|
535
|
+
end
|
536
|
+
|
537
|
+
# options via hash
|
538
|
+
docx.hr color: '333333', line: :double, size: 8, spacing: 2
|
539
|
+
```
|
540
|
+
|
485
541
|
The `hr` command with default properties will produce the following XML output:
|
486
542
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
543
|
+
```xml
|
544
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
545
|
+
<w:pPr>
|
546
|
+
<w:pBdr>
|
547
|
+
<w:top w:color="auto" w:space="1" w:val="single" w:sz="4"/>
|
548
|
+
</w:pBdr>
|
549
|
+
</w:pPr>
|
550
|
+
</w:p>
|
551
|
+
```
|
494
552
|
|
495
553
|
### Ordered Lists
|
496
554
|
|
497
555
|
Ordered lists can be added using the `ol` and `li` methods. The `li` method substantially follows the same rules as the the `p` method; here, simpler examples are demonstrated.
|
498
556
|
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
557
|
+
```ruby
|
558
|
+
docx.ol do
|
559
|
+
li 'First item'
|
560
|
+
li 'Second item'
|
561
|
+
end
|
562
|
+
```
|
563
|
+
|
504
564
|
The `ol` and `li` commands with default properties will produce the following XML (assuming the ordered list styles have the abstractNumId=2 in the `numbering.xml` file).
|
505
565
|
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
566
|
+
```xml
|
567
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
568
|
+
<w:pPr>
|
569
|
+
<w:numPr>
|
570
|
+
<w:ilvl w:val="0"/>
|
571
|
+
<w:numId w:val="2"/>
|
572
|
+
</w:numPr>
|
573
|
+
<w:ind w:left="720" w:hanging="359"/>
|
574
|
+
<w:contextualSpacing w:val="1"/>
|
575
|
+
<w:rPr>
|
576
|
+
<w:u w:val="none"/>
|
577
|
+
</w:rPr>
|
578
|
+
</w:pPr>
|
579
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
580
|
+
<w:rPr>
|
581
|
+
<w:rtl w:val="0"/>
|
582
|
+
</w:rPr>
|
583
|
+
<w:t xml:space="preserve">First item</w:t>
|
584
|
+
</w:r>
|
585
|
+
</w:p>
|
586
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
587
|
+
<w:pPr>
|
588
|
+
<w:numPr>
|
589
|
+
<w:ilvl w:val="0"/>
|
590
|
+
<w:numId w:val="2"/>
|
591
|
+
</w:numPr>
|
592
|
+
<w:ind w:left="720" w:hanging="359"/>
|
593
|
+
<w:contextualSpacing w:val="1"/>
|
594
|
+
<w:rPr>
|
595
|
+
<w:u w:val="none"/>
|
596
|
+
</w:rPr>
|
597
|
+
</w:pPr>
|
598
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
599
|
+
<w:rPr>
|
600
|
+
<w:rtl w:val="0"/>
|
601
|
+
</w:rPr>
|
602
|
+
<w:t xml:space="preserve">Second item</w:t>
|
603
|
+
</w:r>
|
604
|
+
</w:p>
|
605
|
+
```
|
606
|
+
|
545
607
|
### Unordered Lists
|
546
608
|
|
547
609
|
Unordered lists can be added using the `ul` and `li` methods. The `li` method substantially follows the same rules as the the `p` method; here, simpler examples are demonstrated.
|
548
610
|
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
611
|
+
```ruby
|
612
|
+
docx.ul do
|
613
|
+
li 'First item'
|
614
|
+
li 'Second item'
|
615
|
+
end
|
616
|
+
```
|
617
|
+
|
554
618
|
The `ul` and `li` commands with default properties will produce the following XML (assuming the ordered list styles have the abstractNumId=1 in the `numbering.xml` file).
|
555
619
|
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
620
|
+
```xml
|
621
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
622
|
+
<w:pPr>
|
623
|
+
<w:numPr>
|
624
|
+
<w:ilvl w:val="0"/>
|
625
|
+
<w:numId w:val="1"/>
|
626
|
+
</w:numPr>
|
627
|
+
<w:ind w:left="720" w:hanging="359"/>
|
628
|
+
<w:contextualSpacing w:val="1"/>
|
629
|
+
<w:rPr>
|
630
|
+
<w:u w:val="none"/>
|
631
|
+
</w:rPr>
|
632
|
+
</w:pPr>
|
633
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
634
|
+
<w:rPr>
|
635
|
+
<w:rtl w:val="0"/>
|
636
|
+
</w:rPr>
|
637
|
+
<w:t xml:space="preserve">First item</w:t>
|
638
|
+
</w:r>
|
639
|
+
</w:p>
|
640
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
641
|
+
<w:pPr>
|
642
|
+
<w:numPr>
|
643
|
+
<w:ilvl w:val="0"/>
|
644
|
+
<w:numId w:val="1"/>
|
645
|
+
</w:numPr>
|
646
|
+
<w:ind w:left="720" w:hanging="359"/>
|
647
|
+
<w:contextualSpacing w:val="1"/>
|
648
|
+
<w:rPr>
|
649
|
+
<w:u w:val="none"/>
|
650
|
+
</w:rPr>
|
651
|
+
</w:pPr>
|
652
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
653
|
+
<w:rPr>
|
654
|
+
<w:rtl w:val="0"/>
|
655
|
+
</w:rPr>
|
656
|
+
<w:t xml:space="preserve">Second item</w:t>
|
657
|
+
</w:r>
|
658
|
+
</w:p>
|
659
|
+
```
|
660
|
+
|
595
661
|
### Tables
|
596
662
|
|
597
663
|
Tables can be added using the `table` method. The method accepts several optional paramters to control the layout and style of the table cells.
|
598
664
|
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
665
|
+
```ruby
|
666
|
+
table data, border: 8 do
|
667
|
+
cell_style rows(0), background_color: '4a86e8', bold: true
|
668
|
+
end
|
669
|
+
```
|
670
|
+
|
603
671
|
Given the a data structure with two rows and five columns, the `table` method would produce the following XML:
|
604
672
|
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
673
|
+
```xml
|
674
|
+
<w:tbl>
|
675
|
+
<w:tblPr>
|
676
|
+
<w:tblStyle w:val="KixTable1"/>
|
677
|
+
<w:bidiVisual w:val="0"/>
|
678
|
+
<w:tblW w:w="10800.0" w:type="dxa"/>
|
679
|
+
<w:jc w:val="left"/>
|
680
|
+
<w:tblBorders>
|
681
|
+
<w:top w:color="000000" w:space="0" w:val="single" w:sz="8"/>
|
682
|
+
<w:left w:color="000000" w:space="0" w:val="single" w:sz="8"/>
|
683
|
+
<w:bottom w:color="000000" w:space="0" w:val="single" w:sz="8"/>
|
684
|
+
<w:right w:color="000000" w:space="0" w:val="single" w:sz="8"/>
|
685
|
+
<w:insideH w:color="000000" w:space="0" w:val="single" w:sz="8"/>
|
686
|
+
<w:insideV w:color="000000" w:space="0" w:val="single" w:sz="8"/>
|
687
|
+
</w:tblBorders>
|
688
|
+
<w:tblLayout w:type="fixed"/>
|
689
|
+
<w:tblLook w:val="0600"/>
|
690
|
+
</w:tblPr>
|
691
|
+
<w:tblGrid>
|
692
|
+
<w:gridCol w:w="2160"/>
|
693
|
+
<w:gridCol w:w="2160"/>
|
694
|
+
<w:gridCol w:w="2160"/>
|
695
|
+
<w:gridCol w:w="2160"/>
|
696
|
+
<w:gridCol w:w="2160"/>
|
697
|
+
<w:tblGridChange w:id="0">
|
622
698
|
<w:tblGrid>
|
623
699
|
<w:gridCol w:w="2160"/>
|
624
700
|
<w:gridCol w:w="2160"/>
|
625
701
|
<w:gridCol w:w="2160"/>
|
626
702
|
<w:gridCol w:w="2160"/>
|
627
703
|
<w:gridCol w:w="2160"/>
|
628
|
-
<w:tblGridChange w:id="0">
|
629
|
-
<w:tblGrid>
|
630
|
-
<w:gridCol w:w="2160"/>
|
631
|
-
<w:gridCol w:w="2160"/>
|
632
|
-
<w:gridCol w:w="2160"/>
|
633
|
-
<w:gridCol w:w="2160"/>
|
634
|
-
<w:gridCol w:w="2160"/>
|
635
|
-
</w:tblGrid>
|
636
|
-
</w:tblGridChange>
|
637
704
|
</w:tblGrid>
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
</w:
|
664
|
-
</w:
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
</w:
|
690
|
-
</w:
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
</w:
|
716
|
-
</w:
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
</w:
|
742
|
-
</w:
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
</w:
|
768
|
-
</w:
|
769
|
-
</w:
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
</w:
|
793
|
-
</w:
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
</w:
|
816
|
-
</w:
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
</w:
|
839
|
-
</w:
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
</w:
|
862
|
-
</w:
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
</w:
|
885
|
-
</w:
|
886
|
-
</w:
|
887
|
-
|
705
|
+
</w:tblGridChange>
|
706
|
+
</w:tblGrid>
|
707
|
+
<w:tr>
|
708
|
+
<w:tc>
|
709
|
+
<w:tcPr>
|
710
|
+
<w:shd w:fill="4a86e8"/>
|
711
|
+
<w:tcMar>
|
712
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
713
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
714
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
715
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
716
|
+
</w:tcMar>
|
717
|
+
</w:tcPr>
|
718
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
719
|
+
<w:pPr>
|
720
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
721
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
722
|
+
<w:contextualSpacing w:val="0"/>
|
723
|
+
</w:pPr>
|
724
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
725
|
+
<w:rPr>
|
726
|
+
<w:b w:val="1"/>
|
727
|
+
<w:color w:val="ffffff"/>
|
728
|
+
<w:rtl w:val="0"/>
|
729
|
+
</w:rPr>
|
730
|
+
<w:t xml:space="preserve">Field</w:t>
|
731
|
+
</w:r>
|
732
|
+
</w:p>
|
733
|
+
</w:tc>
|
734
|
+
<w:tc>
|
735
|
+
<w:tcPr>
|
736
|
+
<w:shd w:fill="4a86e8"/>
|
737
|
+
<w:tcMar>
|
738
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
739
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
740
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
741
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
742
|
+
</w:tcMar>
|
743
|
+
</w:tcPr>
|
744
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
745
|
+
<w:pPr>
|
746
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
747
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
748
|
+
<w:contextualSpacing w:val="0"/>
|
749
|
+
</w:pPr>
|
750
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
751
|
+
<w:rPr>
|
752
|
+
<w:b w:val="1"/>
|
753
|
+
<w:color w:val="ffffff"/>
|
754
|
+
<w:rtl w:val="0"/>
|
755
|
+
</w:rPr>
|
756
|
+
<w:t xml:space="preserve">Response</w:t>
|
757
|
+
</w:r>
|
758
|
+
</w:p>
|
759
|
+
</w:tc>
|
760
|
+
<w:tc>
|
761
|
+
<w:tcPr>
|
762
|
+
<w:shd w:fill="4a86e8"/>
|
763
|
+
<w:tcMar>
|
764
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
765
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
766
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
767
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
768
|
+
</w:tcMar>
|
769
|
+
</w:tcPr>
|
770
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
771
|
+
<w:pPr>
|
772
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
773
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
774
|
+
<w:contextualSpacing w:val="0"/>
|
775
|
+
</w:pPr>
|
776
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
777
|
+
<w:rPr>
|
778
|
+
<w:b w:val="1"/>
|
779
|
+
<w:color w:val="ffffff"/>
|
780
|
+
<w:rtl w:val="0"/>
|
781
|
+
</w:rPr>
|
782
|
+
<w:t xml:space="preserve">Perf. Quality</w:t>
|
783
|
+
</w:r>
|
784
|
+
</w:p>
|
785
|
+
</w:tc>
|
786
|
+
<w:tc>
|
787
|
+
<w:tcPr>
|
788
|
+
<w:shd w:fill="4a86e8"/>
|
789
|
+
<w:tcMar>
|
790
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
791
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
792
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
793
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
794
|
+
</w:tcMar>
|
795
|
+
</w:tcPr>
|
796
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
797
|
+
<w:pPr>
|
798
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
799
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
800
|
+
<w:contextualSpacing w:val="0"/>
|
801
|
+
</w:pPr>
|
802
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
803
|
+
<w:rPr>
|
804
|
+
<w:b w:val="1"/>
|
805
|
+
<w:color w:val="ffffff"/>
|
806
|
+
<w:rtl w:val="0"/>
|
807
|
+
</w:rPr>
|
808
|
+
<w:t xml:space="preserve">Data Quality</w:t>
|
809
|
+
</w:r>
|
810
|
+
</w:p>
|
811
|
+
</w:tc>
|
812
|
+
<w:tc>
|
813
|
+
<w:tcPr>
|
814
|
+
<w:shd w:fill="4a86e8"/>
|
815
|
+
<w:tcMar>
|
816
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
817
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
818
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
819
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
820
|
+
</w:tcMar>
|
821
|
+
</w:tcPr>
|
822
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
823
|
+
<w:pPr>
|
824
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
825
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
826
|
+
<w:contextualSpacing w:val="0"/>
|
827
|
+
</w:pPr>
|
828
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
829
|
+
<w:rPr>
|
830
|
+
<w:b w:val="1"/>
|
831
|
+
<w:color w:val="ffffff"/>
|
832
|
+
<w:rtl w:val="0"/>
|
833
|
+
</w:rPr>
|
834
|
+
<w:t xml:space="preserve">State</w:t>
|
835
|
+
</w:r>
|
836
|
+
</w:p>
|
837
|
+
</w:tc>
|
838
|
+
</w:tr>
|
839
|
+
<w:tr>
|
840
|
+
<w:tc>
|
841
|
+
<w:tcPr>
|
842
|
+
<w:tcMar>
|
843
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
844
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
845
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
846
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
847
|
+
</w:tcMar>
|
848
|
+
</w:tcPr>
|
849
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
850
|
+
<w:pPr>
|
851
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
852
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
853
|
+
<w:contextualSpacing w:val="0"/>
|
854
|
+
</w:pPr>
|
855
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
856
|
+
<w:rPr>
|
857
|
+
<w:rtl w:val="0"/>
|
858
|
+
</w:rPr>
|
859
|
+
<w:t xml:space="preserve">After-Hours trading</w:t>
|
860
|
+
</w:r>
|
861
|
+
</w:p>
|
862
|
+
</w:tc>
|
863
|
+
<w:tc>
|
864
|
+
<w:tcPr>
|
865
|
+
<w:tcMar>
|
866
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
867
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
868
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
869
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
870
|
+
</w:tcMar>
|
871
|
+
</w:tcPr>
|
872
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
873
|
+
<w:pPr>
|
874
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
875
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
876
|
+
<w:contextualSpacing w:val="0"/>
|
877
|
+
</w:pPr>
|
878
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
879
|
+
<w:rPr>
|
880
|
+
<w:rtl w:val="0"/>
|
881
|
+
</w:rPr>
|
882
|
+
<w:t xml:space="preserve">Yes</w:t>
|
883
|
+
</w:r>
|
884
|
+
</w:p>
|
885
|
+
</w:tc>
|
886
|
+
<w:tc>
|
887
|
+
<w:tcPr>
|
888
|
+
<w:tcMar>
|
889
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
890
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
891
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
892
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
893
|
+
</w:tcMar>
|
894
|
+
</w:tcPr>
|
895
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
896
|
+
<w:pPr>
|
897
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
898
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
899
|
+
<w:contextualSpacing w:val="0"/>
|
900
|
+
</w:pPr>
|
901
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
902
|
+
<w:rPr>
|
903
|
+
<w:rtl w:val="0"/>
|
904
|
+
</w:rPr>
|
905
|
+
<w:t xml:space="preserve">B</w:t>
|
906
|
+
</w:r>
|
907
|
+
</w:p>
|
908
|
+
</w:tc>
|
909
|
+
<w:tc>
|
910
|
+
<w:tcPr>
|
911
|
+
<w:tcMar>
|
912
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
913
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
914
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
915
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
916
|
+
</w:tcMar>
|
917
|
+
</w:tcPr>
|
918
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
919
|
+
<w:pPr>
|
920
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
921
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
922
|
+
<w:contextualSpacing w:val="0"/>
|
923
|
+
</w:pPr>
|
924
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
925
|
+
<w:rPr>
|
926
|
+
<w:rtl w:val="0"/>
|
927
|
+
</w:rPr>
|
928
|
+
<w:t xml:space="preserve">B</w:t>
|
929
|
+
</w:r>
|
930
|
+
</w:p>
|
931
|
+
</w:tc>
|
932
|
+
<w:tc>
|
933
|
+
<w:tcPr>
|
934
|
+
<w:tcMar>
|
935
|
+
<w:top w:w="100.0" w:type="dxa"/>
|
936
|
+
<w:left w:w="100.0" w:type="dxa"/>
|
937
|
+
<w:bottom w:w="100.0" w:type="dxa"/>
|
938
|
+
<w:right w:w="100.0" w:type="dxa"/>
|
939
|
+
</w:tcMar>
|
940
|
+
</w:tcPr>
|
941
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
942
|
+
<w:pPr>
|
943
|
+
<w:spacing w:lineRule="auto" w:after="0" w:line="240" w:before="0"/>
|
944
|
+
<w:ind w:left="0" w:firstLine="0"/>
|
945
|
+
<w:contextualSpacing w:val="0"/>
|
946
|
+
</w:pPr>
|
947
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
948
|
+
<w:rPr>
|
949
|
+
<w:rtl w:val="0"/>
|
950
|
+
</w:rPr>
|
951
|
+
<w:t xml:space="preserve">published</w:t>
|
952
|
+
</w:r>
|
953
|
+
</w:p>
|
954
|
+
</w:tc>
|
955
|
+
</w:tr>
|
956
|
+
</w:tbl>
|
957
|
+
```
|
958
|
+
|
888
959
|
### Line Breaks
|
889
960
|
|
890
961
|
Line breaks can be added via the `br` method. The method accepts no parameters.
|
891
962
|
|
892
|
-
|
893
|
-
|
963
|
+
```ruby
|
964
|
+
docx.br # adds a blank line using the default paragrpah style.
|
965
|
+
```
|
966
|
+
|
894
967
|
The `br` command will produce the folowing XML:
|
895
968
|
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
969
|
+
```xml
|
970
|
+
<w:p w:rsidP="00000000" w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000" w:rsidRDefault="00000000">
|
971
|
+
<w:pPr>
|
972
|
+
<w:contextualSpacing w:val="0"/>
|
973
|
+
</w:pPr>
|
974
|
+
<w:r w:rsidRPr="00000000" w:rsidR="00000000" w:rsidDel="00000000">
|
975
|
+
<w:rPr>
|
976
|
+
<w:rtl w:val="0"/>
|
977
|
+
</w:rPr>
|
978
|
+
</w:r>
|
979
|
+
</w:p>
|
980
|
+
```
|
981
|
+
|
907
982
|
|
908
983
|
## Template Rendering
|
909
984
|
|