Skip to content

Commit a09f020

Browse files
committed
add video to generator
1 parent 09ed6ab commit a09f020

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
!|projtable | <h2> WIP </h2> || |
44
!|| !(/assets/dd.png) || **Custom Game Engine** |
5-
!|| || Working on a small engine to use for my games. Small preview in @(/writing/implementing-a-simple-undo-system.html this post). |
5+
!|| || Working on a small engine to use for my games. Small preview in @(/writing/implementing-a-simple-undo-system.html this post.) |
66
!|| !(/assets/icons/imp.png) || **IMP: Immediate Mode Plotting** |
77
!|| || An immediate-mode api for data plotting and visualization. |
88

src/writing/implementing-a-simple-undo-system.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ In the rest of this article I'll walk through how I implemented the system using
2727
and added to the system for my games. Here's some footage of the final result in my editor:
2828

2929

30-
<video width="100%" controls>
31-
<source src="/assets/editorpreview.mp4" type="video/mp4">
32-
</video>
30+
!(/assets/editorpreview.mp4)
3331

3432
##impl Implementation
3533
My desired API is roughly the same as rxi's:
@@ -370,10 +368,7 @@ void redo() {
370368
}
371369
```
372370

373-
<video width="100%" controls>
374-
<source src="/assets/undoingyourmom.mp4" type="video/mp4">
375-
</video>
376-
371+
!(/assets/undoingyourmom.mp4)
377372

378373
There are also performance enhancements that could be implemented in the base layer, such as scanning the changes in smaller
379374
chunks and only committing what has actually changed. Even better might be applying general purpose compression to the copies.

static-site-gen/md_to_html.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ StrList render_text(Arena* arena, Text* root) {
344344
} break;
345345
case Text::IMAGE: {
346346
/* TODO alt text, styles, etc */
347-
StrList_pushv(arena, &out, strl("<img src='"), t->text, strl("'>"));
347+
str mp4 = strl(".mp4");
348+
if (str_has_suffix(t->text, mp4)) {
349+
StrList_pushv(arena, &out, strl("<video controls><source src='"), t->text, strl("' type='video/mp4'></video>"));
350+
} else {
351+
StrList_pushv(arena, &out, strl("<img src='"), t->text, strl("'>"));
352+
}
348353
} break;
349354
case Text::TABLE_CELL: {
350355
str s[2] = {strl("<td>"), strl("</td>\n")};

static-site-gen/site.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
TODO(lcf, July 18, 2023):
3-
- Update projects page to be more table oriented and have seperate pages for each.
43
- <sup> and <sub> formatting, possibly for math formulas.
54
65
*/

0 commit comments

Comments
 (0)