genebot/rocx — pull request #24 by genebot (2014-06-23 13:51:21+00:00)
Title: Sections [#23]

_From the docs:_
> WordprocessingML does not natively store the concept of pages, since it is based on paragraphs and runs (which are laid out on to pages by consumers of this content). However, although there is no concept of storing pages in the WordprocessingML format, it is often necessary to store information about a page or group of pages in a document, in order to store information that is to be used to format the pages on which a set of paragraphs appear. In WordprocessingML, this information is stored via the use of sections.

> In WordprocessingML, sections are groupings of paragraphs that have a specific set of properties used to define the pages on which the text appears, as well as other section-level (applying to all paragraphs' appearance) properties.

To define a section, section-level properties go in a `w:sectPr` element inside the last paragraph of that section, except for the last section in the document, which has `w:sectPr` as a element of `w:body`.

Planned API:
```ruby
pkg = Rocx::Package.new
section = Rocx::Section.new
section.page_size.width = 12240
section.page_size.height = 15840
pkg.document << section

text = Rocx::Elements::Text.new("Hey I'm a paragraph in this section")
run = Rocx::Elements::Run.new
run << text
paragraph = Rocx::Elements::Paragraph.new
paragraph << run
pkg.document << paragraph
```

which should output

```xml

Hey I'm a paragraph in this section

```

### Tasks:
- [ ] Add the sectPr tag
- [ ] Add bidirectional settings
- [ ] Add borders (bottom, left, right, top)
- [ ] Add column definitions
- [ ] Add document grid settings
- [ ] Add form protection
- [ ] Add line numbering settings
- [ ] Add paper source information
- [ ] Add page margin settings
- [ ] Add page numbering settings
- [ ] Add page size
- [ ] Add printer settings
- [ ] Add RTL gutter option
- [ ] Add text direction settings
- [ ] Add section break type setting
- [ ] Add vertical text setting