This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository www.
View the commit online.
commit 80e50399bb92952284c2567e3655cd565edab890
Author: Carsten Haitzler (Rasterman) <[email protected]>
AuthorDate: Wed Jun 3 12:28:31 2026 +0100
flesh out some more code helper funcs
---
public_html/content/{ => md}/test.md | 0
public_html/content/src/sample.c | 16 ++++++++++++++++
public_html/content/start.php | 25 ++++++++++++++++++++++++-
public_html/site/funcs.php | 5 +++++
4 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/public_html/content/test.md b/public_html/content/md/test.md
similarity index 100%
rename from public_html/content/test.md
rename to public_html/content/md/test.md
diff --git a/public_html/content/src/sample.c b/public_html/content/src/sample.c
new file mode 100644
index 00000000..9abf100a
--- /dev/null
+++ b/public_html/content/src/sample.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+// This is my very first program
+void
+myfunc(int x)
+{
+ x += 100;
+}
+
+int
+main(int argc, char **argv)
+{
+ myfunc(10);
+ printf("Hello world!\n"); /* Print some stuff */
+ return 0;
+}
diff --git a/public_html/content/start.php b/public_html/content/start.php
index e7a8331f..b35590dc 100644
--- a/public_html/content/start.php
+++ b/public_html/content/start.php
@@ -19,6 +19,9 @@ This is a very small screenshot with a video player (Rage) playing and an
alternate background.
</p>
<br clear=all>
+<p>
+Some inlined color hilighted source code:
+</p>
<?php code_start("c");?>
#include <stdio.h>
@@ -38,12 +41,23 @@ main(int argc, char **argv)
}
<?php code_end();?>
+<p>
+Now do code pointing a php helper func to a src file by path and include it
+in the page:
+</p>
+<?php code_file("c", "src/sample.c");?>
+<p>
+Now some colro hilighted inlined bash:
+</p>
<?php code_start("bash");?>
export VAR="hello"
echo $VAR; echo $HOME; echo "hello"
while [ 1 ]; do echo "xxx"; done
<?php code_end();?>
+<p>
+Now some code provided as a string to a helper func:
+</p>
<?php code(
"c",
"#include \"x.h\"
@@ -53,6 +67,9 @@ int main(int argc, char **argv) {
return 0;
}
");?>
+<p>
+Now some markdown provided as a string:
+</p>
<?php md(
"# Header 1
## Header 2
@@ -80,7 +97,13 @@ Alt-H2
[I'm an inline-style link with title](https://www.google.com/xyzzz \"Google's Homepage\")
");?>
-<?php md_file("test.md");?>
+<p>
+Some markdown by pointing a helper func to the markdown file:
+</p>
+<?php md_file("md/test.md");?>
+<p>
+Some screenshot images with varying widths:
+</p>
<p>
<?php i("shots/e-main.png", "width=90% class='shot'");?>
</p>
diff --git a/public_html/site/funcs.php b/public_html/site/funcs.php
index 1e3fcdf5..2ccd1465 100644
--- a/public_html/site/funcs.php
+++ b/public_html/site/funcs.php
@@ -27,6 +27,11 @@
print($code);
print("</code></pre>");
}
+ function code_file($lang, $filename) {
+ print("<pre><code class=\"language-" . $lang . "\">");
+ echo htmlspecialchars(file_get_contents("content/" . $filename));
+ print("</code></pre>");
+ }
// https://github.github.com/gfm/
include "site/parsedown.php";
// https://michelf.ca/projects/php-markdown/extra/
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.