summaryrefslogtreecommitdiff
path: root/html5.conf
diff options
context:
space:
mode:
authorMatthew Peveler <matt.peveler@gmail.com>2018-05-25 21:10:40 -0400
committerMatthew Peveler <matt.peveler@gmail.com>2018-05-27 17:42:48 -0400
commitd5a99f5f318fd2fde7fa82ca20767d5d24a04d88 (patch)
tree1a313d10758e6622a86e60147126bd473869f444 /html5.conf
parentcd295d5b5410988ba4cf0716c15089a8e68bfaa0 (diff)
downloadasciidoc-git-d5a99f5f318fd2fde7fa82ca20767d5d24a04d88.tar.gz
Fix python3 encode errors
Diffstat (limited to 'html5.conf')
-rw-r--r--html5.conf10
1 files changed, 5 insertions, 5 deletions
diff --git a/html5.conf b/html5.conf
index 9ce645f..aa63687 100644
--- a/html5.conf
+++ b/html5.conf
@@ -83,7 +83,7 @@ ${passtext}$
<a class="image" href="{link}">
{data-uri%}<img src="{imagesdir=}{imagesdir?/}{target}" alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"}>
{data-uri#}<img alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"}
-{data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print(b'src=\x22data:' + mimetypes.guess_type(r'{target}')[0].encode('utf-8') + b';base64,'); base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}">
+{data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print('src=\x22data:' + mimetypes.guess_type(r'{target}')[0] + ';base64,'); base64.encode(sys.stdin.buffer,sys.stdout.buffer)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}">
{link#}</a>
</span>
@@ -93,7 +93,7 @@ ${passtext}$
<a class="image" href="{link}">
{data-uri%}<img src="{imagesdir=}{imagesdir?/}{target}" alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}>
{data-uri#}<img alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}
-{data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print(b'src=\x22data:' + mimetypes.guess_type(r'{target}')[0].encode('utf-8') + b';base64,'); base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}">
+{data-uri#}{sys:"{python}" -u -c "import mimetypes,base64,sys; print('src=\x22data:' + mimetypes.guess_type(r'{target}')[0] + ';base64,'); base64.encode(sys.stdin.buffer,sys.stdout.buffer)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}">
{link#}</a>
</div>
<div class="title">{caption={figure-caption} {counter:figure-number}. }{title}</div>
@@ -152,7 +152,7 @@ ifndef::data-uri[]
endif::data-uri[]
ifdef::data-uri[]
<img alt="{index}" src="data:image/png;base64,
-{sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/callouts/{index}.png}")}"}">
+{sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin.buffer,sys.stdout.buffer)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/callouts/{index}.png}")}"}">
endif::data-uri[]
endif::icons[]
@@ -215,7 +215,7 @@ ifndef::data-uri[]
item=<tr><td><img src="{iconsdir}/callouts/{listindex}.png" alt="{listindex}"></td><td>|</td></tr>
endif::data-uri[]
ifdef::data-uri[]
-item=<tr><td><img alt="{listindex}" src="data:image/png;base64, {sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/callouts/{listindex}.png}")}"}"></td><td>|</td></tr>
+item=<tr><td><img alt="{listindex}" src="data:image/png;base64, {sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin.buffer,sys.stdout.buffer)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/callouts/{listindex}.png}")}"}"></td><td>|</td></tr>
endif::data-uri[]
text=|
endif::icons[]
@@ -380,7 +380,7 @@ template::[quoteblock]
<td class="icon">
{data-uri%}{icons#}<img src="{icon={iconsdir}/{name}.png}" alt="{caption}">
{data-uri#}{icons#}<img alt="{caption}" src="data:image/png;base64,
-{data-uri#}{icons#}{sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/{name}.png}")}"}">
+{data-uri#}{icons#}{sys:"{python}" -u -c "import base64,sys; base64.encode(sys.stdin.buffer,sys.stdout.buffer)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/{name}.png}")}"}">
{icons%}<div class="title">{caption}</div>
</td>
<td class="content">