Skip to content

Commit

Permalink
new post
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoncoder047 authored Apr 5, 2024
1 parent 844166a commit 1f62479
Show file tree
Hide file tree
Showing 45 changed files with 633 additions and 157 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"cSpell.words": [
"Caswell",
"defun",
"funcs",
"iframe",
"inlinehilite",
"kroki",
"longjmp",
"nilly",
"Nuvoton",
"oldenv",
"phoo",
Expand Down
13 changes: 11 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,23 @@ def lv_fence(source, language, css_class, options, md, **kwargs):
+ 'width="{options.get("width", 600)}"></canvas></div>')


def kroki_fence(source, language, css_class, options, md, **kwargs):
def kroki_fence(source, language, css_class, options, md, classes, attrs,
**kwargs):
data = base64.urlsafe_b64encode(zlib.compress(
source.encode("utf-8"), 9)).decode("ascii")
lang = options.get("type", options.get("name", "svgbob"))
attr = ""
if "width" in options and "height" in options:
attr = f' width="{options["width"]}" height="{options["height"]}"'
return f'<img src="https://kroki.io/{lang}/svg/{data}"{attr} />'
if classes:
divopen = "<div class=\"" + " ".join(classes) + "\">"
divclose = "</div>"
else:
divopen = divclose = ""
attr += "".join(f'{k}="{v}"' for k, v in attrs.items())
return (divopen +
f'<img src="https://kroki.io/{lang}/svg/{data}"{attr} />' +
divclose)


def named_kroki(name):
Expand Down
2 changes: 1 addition & 1 deletion docs/2022/how-i-came-up-with-phoo/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/lisp-practice/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/partcl/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/scratching-my-head-again/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/segfaults/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/some-unrelated-ideas/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/tehssl/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2022/ulisp-thoughts/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/2022/wireworld/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/2023/continuations-and-the-thunk-queue/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2023/error-out-of-memory/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/2023/its-september/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/2023/lilduino/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1f62479

Please sign in to comment.