removed Paragraph from readme, and put it in the Wiki
This commit is contained in:
82
README.md
82
README.md
@ -19,13 +19,6 @@
|
|||||||
- [Install](#)
|
- [Install](#)
|
||||||
- [Usage](#)
|
- [Usage](#)
|
||||||
- [Create simple Word Document](#)
|
- [Create simple Word Document](#)
|
||||||
- [Create Paragraph](#)
|
|
||||||
- [Styles](#)
|
|
||||||
- [Heading1 - Heading5](#)
|
|
||||||
- [Title](#)
|
|
||||||
- [Text Alignment](#)
|
|
||||||
- [Example](#)
|
|
||||||
- [Thematic Break (Page Break)](#)
|
|
||||||
- [Exporting](#)
|
- [Exporting](#)
|
||||||
- [Express](#)
|
- [Express](#)
|
||||||
- [Standalone .docx file](#)
|
- [Standalone .docx file](#)
|
||||||
@ -96,81 +89,6 @@ revision
|
|||||||
|
|
||||||
You can mix and match whatever properties you want, or provide no properties.
|
You can mix and match whatever properties you want, or provide no properties.
|
||||||
|
|
||||||
## Create Paragraph
|
|
||||||
Every text block in OpenXML is organised in paragraphs. You can add more text to the paragraph by doing this:
|
|
||||||
```js
|
|
||||||
var paragraph = new docx.Paragraph(),
|
|
||||||
```
|
|
||||||
```js
|
|
||||||
var text = new docx.TextRun('Lorem Ipsum Foo Bar');
|
|
||||||
var paragraph = new docx.Paragraph();
|
|
||||||
paragraph.addText(text);
|
|
||||||
```
|
|
||||||
```js
|
|
||||||
var paragraph = new docx.Paragraph("Short hand notation for adding text.");
|
|
||||||
```
|
|
||||||
|
|
||||||
After you create the paragraph, you must add the paragraph into the `document`:
|
|
||||||
```js
|
|
||||||
doc.addParagraph(paragraph);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Styles
|
|
||||||
Styles is a very important part of the look of a word document. At the moment, only headings and title is supported, but son the rest will be supported along with custom styles!
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Heading1 - Heading5
|
|
||||||
```js
|
|
||||||
paragraph.heading1();
|
|
||||||
paragraph.heading2();
|
|
||||||
paragraph.heading3();
|
|
||||||
paragraph.heading4();
|
|
||||||
paragraph.heading5();
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Title
|
|
||||||
```js
|
|
||||||
paragraph.title();
|
|
||||||
```
|
|
||||||
|
|
||||||
### Text Alignment
|
|
||||||
To change the text alignment of a paragraph, for center, left, right or justified:
|
|
||||||
```js
|
|
||||||
paragraph.center();
|
|
||||||
```
|
|
||||||
```js
|
|
||||||
paragraph.left();
|
|
||||||
```
|
|
||||||
```js
|
|
||||||
paragraph.right();
|
|
||||||
```
|
|
||||||
```js
|
|
||||||
paragraph.justified();
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example
|
|
||||||
```js
|
|
||||||
paragraph.heading1().center();
|
|
||||||
```
|
|
||||||
The above will create a `heading 1` which is `centered`.
|
|
||||||
|
|
||||||
### Thematic Break
|
|
||||||
To add a break in the page, simply add `.thematicBreak()` on a paragraph:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var paragraph = new docx.Paragraph("Amazing Heading").heading1().thematicBreak();
|
|
||||||
```
|
|
||||||
The above example will create a heading with a page break directly under it.
|
|
||||||
|
|
||||||
### Page Break
|
|
||||||
To move to a new page (insert a page break), simply add `.pageBreak()` on a paragraph:
|
|
||||||
|
|
||||||
```js
|
|
||||||
var paragraph = new docx.Paragraph("Amazing Heading").heading1().pageBreak();
|
|
||||||
```
|
|
||||||
The above example will create a heading and start a new page immediately afterwards.
|
|
||||||
|
|
||||||
# Exporting
|
# Exporting
|
||||||
Check the Wiki for exporting guide
|
Check the Wiki for exporting guide
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user