-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create html-to-img.py * Update generate_svg.sh * Update generate_svg.sh * Update generate_svg.sh * Update generate_svg.sh * Update generate_svg.sh * Update generate_svg.sh * Update html-to-img.py * Update generate_svg.sh * Update generate_svg.sh * finally got the image properly creating * Theoretically this solves the main deploy issue * Added concurrency protections * Added concurrency protections 2 * Added concurrency protections 3
- Loading branch information
1 parent
978e8e2
commit 42bce65
Showing
4 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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,32 @@ | ||
import imgkit | ||
import os | ||
import sys | ||
|
||
my_path = os.path.abspath("background.png") | ||
|
||
value = sys.argv[1] | ||
|
||
f = f""" | ||
<style> | ||
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,700;1,700&display=swap'); | ||
* {{ | ||
margin: 0px; | ||
font-family: "Source Code Pro"; | ||
font-optical-sizing: auto; | ||
font-weight: 700; | ||
font-style: normal; | ||
}} | ||
</style> | ||
<div style="width:300px"> | ||
<img width="300px" src="{my_path}"> | ||
<div style="font-size:65px; position: absolute; top: 20px; left: 0px; width: 300px;"> | ||
<div style="margin-left: auto; margin-right: auto; width: min; text-align: center;">{value}</div> | ||
</div> | ||
""" | ||
|
||
options = { | ||
"enable-local-file-access": "", | ||
"width": "300", | ||
"height": "163" | ||
} | ||
imgkit.from_string(f, 'build/loc.png', options) |