-
Notifications
You must be signed in to change notification settings - Fork 1.2k
low-level support for comments & footnotes #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
BayooG
wants to merge
118
commits into
python-openxml:master
Choose a base branch
from
BayooG:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,222
−283
Open
Changes from all commits
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
b6bacc3
comm: comment part added
b66eaf7
link paragraph to comment
53c7ec8
Merge pull request #1 from BayooG/feature/comments_lower_level
BayooG 8668645
no message
1e64f02
acess comment data
e83940b
Merge pull request #2 from BayooG/feature/comments_lower_level
BayooG d5a4aa9
fix a bug /oxml/comments.py
BayooG 2066e17
mini bug
ecb2ee5
mini bug
827a5bf
low level support for footnotes
64d3dfc
footnote id on run element
f1c48ce
Merge pull request #3 from BayooG/feature/low-level_support_for_footnote
BayooG 76612ca
fixes
b0f2442
added wheel
BayooG 70b28a4
Merge branch 'feature/low-level_support_for_footnote'
8098ef8
updated HISTORY.rst
b40c5b4
Merge remote-tracking branch 'origin/master'
0547bbd
V 0.1.3
3205e31
Merge branch 'release/0.1.3' into develop
db913ae
tbl : oxml elements inside tbl
326712b
Merge branch 'release/V.0.1.4' into develop
38ad5c1
Merge branch 'release/V.0.1.4'
a3d1f48
Merge branch 'master' into develop
27d24a0
Merge branch 'develop'
e6abc80
added emf support!
lone-bassel 2e519dd
version update!
lone-bassel cb92773
Merge branch 'release/0.1.5' into develop
lone-bassel 12c26fb
Merge branch 'release/0.1.5'
lone-bassel b04c0a1
CT_TblBoarders added
5685a3f
add tcBorders
0c31ecd
Merge branch 'develop'
c203563
oxml: convert CT_AbstractNum to xmlchemy
lone-bassel cb40382
release 0.1.8
da469e2
Merge branch 'release/0.1.8' into develop
06a11c0
Merge branch 'release/0.1.8'
0b99205
Merge branch 'develop' into feature/EMF_image_support
lone-bassel ea2f511
Version update!
lone-bassel 1f8bcef
Merge branch 'release/0.1.9' into develop
lone-bassel 1d29c42
Merge branch 'release/0.1.9'
lone-bassel 8e93e43
Version Update!
lone-bassel 8cabb18
Merge branch 'release/0.2.0' into develop
lone-bassel d621704
Merge branch 'release/0.2.0'
lone-bassel 84e7f1e
ignore build folder
lone-bassel 5418884
Merge branch 'master' into develop
lone-bassel 348587b
font theme added!
lone-bassel 599452a
Merge branch 'feature/fontTheme' into develop
lone-bassel 8d325eb
docDefalts Styles added!
lone-bassel 720678d
update version
lone-bassel 1eb26c7
Merge branch 'release/0.2.2'
lone-bassel fc5289f
merged with upstream 0.8.10
BayooG 6b8e802
Merge branch 'master' into feature/Headers&Sections
BayooG 6ea78ec
get tables section
BayooG 39bde29
Merge branch 'feature/Headers&Sections' into develop
BayooG e63bbad
Merge branch 'develop'
BayooG c671454
add element property for document object
BayooG 8319e10
added element property to document object
BayooG e1dfaca
Merge branch 'feature/improvements' into develop
BayooG 15aa87b
add abstractNumIds as attrib for document object
BayooG a2406dd
Merge branch 'feature/numbering_things' into develop
BayooG 9965f2c
new attribs for Paragraph & Run
BayooG e68f53b
typos
BayooG 5aadfab
fix- parent type
BayooG 3e8ca7d
ignores
BayooG f29f50e
Merge pull request #4 from BayooG/feature/paragraph_run_addons
BayooG d2e1ca5
Merge branch 'develop'
BayooG ee60190
0.2.4
BayooG ca46e57
append paragraph works
BayooG 32deb06
Merge branch 'hotfix/append_paragraph'
BayooG 4287b07
Merge branch 'hotfix/append_paragraph' into develop
BayooG ff9e3a3
translate tag: "w:noBreakHyphen" to "-"
478edcc
Merge pull request #5 from idtareq/hotfix/noBreakHyphen
BayooG df916b5
Merge branch 'master' into develop
BayooG 8d5fb53
add CONTRIBUTORS.md
BayooG 8df4039
Merge branch 'release/0.2.6'
BayooG f6d7613
Merge branch 'release/0.2.6' into develop
BayooG 8d74621
comment datetime
BayooG 45c5681
update readme
BayooG 1c51430
readme
BayooG 5196e78
Merge pull request #6 from BayooG/hotfix/fix_comment_date
BayooG 6204f12
fix rst formating
BayooG cf8df47
note in readme
BayooG 94266f2
pypi rst format
BayooG 6bdb559
add comments implementation on a run level
BayooG b566337
Merge 'master' into add_comments_on_run_level
BayooG db56c4c
update readme
BayooG 2e68bb3
Merge pull request #7 from BayooG/feature/add_comments_on_run_level
BayooG d3870bc
PYPI DESCRIPTION
BayooG 9cc96ae
Merge branch 'feature/add_comments_on_run_level'
BayooG c5ecc0b
.
BayooG a4dd0f6
pypi publish workflow
BayooG 2941f32
.
BayooG 1ab515d
.
BayooG ce19d55
update __version __
BayooG e982e54
update the action
BayooG 1e8add7
Merge pull request #10 from BayooG/feature/update_develop
BayooG 6048db5
pass comment part in add comment
BayooG 32400b2
update version
BayooG a701b27
Merge branch 'hotfix/pass_comment_part_to_add_comment'
BayooG 2ef9cba
update readme
BayooG dbca07f
update version
BayooG c634b2c
list and edit comments
BayooG 0d4ba9a
update readme
BayooG 1b7ddf0
Merge tag 'v0.2.12' into feature/paragraph_all_runs
BayooG 7082f5d
all runs atrib
15b250e
Merge branch 'develop'
BayooG 6ad5533
prepend and append comment elements
890b807
Merge pull request #11 from baltazarix/fix-commenting-particular-run
BayooG b89d402
Merge branch 'master' into develop
BayooG 94c7152
update version
623ab28
Merge pull request #12 from BayooG/develop
BayooG 9be99b3
Create add_ole_object_to_run func (#13)
ahmadalwareh 87a2993
release version 0.2.15 (#14)
BayooG c7a413a
update version
BayooG 62bfcde
Bugfix and Update README (#15)
ahmadalwareh 5e1be28
update version
BayooG 66528f6
feat: support `fldChar` and `instrText` elements (#17)
ahmadalwareh 60ca063
chore: bump version to `0.2.20`
BayooG a998646
Update README.md (#20)
BayooG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,31 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Publish on PYPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains hidden or 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 |
---|---|---|
|
@@ -7,3 +7,8 @@ | |
_scratch/ | ||
Session.vim | ||
/.tox/ | ||
/build/ | ||
/tests/ | ||
/features/ | ||
/docs/ | ||
/ref/ |
This file contains hidden or 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,14 @@ | ||
## Bayoo-docx contributors | ||
|
||
============================================ | ||
|
||
* **[Obay Daba](https://github.com/bayoog)** | ||
|
||
* **[Bassel Al Madani](https://github.com/pepos9)** | ||
|
||
* **[Tareq Ibrahim](https://github.com/idtareq)** | ||
|
||
* **[baltazarix](https://github.com/baltazarix)** | ||
|
||
* **[Ahmad Alwareh](https://github.com/ahmadalwareh)** | ||
|
This file contains hidden or 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,42 @@ | ||
Bayoo-docx | ||
|
||
|
||
Python library forked from `python-docx <github.com/python-openxml/python-docx/>`_. | ||
|
||
The main purpose of the fork was to add implementation for comments and footnotes to the library | ||
|
||
Installation | ||
|
||
|
||
Use the package manager `pip <pypi.org/project/bayoo-docx/>`_ to install bayoo-docx. | ||
|
||
|
||
`pip install bayoo-docx` | ||
|
||
Usage | ||
|
||
|
||
:: | ||
|
||
import docx | ||
|
||
document = docx.Document() | ||
|
||
paragraph1 = document.add_paragraph('text') # create new paragraph | ||
|
||
comment = paragraph.add_comment('comment',author='Obay Daba',initials= 'od') # add a comment on the entire paragraph | ||
|
||
paragraph2 = document.add_paragraph('text') # create another paragraph | ||
|
||
run = paragraph2.add_run('texty') add a run to the paragraph | ||
|
||
run.add_comment('comment') # add a comment only for the run text | ||
|
||
paragraph.add_footnote('footnote text') # add a footnote | ||
|
||
|
||
|
||
License | ||
|
||
|
||
`MIT <https://choosealicense.com/licenses/mit/>`_ |
This file contains hidden or 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 |
---|---|---|
@@ -1,264 +1,24 @@ | ||
.. :changelog: | ||
|
||
Release History | ||
--------------- | ||
|
||
0.8.10 (2019-01-08) | ||
+++++++++++++++++++ | ||
#Release History BayooG/bayoo-docx forked from (python-openxmm/python-docx) | ||
|
||
- Revert use of expanded package directory for default.docx to work around setup.py | ||
problem with filenames containing square brackets. | ||
|
||
0.2.8 (2020-05-02) | ||
|
||
0.8.9 (2019-01-08) | ||
++++++++++++++++++ | ||
- add comments implementation on a run level | ||
- fix issue with comments date (comments dates are set to current date) | ||
|
||
- Fix gap in MANIFEST.in that excluded default document template directory | ||
|
||
0.2.4 (2019-9-4) | ||
|
||
0.8.8 (2019-01-07) | ||
++++++++++++++++++ | ||
- loop over all the document chieldern (Paragraphs, Tables, Sections) with the right order `document.elements` | ||
- addons to Paragraph Object (delete, heading_level, merge_paragraph ) | ||
- Add low-level implementation for comments part | ||
- Add oxml element for <w:comments> element and sub-elements | ||
- Add add_comment() method for docx.text.Paragraph | ||
- Add low-level implementation for footnotes part | ||
- Add oxml element for <w:footnotes> element and sub-elements | ||
- Add add_footnote() method for docx.text.Paragraph | ||
|
||
- Add support for headers and footers | ||
|
||
|
||
0.8.7 (2018-08-18) | ||
++++++++++++++++++ | ||
|
||
- Add _Row.height_rule | ||
- Add _Row.height | ||
- Add _Cell.vertical_alignment | ||
- Fix #455: increment next_id, don't fill gaps | ||
- Add #375: import docx failure on --OO optimization | ||
- Add #254: remove default zoom percentage | ||
- Add #266: miscellaneous documentation fixes | ||
- Add #175: refine MANIFEST.ini | ||
- Add #168: Unicode error on core-props in Python 2 | ||
|
||
|
||
0.8.6 (2016-06-22) | ||
++++++++++++++++++ | ||
|
||
- Add #257: add Font.highlight_color | ||
- Add #261: add ParagraphFormat.tab_stops | ||
- Add #303: disallow XML entity expansion | ||
|
||
|
||
0.8.5 (2015-02-21) | ||
++++++++++++++++++ | ||
|
||
- Fix #149: KeyError on Document.add_table() | ||
- Fix #78: feature: add_table() sets cell widths | ||
- Add #106: feature: Table.direction (i.e. right-to-left) | ||
- Add #102: feature: add CT_Row.trPr | ||
|
||
|
||
0.8.4 (2015-02-20) | ||
++++++++++++++++++ | ||
|
||
- Fix #151: tests won't run on PyPI distribution | ||
- Fix #124: default to inches on no TIFF resolution unit | ||
|
||
|
||
0.8.3 (2015-02-19) | ||
++++++++++++++++++ | ||
|
||
- Add #121, #135, #139: feature: Font.color | ||
|
||
|
||
0.8.2 (2015-02-16) | ||
++++++++++++++++++ | ||
|
||
- Fix #94: picture prints at wrong size when scaled | ||
- Extract `docx.document.Document` object from `DocumentPart` | ||
|
||
Refactor `docx.Document` from an object into a factory function for new | ||
`docx.document.Document object`. Extract methods from prior `docx.Document` | ||
and `docx.parts.document.DocumentPart` to form the new API class and retire | ||
`docx.Document` class. | ||
|
||
- Migrate `Document.numbering_part` to `DocumentPart.numbering_part`. The | ||
`numbering_part` property is not part of the published API and is an | ||
interim internal feature to be replaced in a future release, perhaps with | ||
something like `Document.numbering_definitions`. In the meantime, it can | ||
now be accessed using ``Document.part.numbering_part``. | ||
|
||
|
||
0.8.1 (2015-02-10) | ||
++++++++++++++++++ | ||
|
||
- Fix #140: Warning triggered on Document.add_heading/table() | ||
|
||
|
||
0.8.0 (2015-02-08) | ||
++++++++++++++++++ | ||
|
||
- Add styles. Provides general capability to access and manipulate paragraph, | ||
character, and table styles. | ||
|
||
- Add ParagraphFormat object, accessible on Paragraph.paragraph_format, and | ||
providing the following paragraph formatting properties: | ||
|
||
+ paragraph alignment (justfification) | ||
+ space before and after paragraph | ||
+ line spacing | ||
+ indentation | ||
+ keep together, keep with next, page break before, and widow control | ||
|
||
- Add Font object, accessible on Run.font, providing character-level | ||
formatting including: | ||
|
||
+ typeface (e.g. 'Arial') | ||
+ point size | ||
+ underline | ||
+ italic | ||
+ bold | ||
+ superscript and subscript | ||
|
||
The following issues were retired: | ||
|
||
- Add feature #56: superscript/subscript | ||
- Add feature #67: lookup style by UI name | ||
- Add feature #98: Paragraph indentation | ||
- Add feature #120: Document.styles | ||
|
||
**Backward incompatibilities** | ||
|
||
Paragraph.style now returns a Style object. Previously it returned the style | ||
name as a string. The name can now be retrieved using the Style.name | ||
property, for example, `paragraph.style.name`. | ||
|
||
|
||
0.7.6 (2014-12-14) | ||
++++++++++++++++++ | ||
|
||
- Add feature #69: Table.alignment | ||
- Add feature #29: Document.core_properties | ||
|
||
|
||
0.7.5 (2014-11-29) | ||
++++++++++++++++++ | ||
|
||
- Add feature #65: _Cell.merge() | ||
|
||
|
||
0.7.4 (2014-07-18) | ||
++++++++++++++++++ | ||
|
||
- Add feature #45: _Cell.add_table() | ||
- Add feature #76: _Cell.add_paragraph() | ||
- Add _Cell.tables property (read-only) | ||
|
||
|
||
0.7.3 (2014-07-14) | ||
++++++++++++++++++ | ||
|
||
- Add Table.autofit | ||
- Add feature #46: _Cell.width | ||
|
||
|
||
0.7.2 (2014-07-13) | ||
++++++++++++++++++ | ||
|
||
- Fix: Word does not interpret <w:cr/> as line feed | ||
|
||
|
||
0.7.1 (2014-07-11) | ||
++++++++++++++++++ | ||
|
||
- Add feature #14: Run.add_picture() | ||
|
||
|
||
0.7.0 (2014-06-27) | ||
++++++++++++++++++ | ||
|
||
- Add feature #68: Paragraph.insert_paragraph_before() | ||
- Add feature #51: Paragraph.alignment (read/write) | ||
- Add feature #61: Paragraph.text setter | ||
- Add feature #58: Run.add_tab() | ||
- Add feature #70: Run.clear() | ||
- Add feature #60: Run.text setter | ||
- Add feature #39: Run.text and Paragraph.text interpret '\n' and '\t' chars | ||
|
||
|
||
0.6.0 (2014-06-22) | ||
++++++++++++++++++ | ||
|
||
- Add feature #15: section page size | ||
- Add feature #66: add section | ||
- Add page margins and page orientation properties on Section | ||
- Major refactoring of oxml layer | ||
|
||
|
||
0.5.3 (2014-05-10) | ||
++++++++++++++++++ | ||
|
||
- Add feature #19: Run.underline property | ||
|
||
|
||
0.5.2 (2014-05-06) | ||
++++++++++++++++++ | ||
|
||
- Add feature #17: character style | ||
|
||
|
||
0.5.1 (2014-04-02) | ||
++++++++++++++++++ | ||
|
||
- Fix issue #23, `Document.add_picture()` raises ValueError when document | ||
contains VML drawing. | ||
|
||
|
||
0.5.0 (2014-03-02) | ||
++++++++++++++++++ | ||
|
||
- Add 20 tri-state properties on Run, including all-caps, double-strike, | ||
hidden, shadow, small-caps, and 15 others. | ||
|
||
|
||
0.4.0 (2014-03-01) | ||
++++++++++++++++++ | ||
|
||
- Advance from alpha to beta status. | ||
- Add pure-python image header parsing; drop Pillow dependency | ||
|
||
|
||
0.3.0a5 (2014-01-10) | ||
++++++++++++++++++++++ | ||
|
||
- Hotfix: issue #4, Document.add_picture() fails on second and subsequent | ||
images. | ||
|
||
|
||
0.3.0a4 (2014-01-07) | ||
++++++++++++++++++++++ | ||
|
||
- Complete Python 3 support, tested on Python 3.3 | ||
|
||
|
||
0.3.0a3 (2014-01-06) | ||
++++++++++++++++++++++ | ||
|
||
- Fix setup.py error on some Windows installs | ||
|
||
|
||
0.3.0a1 (2014-01-05) | ||
++++++++++++++++++++++ | ||
|
||
- Full object-oriented rewrite | ||
- Feature-parity with prior version | ||
- text: add paragraph, run, text, bold, italic | ||
- table: add table, add row, add column | ||
- styles: specify style for paragraph, table | ||
- picture: add inline picture, auto-scaling | ||
- breaks: add page break | ||
- tests: full pytest and behave-based 2-layer test suite | ||
|
||
|
||
0.3.0dev1 (2013-12-14) | ||
++++++++++++++++++++++ | ||
|
||
- Round-trip .docx file, preserving all parts and relationships | ||
- Load default "template" .docx on open with no filename | ||
- Open from stream and save to stream (file-like object) | ||
- Add paragraph at and of document |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not implement a delete_comment() function as well?