-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1dc05b
commit 2670fcc
Showing
6 changed files
with
94 additions
and
9 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
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,8 @@ | ||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><style> | ||
body { | ||
font-family: sans-serif; | ||
} | ||
.section > .title { | ||
color: red; | ||
} | ||
</style></head><body><div class="section"><h1 class="title">Projects</h1><p class="description">Some of my projects</p><div class="item"><h2 class="title">Soul</h2><p class="description">A simple, fast and lightweight PHP framework.</p><a class="url" href="https://github.com/thevahidal/soul">Link</a></div><div class="item"><h2 class="title">Bukowski</h2><p class="description">A beautiful typewriter</p><a class="url" href="https://github.com/thevahidal/bukowski">Link</a></div></div><div class="section"><h1 class="title">Links</h1><p class="description">Some of my links</p><div class="item"><h2 class="title">GithHub</h2><a class="url" href="https://github.com/thevahidal">Link</a></div><div class="item"><h2 class="title">Linkedin</h2><a class="url" href="https://www.linkedin.com/in/thevahidal/">Link</a></div><div class="item"><h2 class="title">Twitter</h2><a class="url" href="https://twitter.com/thevahidal">Link</a></div></div></body></html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 @@ | ||
[tool.poetry] | ||
name = "github-actions-python" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Vahid Al <thevahidal@gmail.com>"] | ||
readme = "README.md" | ||
packages = [{include = "github_actions_python"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
tinyhtml = "^1.2.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,46 @@ | ||
import requests | ||
print("Hellow!") | ||
response = requests.get("https://jsonplaceholder.typicode.com/todos/1") | ||
print(response.json()) | ||
import tomllib | ||
|
||
from tinyhtml import html, h, frag, raw | ||
|
||
|
||
with open("data.toml", "rb") as f: | ||
data = tomllib.load(f) | ||
sections = frag( | ||
h("div", klass="section")( | ||
h("h1", klass="title")(section.get("title")), | ||
h("p", klass="description")(section.get("description")), | ||
( | ||
h("div", klass="item")( | ||
h("h2", klass="title")(item.get("title")), | ||
h("p", klass="description")(item.get("description")) | ||
if item.get("description") | ||
else None, | ||
h("a", klass="url", href=item.get("url"))("Link"), | ||
) | ||
for item in section["items"] | ||
), | ||
) | ||
for section in data["sections"] | ||
) | ||
|
||
output = html(lang="en")( | ||
h("head")( | ||
h("meta", charset="utf-8"), | ||
h("style")( | ||
raw( | ||
""" | ||
body { | ||
font-family: sans-serif; | ||
} | ||
.section > .title { | ||
color: red; | ||
} | ||
""" | ||
) | ||
), | ||
), | ||
h("body")(sections), | ||
).render() | ||
|
||
with open("output.html", "w") as f: | ||
f.write(output) |