Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Rhiem
doc-utils
Commits
a03aea29
Commit
a03aea29
authored
Jul 02, 2019
by
Florian Rhiem
Browse files
Improve file handling in Tikz directive
parent
ca21e472
Changes
1
Hide whitespace changes
Inline
Side-by-side
docutils_extended/directives/tikz_directive.py
View file @
a03aea29
...
...
@@ -194,8 +194,9 @@ class Tikz(Directive):
rendered_tikz_filename
=
render_tikz
(
"
\n
"
.
join
(
content
),
self
.
options
,
output_svg
=
is_output_mode_html
)
if
is_output_mode_html
:
reference
=
directives
.
uri
(
convert_image_to_html_base64
(
rendered_tikz_filename
))
os
.
remove
(
rendered_tikz_filename
)
else
:
shutil
.
copy
(
rendered_tikz_filename
,
os
.
path
.
join
(
BUILD_DIRECTORY
,
os
.
path
.
basename
(
rendered_tikz_filename
)))
shutil
.
move
(
rendered_tikz_filename
,
os
.
path
.
join
(
BUILD_DIRECTORY
,
os
.
path
.
basename
(
rendered_tikz_filename
)))
reference
=
directives
.
uri
(
rendered_tikz_filename
)
self
.
options
[
"uri"
]
=
reference
if
is_output_mode_html
and
not
any
(
attr
in
self
.
options
for
attr
in
(
"height"
,
"width"
,
"scale"
)):
...
...
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