Skip to content

Commit ca4dc46

Browse files
committed
IMPROVED : Docs Syntax Highlighting
1 parent f8a067f commit ca4dc46

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

docs/elements.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ complex paragraphs that contain text with different style (some bold,
1313
other italics, etc) or other elements, e.g. images or links. The
1414
syntaxes are as follow:
1515

16-
.. code:: php
16+
.. code-block:: php
1717
1818
$section->addText($text, [$fontStyle], [$paragraphStyle]);
1919
$textrun = $section->createTextRun([$paragraphStyle]);
@@ -28,7 +28,7 @@ style definition.
2828

2929
Inline style examples:
3030

31-
.. code:: php
31+
.. code-block:: php
3232
3333
$fontStyle = array('name' => 'Times New Roman', 'size' => 9);
3434
$paragraphStyle = array('align' => 'both');
@@ -41,7 +41,7 @@ Inline style examples:
4141
4242
Defined style examples:
4343

44-
.. code:: php
44+
.. code-block:: php
4545
4646
$fontStyle = array('color' => '006699', 'size' => 18, 'bold' => true);
4747
$PHPWord->addFontStyle('fStyle', $fontStyle);
@@ -95,7 +95,7 @@ If you want to structure your document or build table of contents, you
9595
need titles or headings. To add a title to the document, use the
9696
``addTitleStyle`` and ``addTitle`` method.
9797

98-
.. code:: php
98+
.. code-block:: php
9999
100100
$PHPWord->addTitleStyle($depth, [$fontStyle], [$paragraphStyle]);
101101
$section->addTitle($text, [$depth]);
@@ -108,7 +108,7 @@ Links
108108

109109
You can add Hyperlinks to the document by using the function addLink:
110110

111-
.. code:: php
111+
.. code-block:: php
112112
113113
$section->addLink($linkSrc, [$linkName], [$fontStyle], [$paragraphStyle]);
114114
@@ -123,7 +123,7 @@ Preserve texts
123123
The ``addPreserveText`` method is used to add a page number or page
124124
count to headers or footers.
125125

126-
.. code:: php
126+
.. code-block:: php
127127
128128
$footer->addPreserveText('Page {PAGE} of {NUMPAGES}.');
129129
@@ -136,7 +136,7 @@ Text breaks
136136
Text breaks are empty new lines. To add text breaks, use the following
137137
syntax. All paramaters are optional.
138138

139-
.. code:: php
139+
.. code-block:: php
140140
141141
$section->addTextBreak([$breakCount], [$fontStyle], [$paragraphStyle]);
142142
@@ -150,7 +150,7 @@ Page breaks
150150
There are two ways to insert a page breaks, using the ``addPageBreak``
151151
method or using the ``pageBreakBefore`` style of paragraph.
152152

153-
::
153+
:: code-block:: php
154154

155155
$section->addPageBreak();
156156

@@ -159,7 +159,7 @@ Lists
159159

160160
To add a list item use the function ``addListItem``.
161161

162-
.. code:: php
162+
.. code-block:: php
163163
164164
$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);
165165
@@ -177,15 +177,15 @@ Tables
177177
To add tables, rows, and cells, use the ``addTable``, ``addRow``, and
178178
``addCell`` methods:
179179

180-
.. code:: php
180+
.. code-block:: php
181181
182182
$table = $section->addTable([$tableStyle]);
183183
$table->addRow([$height], [$rowStyle]);
184184
$cell = $table->addCell($width, [$cellStyle]);
185185
186186
Table style can be defined with ``addTableStyle``:
187187

188-
.. code:: php
188+
.. code-block:: php
189189
190190
$tableStyle = array(
191191
'borderColor' => '006699',
@@ -229,7 +229,7 @@ Cell span
229229
You can span a cell on multiple columns by using ``gridSpan`` or
230230
multiple rows by using ``vMerge``.
231231

232-
.. code:: php
232+
.. code-block:: php
233233
234234
$cell = $table->addCell(200);
235235
$cell->getStyle()->setGridSpan(5);
@@ -246,14 +246,14 @@ image or an image on the internet.
246246

247247
Syntax:
248248

249-
.. code:: php
249+
.. code-block:: php
250250
251251
$section->addImage($src, [$style]);
252252
$section->addMemoryImage($link, [$style]);
253253
254254
Examples:
255255

256-
.. code:: php
256+
.. code-block:: php
257257
258258
$section = $phpWord->createSection();
259259
$section->addImage(
@@ -290,7 +290,7 @@ To add a watermark (or page background image), your section needs a
290290
header reference. After creating a header, you can use the
291291
``addWatermark`` method to add a watermark.
292292

293-
.. code:: php
293+
.. code-block:: php
294294
295295
$section = $PHPWord->createSection();
296296
$header = $section->createHeader();
@@ -302,7 +302,7 @@ Objects
302302
You can add OLE embeddings, such as Excel spreadsheets or PowerPoint
303303
presentations to the document by using ``addObject`` method.
304304

305-
.. code:: php
305+
.. code-block:: php
306306
307307
$section->addObject($src, [$style]);
308308
@@ -313,7 +313,7 @@ To add a table of contents (TOC), you can use the ``addTOC`` method.
313313
Your TOC can only be generated if you have add at least one title (See
314314
"Titles").
315315

316-
.. code:: php
316+
.. code-block:: php
317317
318318
$section->addTOC([$fontStyle], [$tocStyle]);
319319
@@ -331,7 +331,7 @@ use textrun to have better layout.
331331

332332
On textrun:
333333

334-
.. code:: php
334+
.. code-block:: php
335335
336336
$textrun = $section->createTextRun();
337337
$textrun->addText('Lead text.');
@@ -341,7 +341,7 @@ On textrun:
341341
342342
On text:
343343

344-
.. code:: php
344+
.. code-block:: php
345345
346346
$section->addText('Lead text.');
347347
$footnote = $section->createFootnote();

0 commit comments

Comments
 (0)