Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dimitri Podborski
AutomationTools
Commits
0b82940e
Commit
0b82940e
authored
Feb 04, 2021
by
Dimitri Podborski
Browse files
Add more formatting to output doc
close
#192
parent
627345ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
automation/helpers.py
View file @
0b82940e
...
...
@@ -17,15 +17,6 @@ class DocumentFormatter:
def
save
(
self
,
output_path
):
self
.
__doc
.
save
(
output_path
)
def
add_project
(
self
,
project
):
project_description
=
project
[
'description'
]
project_url
=
project
[
'url'
]
project_name
=
project
[
'name'
]
self
.
__doc
.
add_heading
(
project_name
,
2
)
self
.
__doc
.
add_paragraph
(
project_description
)
p
=
self
.
__doc
.
add_paragraph
(
'GitLab project '
)
self
.
add_hyperlink
(
p
,
project_url
,
'link'
)
# https://github.com/python-openxml/python-docx/issues/74#issuecomment-261169410
def
add_hyperlink
(
self
,
paragraph
,
url
,
text
):
...
...
@@ -46,6 +37,19 @@ class DocumentFormatter:
hyperlink
.
append
(
run
)
paragraph
.
_p
.
append
(
hyperlink
)
def
add_project
(
self
,
project
):
project_description
=
project
[
'description'
].
strip
()
project_url
=
project
[
'url'
]
project_name
=
project
[
'name'
]
h
=
self
.
__doc
.
add_heading
(
''
,
2
)
self
.
add_hyperlink
(
h
,
project_url
,
project_name
)
p
=
None
if
len
(
project_description
)
>
0
:
p
=
self
.
__doc
.
add_paragraph
(
project_description
)
else
:
p
=
self
.
__doc
.
add_paragraph
(
'[no project description supplied]'
)
p
.
paragraph_format
.
keep_with_next
=
True
def
add_contribution
(
self
,
contribution
):
document
=
contribution
[
'document'
]
details
=
contribution
[
'details'
]
...
...
@@ -68,7 +72,7 @@ class DocumentFormatter:
table
.
rows
[
1
].
cells
[
0
].
text
=
'Abstract'
if
details
[
'abstract'
]
is
not
None
:
table
.
rows
[
1
].
cells
[
1
].
text
=
details
[
'abstract'
]
table
.
rows
[
2
].
cells
[
0
].
text
=
'
Discussions
'
table
.
rows
[
2
].
cells
[
0
].
text
=
'
Gitlab
'
issues_added
=
0
if
issue_meta
is
not
None
:
...
...
@@ -89,6 +93,8 @@ class DocumentFormatter:
for
cell
in
table
.
columns
[
1
].
cells
:
cell
.
width
=
shared
.
Cm
(
14
)
p
=
self
.
__doc
.
add_paragraph
(
'<minutes>'
)
p
.
paragraph_format
.
space_before
=
shared
.
Pt
(
8
)
def
is_document_late
(
meeting_start
,
v1_upload_timestamp
):
'''
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment