embedding fallback :(

This commit is contained in:
pseusys
2023-02-26 13:30:38 +01:00
parent 816d50aac7
commit aa55876b78

View File

@@ -147,9 +147,10 @@ class GitHubManager:
except UnknownObjectException: except UnknownObjectException:
GitHubManager.REPO.create_file(chart_path, "Charts Added", data, committer=GitHubManager._get_author()) GitHubManager.REPO.create_file(chart_path, "Charts Added", data, committer=GitHubManager._get_author())
DBM.g("Lines of code chart created!") DBM.g("Lines of code chart created!")
return f"**{FM.t('Timeline')}**\n\n![Lines of Code chart]({chart_path})\n\n"
else: else:
DBM.i("Inlining chart...") DBM.i("Inlining chart...")
chart_path = f"data:image/png;base64,{b64encode(data).decode('utf-8')}" hint = f"You can use [this website](https://codebeautify.org/base64-to-image-converter) to view the generated image."
encoded_image = f"data:image/png;base64,{b64encode(data).decode('utf-8')}"
return f"**{FM.t('Timeline')}**\n\n![Lines of Code chart]({chart_path})\n\n" return f"<details>\n\t<summary>Base64 encoded image</summary>\n\t```\t\n{encoded_image}\t\n```</details>\n\n{hint}"