forked from python-openxml/python-docx
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steve Canny
committed
Jan 2, 2014
1 parent
e386299
commit 629cadb
Showing
27 changed files
with
557 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
Copyright © 2013 Steve Canny, https://github.com/scanny | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the “Software”), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include HISTORY.rst LICENSE README.rst tox.ini | ||
include tests/*.py | ||
recursive-include features * | ||
recursive-include docx/templates * | ||
recursive-include tests/test_files * | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<h3>Useful Links</h3> | ||
<ul> | ||
<li><a href="http://github.com/python-openxml/python-docx">python-docx @ GitHub</a></li> | ||
<li><a href="http://pypi.python.org/pypi/python-docx">python-docx @ PyPI</a></li> | ||
<li><a href="http://github.com/python-openxml/python-docx/issues">Issue Tracker</a></li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,3 @@ Document objects | |
|
||
.. autoclass:: _Document | ||
:members: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
.. _shape_api: | ||
|
||
Shape-related objects | ||
===================== | ||
|
||
.. currentmodule:: docx.shape | ||
|
||
|
||
|InlineShape| objects | ||
--------------------- | ||
|
||
The ``width`` and ``height`` property of |InlineShape| provide a length object | ||
that is an instance of |Length|. These instances behave like an int, but also | ||
have built-in units conversion properties, e.g.:: | ||
|
||
>>> inline_shape.height | ||
914400 | ||
>>> inline_shape.height.inches | ||
1.0 | ||
|
||
.. autoclass:: InlineShape | ||
:members: height, type, width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
.. _shared_api: | ||
|
||
Shared classes | ||
============== | ||
|
||
.. currentmodule:: docx.shared | ||
|
||
|
||
Length objects | ||
-------------- | ||
|
||
Length values in |docx| are expressed as a standardized |Length| value object. | ||
|Length| is a subclass of |int|, having all the behavior of an |int|. In | ||
addition, it has built-in units conversion properties, e.g.:: | ||
|
||
>>> inline_shape.height | ||
914400 | ||
>>> inline_shape.height.inches | ||
1.0 | ||
|
||
Length objects are constructed using a selection of convenience constructors, | ||
allowing values to be expressed in the units most appropriate to the context. | ||
|
||
.. autoclass:: Length | ||
:members: | ||
:member-order: bysource | ||
|
||
.. autoclass:: Inches | ||
:members: | ||
|
||
.. autoclass:: Cm | ||
:members: | ||
|
||
.. autoclass:: Mm | ||
:members: | ||
|
||
.. autoclass:: Emu | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
.. _table_api: | ||
|
||
Table objects | ||
================ | ||
|
||
Table objects are constructed using the ``add_table()`` method on |Document|. | ||
|
||
Protocol example:: | ||
|
||
table = document.add_table(rows=2, cols=2) | ||
top_left_cell = table.cell(0, 0) | ||
top_left_cell.text = 'foobar' | ||
|
||
# OR | ||
|
||
table = document.add_table(rows=1, cols=2) | ||
table.style = 'LightShading-Accent1' | ||
header_cells = table.rows[0].cells | ||
header_cells[0].text = 'Qty' | ||
header_cells[1].text = 'Desc' | ||
for item in items: | ||
row_cells = table.rows.add().cells | ||
row_cells[0].text = str(item.qty) | ||
row_cells[2].text = item.desc | ||
|
||
|
||
.. currentmodule:: docx.table | ||
|
||
|
||
|Table| objects | ||
--------------- | ||
|
||
.. autoclass:: Table | ||
:members: | ||
|
||
|
||
|_Cell| objects | ||
------------------------ | ||
|
||
.. autoclass:: _Cell | ||
:members: | ||
|
||
|
||
|_Row| objects | ||
-------------- | ||
|
||
.. autoclass:: _Row | ||
:members: | ||
|
||
|
||
|_Column| objects | ||
----------------- | ||
|
||
.. autoclass:: _Column | ||
:members: | ||
|
||
|
||
|_RowCollection| objects | ||
------------------------ | ||
|
||
.. autoclass:: _RowCollection | ||
:members: | ||
|
||
|
||
|_ColumnCollection| objects | ||
--------------------------- | ||
|
||
.. autoclass:: _ColumnCollection | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
.. _text_api: | ||
|
||
Text-related objects | ||
==================== | ||
|
||
.. currentmodule:: docx.text | ||
|
||
|
||
|Paragraph| objects | ||
------------------- | ||
|
||
.. autoclass:: Paragraph | ||
:members: | ||
|
||
|
||
|Run| objects | ||
------------- | ||
|
||
.. autoclass:: Run | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.