@@ -13,7 +13,7 @@ complex paragraphs that contain text with different style (some bold,
13
13
other italics, etc) or other elements, e.g. images or links. The
14
14
syntaxes are as follow:
15
15
16
- .. code :: php
16
+ .. code-block :: php
17
17
18
18
$section->addText($text, [$fontStyle], [$paragraphStyle]);
19
19
$textrun = $section->createTextRun([$paragraphStyle]);
@@ -28,7 +28,7 @@ style definition.
28
28
29
29
Inline style examples:
30
30
31
- .. code :: php
31
+ .. code-block :: php
32
32
33
33
$fontStyle = array('name' => 'Times New Roman', 'size' => 9);
34
34
$paragraphStyle = array('align' => 'both');
@@ -41,7 +41,7 @@ Inline style examples:
41
41
42
42
Defined style examples:
43
43
44
- .. code :: php
44
+ .. code-block :: php
45
45
46
46
$fontStyle = array('color' => '006699', 'size' => 18, 'bold' => true);
47
47
$PHPWord->addFontStyle('fStyle', $fontStyle);
@@ -95,7 +95,7 @@ If you want to structure your document or build table of contents, you
95
95
need titles or headings. To add a title to the document, use the
96
96
``addTitleStyle `` and ``addTitle `` method.
97
97
98
- .. code :: php
98
+ .. code-block :: php
99
99
100
100
$PHPWord->addTitleStyle($depth, [$fontStyle], [$paragraphStyle]);
101
101
$section->addTitle($text, [$depth]);
@@ -108,7 +108,7 @@ Links
108
108
109
109
You can add Hyperlinks to the document by using the function addLink:
110
110
111
- .. code :: php
111
+ .. code-block :: php
112
112
113
113
$section->addLink($linkSrc, [$linkName], [$fontStyle], [$paragraphStyle]);
114
114
@@ -123,7 +123,7 @@ Preserve texts
123
123
The ``addPreserveText `` method is used to add a page number or page
124
124
count to headers or footers.
125
125
126
- .. code :: php
126
+ .. code-block :: php
127
127
128
128
$footer->addPreserveText('Page {PAGE} of {NUMPAGES}.');
129
129
@@ -136,7 +136,7 @@ Text breaks
136
136
Text breaks are empty new lines. To add text breaks, use the following
137
137
syntax. All paramaters are optional.
138
138
139
- .. code :: php
139
+ .. code-block :: php
140
140
141
141
$section->addTextBreak([$breakCount], [$fontStyle], [$paragraphStyle]);
142
142
@@ -150,7 +150,7 @@ Page breaks
150
150
There are two ways to insert a page breaks, using the ``addPageBreak ``
151
151
method or using the ``pageBreakBefore `` style of paragraph.
152
152
153
- ::
153
+ :: code-block:: php
154
154
155
155
$section->addPageBreak();
156
156
@@ -159,7 +159,7 @@ Lists
159
159
160
160
To add a list item use the function ``addListItem ``.
161
161
162
- .. code :: php
162
+ .. code-block :: php
163
163
164
164
$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);
165
165
@@ -177,15 +177,15 @@ Tables
177
177
To add tables, rows, and cells, use the ``addTable ``, ``addRow ``, and
178
178
``addCell `` methods:
179
179
180
- .. code :: php
180
+ .. code-block :: php
181
181
182
182
$table = $section->addTable([$tableStyle]);
183
183
$table->addRow([$height], [$rowStyle]);
184
184
$cell = $table->addCell($width, [$cellStyle]);
185
185
186
186
Table style can be defined with ``addTableStyle ``:
187
187
188
- .. code :: php
188
+ .. code-block :: php
189
189
190
190
$tableStyle = array(
191
191
'borderColor' => '006699',
@@ -229,7 +229,7 @@ Cell span
229
229
You can span a cell on multiple columns by using ``gridSpan `` or
230
230
multiple rows by using ``vMerge ``.
231
231
232
- .. code :: php
232
+ .. code-block :: php
233
233
234
234
$cell = $table->addCell(200);
235
235
$cell->getStyle()->setGridSpan(5);
@@ -246,14 +246,14 @@ image or an image on the internet.
246
246
247
247
Syntax:
248
248
249
- .. code :: php
249
+ .. code-block :: php
250
250
251
251
$section->addImage($src, [$style]);
252
252
$section->addMemoryImage($link, [$style]);
253
253
254
254
Examples:
255
255
256
- .. code :: php
256
+ .. code-block :: php
257
257
258
258
$section = $phpWord->createSection();
259
259
$section->addImage(
@@ -290,7 +290,7 @@ To add a watermark (or page background image), your section needs a
290
290
header reference. After creating a header, you can use the
291
291
``addWatermark `` method to add a watermark.
292
292
293
- .. code :: php
293
+ .. code-block :: php
294
294
295
295
$section = $PHPWord->createSection();
296
296
$header = $section->createHeader();
@@ -302,7 +302,7 @@ Objects
302
302
You can add OLE embeddings, such as Excel spreadsheets or PowerPoint
303
303
presentations to the document by using ``addObject `` method.
304
304
305
- .. code :: php
305
+ .. code-block :: php
306
306
307
307
$section->addObject($src, [$style]);
308
308
@@ -313,7 +313,7 @@ To add a table of contents (TOC), you can use the ``addTOC`` method.
313
313
Your TOC can only be generated if you have add at least one title (See
314
314
"Titles").
315
315
316
- .. code :: php
316
+ .. code-block :: php
317
317
318
318
$section->addTOC([$fontStyle], [$tocStyle]);
319
319
@@ -331,7 +331,7 @@ use textrun to have better layout.
331
331
332
332
On textrun:
333
333
334
- .. code :: php
334
+ .. code-block :: php
335
335
336
336
$textrun = $section->createTextRun();
337
337
$textrun->addText('Lead text.');
@@ -341,7 +341,7 @@ On textrun:
341
341
342
342
On text:
343
343
344
- .. code :: php
344
+ .. code-block :: php
345
345
346
346
$section->addText('Lead text.');
347
347
$footnote = $section->createFootnote();
0 commit comments