Skip to content

Commit 1635c83

Browse files
committed
Docs: Update documentation
1 parent 0f79eb5 commit 1635c83

File tree

9 files changed

+368
-248
lines changed

9 files changed

+368
-248
lines changed

docs/elements.rst

Lines changed: 68 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,62 @@
33
Elements
44
========
55

6-
Below are the matrix of element availability in each container. The column shows
7-
the containers while the rows lists the elements.
8-
9-
+-----+---------------+---------+--------+--------+------+----------+----------+
10-
| Num | Element | Section | Header | Footer | Cell | Text Run | Footnote |
11-
+=====+===============+=========+========+========+======+==========+==========+
12-
| 1 | Text | v | v | v | v | v | v |
13-
+-----+---------------+---------+--------+--------+------+----------+----------+
14-
| 2 | Text Run | v | v | v | v | \- | \- |
15-
+-----+---------------+---------+--------+--------+------+----------+----------+
16-
| 3 | Link | v | v | v | v | v | v |
17-
+-----+---------------+---------+--------+--------+------+----------+----------+
18-
| 4 | Title | v | ? | ? | ? | ? | ? |
19-
+-----+---------------+---------+--------+--------+------+----------+----------+
20-
| 5 | Preserve Text | ? | v | v | v\* | ? | ? |
21-
+-----+---------------+---------+--------+--------+------+----------+----------+
22-
| 6 | Text Break | v | v | v | v | v | v |
23-
+-----+---------------+---------+--------+--------+------+----------+----------+
24-
| 7 | Page Break | v | \- | \- | \- | \- | \- |
25-
+-----+---------------+---------+--------+--------+------+----------+----------+
26-
| 8 | List | v | v | v | v | \- | \- |
27-
+-----+---------------+---------+--------+--------+------+----------+----------+
28-
| 9 | Table | v | v | v | ? | \- | \- |
29-
+-----+---------------+---------+--------+--------+------+----------+----------+
30-
| 10 | Image | v | v | v | v | v | v |
31-
+-----+---------------+---------+--------+--------+------+----------+----------+
32-
| 11 | Watermark | \- | v | \- | \- | \- | \- |
33-
+-----+---------------+---------+--------+--------+------+----------+----------+
34-
| 12 | Object | v | v | v | v | v | v |
35-
+-----+---------------+---------+--------+--------+------+----------+----------+
36-
| 13 | TOC | v | \- | \- | \- | \- | \- |
37-
+-----+---------------+---------+--------+--------+------+----------+----------+
38-
| 14 | Footnote | v | \- | \- | v\*\*| v\*\* | \- |
39-
+-----+---------------+---------+--------+--------+------+----------+----------+
40-
| 15 | Endnote | v | \- | \- | v\*\*| v\*\* | \- |
41-
+-----+---------------+---------+--------+--------+------+----------+----------+
42-
| 16 | CheckBox | v | v | v | v | ? | ? |
43-
+-----+---------------+---------+--------+--------+------+----------+----------+
6+
Below are the matrix of element availability in each container. The
7+
column shows the containers while the rows lists the elements.
8+
9+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
10+
| Num | Element | Section | Header | Footer | Cell | Text Run | Footnote |
11+
+=======+=================+===========+==========+==========+=========+============+============+
12+
| 1 | Text | v | v | v | v | v | v |
13+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
14+
| 2 | Text Run | v | v | v | v | - | - |
15+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
16+
| 3 | Link | v | v | v | v | v | v |
17+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
18+
| 4 | Title | v | ? | ? | ? | ? | ? |
19+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
20+
| 5 | Preserve Text | ? | v | v | v\* | ? | ? |
21+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
22+
| 6 | Text Break | v | v | v | v | v | v |
23+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
24+
| 7 | Page Break | v | - | - | - | - | - |
25+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
26+
| 8 | List | v | v | v | v | - | - |
27+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
28+
| 9 | Table | v | v | v | ? | - | - |
29+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
30+
| 10 | Image | v | v | v | v | v | v |
31+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
32+
| 11 | Watermark | - | v | - | - | - | - |
33+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
34+
| 12 | Object | v | v | v | v | v | v |
35+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
36+
| 13 | TOC | v | - | - | - | - | - |
37+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
38+
| 14 | Footnote | v | - | - | v\*\* | v\*\* | - |
39+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
40+
| 15 | Endnote | v | - | - | v\*\* | v\*\* | - |
41+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
42+
| 16 | CheckBox | v | v | v | v | ? | ? |
43+
+-------+-----------------+-----------+----------+----------+---------+------------+------------+
4444

4545
Legend:
4646

47-
- ``v`` Available
48-
- ``v*`` Available only when inside header/footer
49-
- ``v**`` Available only when inside section
50-
- ``-`` Not available
51-
- ``?`` Should be available
47+
- ``v`` Available
48+
- ``v*`` Available only when inside header/footer
49+
- ``v**`` Available only when inside section
50+
- ``-`` Not available
51+
- ``?`` Should be available
5252

5353
Texts
5454
-----
5555

