Make code highlight sample page

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 20:18:05 -07:00
parent 895ef13d73
commit 58af575386
4 changed files with 55 additions and 18 deletions

48
code.md Normal file
View File

@ -0,0 +1,48 @@
## `heex`
```heex
<.header>
Listing Posts
</.header>
<.table id="posts" rows={@posts} row_click={&JS.navigate(~p"/posts/#{&1}")}>
<:col :let={post} label="id"><%= post.id %></:col>
<:action :let={post}>
<div class="sr-only">
<.link navigate={~p"/posts/#{post}"}>Show</.link>
</div>
</:action>
</.table>
```
## `elixir`
```elixir
if config_env() != :prod do
# Configure pandoc (the version is required)
config :pandoc,
version: "3.6.1",
hello: [
args: fn extra_args ->
{_, [input_file], _} = OptionParser.parse(extra_args, switches: [])
~w(--output=../priv/static/posts/#{Path.rootname(input_file)}.html)
end,
cd: Path.expand("../documents", __DIR__)
]
end
```
## `moonscript`
```moon
class Thing
name: "unknown"
class Person extends Thing
say_name: => print "Hel#lo, I am #{@name}!"
with Person!
.name = "MoonScript"
\say_name!
```

13
html/.gitignore vendored
View File

@ -1,16 +1,5 @@
app.css
code.html
index.html
moonscript.css
posts/build-a-neovim-qt-appimage-from-source.html
posts/build-static-website-generator-part-1.html
posts/deploy-elixir-generated-html-with-docker-on-digitalocean.html
posts/fix-distortion-introduced-when-transforming-multiview-projections-to-isometric.html
posts/index.html
posts/open-an-iex-shell-from-an-elixir-script.html
posts/publish-markdown-documents-as-static-web-pages-with-pandoc-and-phoenix.html
posts/recursively-list-all-files-in-a-directory-with-elixir.html
posts/resize-a-qemu-disk-image.html
posts/set-up-a-gitweb-server.html
posts/start-erlangs-dialyzer-with-gui-from-a-docker-container.html
posts/test-mix-task-file-modify.html
pygments.css

View File

@ -1,7 +1,3 @@
<article>
$render{"test"}
</article>
$render{"templates/wares"}
<h2>Posts</h2>

View File

@ -120,8 +120,12 @@ sitegen.create =>
} for path in *files
add "index.html", title: "Catalin Mititiuc"
add "blog.html", title: "Posts", target: "posts/index", template: "blog"
add_all files_from "docs"
-- add "blog.html", title: "Posts", target: "posts/index", template: "blog"
add "code.md",
template: "post"
title: "Code Syntax Highlight Samples"
publish_date: format_date date true
-- add_all files_from "docs"
copy "app.css"
copy "moonscript.css"