5656
Text can be added by using ``addText`` and ``addTextRun`` method.
5757
``addText`` is used for creating simple paragraphs that only contain
58-
texts with the same style. ``addTextRun`` is used for creating
59-
complex paragraphs that contain text with different style (some bold,
60-
other italics, etc) or other elements, e.g. images or links. The
61-
syntaxes are as follow:
58+
texts with the same style. ``addTextRun`` is used for creating complex
59+
paragraphs that contain text with different style (some bold, other
60+
italics, etc) or other elements, e.g. images or links. The syntaxes are
61+
as follow:
6262

6363
.. code-block:: php
6464
@@ -200,7 +200,7 @@ method or using the ``pageBreakBefore`` style of paragraph.
200200

201201
:: code-block:: php
202202

203-
$section->addPageBreak();
203+
\\$section->addPageBreak();
204204

205205
Lists
206206
-----
@@ -225,8 +225,8 @@ Parameters:
225225

226226
Advanced usage:
227227

228-
You can also create your own numbering style by changing the ``$listStyle`` parameter
229-
with the name of your numbering style.
228+
You can also create your own numbering style by changing the
229+
``$listStyle`` parameter with the name of your numbering style.
230230

231231
.. code-block:: php
232232
@@ -246,11 +246,14 @@ with the name of your numbering style.
246246
Level styles:
247247

248248
- ``start`` Starting value
249-
- ``format`` Numbering format bullet|decimal|upperRoman|lowerRoman|upperLetter|lowerLetter
249+
- ``format`` Numbering format
250+
bullet\|decimal\|upperRoman\|lowerRoman\|upperLetter\|lowerLetter
250251
- ``restart`` Restart numbering level symbol
251-
- ``suffix`` Content between numbering symbol and paragraph text tab|space|nothing
252-
- ``text`` Numbering level text e.g. %1 for nonbullet or bullet character
253-
- ``align`` Numbering symbol align left|center|right|both
252+
- ``suffix`` Content between numbering symbol and paragraph text
253+
tab\|space\|nothing
254+
- ``text`` Numbering level text e.g. %1 for nonbullet or bullet
255+
character
256+
- ``align`` Numbering symbol align left\|center\|right\|both
254257
- ``left`` See paragraph style
255258
- ``hanging`` See paragraph style
256259
- ``tabPos`` See paragraph style
@@ -326,15 +329,15 @@ See ``Sample_09_Tables.php`` for more code sample.
326329
Images
327330
------
328331

329-
To add an image, use the ``addImage`` method to sections, headers, footers,
330-
textruns, or table cells.
332+
To add an image, use the ``addImage`` method to sections, headers,
333+
footers, textruns, or table cells.
331334

332335
.. code-block:: php
333336
334337
$section->addImage($src, [$style]);
335338
336-
- `source` String path to a local image or URL of a remote image
337-
- `styles` Array fo styles for the image. See below.
339+
- source String path to a local image or URL of a remote image
340+
- styles Array fo styles for the image. See below.
338341

339342
Examples:
340343

@@ -419,10 +422,10 @@ Options for ``$tocStyle``:
419422
Footnotes & endnotes
420423
--------------------
421424

422-
You can create footnotes with ``addFootnote`` and endnotes with ``addEndnote``
423-
in texts or textruns, but it's recommended to use textrun to have better layout.
424-
You can use ``addText``, ``addLink``, ``addTextBreak``, ``addImage``,
425-
``addObject`` on footnotes and endnotes.
425+
You can create footnotes with ``addFootnote`` and endnotes with
426+
``addEndnote`` in texts or textruns, but it's recommended to use textrun
427+
to have better layout. You can use ``addText``, ``addLink``,
428+
``addTextBreak``, ``addImage``, ``addObject`` on footnotes and endnotes.
426429

427430
On textrun:
428431

@@ -448,9 +451,9 @@ On text:
448451
$footnote = $section->addFootnote();
449452
$footnote->addText('Footnote text.');
450453
451-
The footnote reference number will be displayed with decimal number starting
452-
from 1. This number use ``FooterReference`` style which you can redefine by
453-
``addFontStyle`` method. Default value for this style is
454+
The footnote reference number will be displayed with decimal number
455+
starting from 1. This number use ``FooterReference`` style which you can
456+
redefine by ``addFontStyle`` method. Default value for this style is
454457
``array('superScript' => true)``;
455458

456459
Checkboxes

docs/general.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ This option sets
6767
and
6868
`XMLWriter::setIndentString <http://www.php.net/manual/en/function.xmlwriter-set-indent-string.php>`__.
6969
The default value of this option is ``true`` (compatible), which is
70-
`required for OpenOffice <https://github.com/PHPOffice/PHPWord/issues/103>`__ to
70+
`required for
71+
OpenOffice <https://github.com/PHPOffice/PHPWord/issues/103>`__ to
7172
render OOXML document correctly. You can set this option to ``false``
7273
during development to make the resulting XML file easier to read.
7374

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Format (RTF).
2323
containers
2424
elements
2525
templates
26+
writersreaders
2627
recipes
2728
faq
2829
credits

0 commit comments

Comments
 (0)