kethel: switch fxg to md
11 files changed, 54 insertions(+), 40 deletions(-) M kethel/lib/pages.ex M kethel/mix.exs M kethel/mix.lock D pages/blog.fxg R pages/{colophon.fxg => colophon.md} D pages/index.fxg A pages/index.md D pages/now.fxg D pages/projects.fxg A pages/projects.md M styles/base.css
M kethel/lib/pages.ex => kethel/lib/pages.ex +3 -10
@@ 7,7 7,7 @@ defmodule Pages do # ROOT + pages/ begin = byte_size(project_root) + byte_size("pages/") # remove extension binary_part(path, begin, byte_size(path) - begin - byte_size(".fxg")) binary_part(path, begin, byte_size(path) - begin - byte_size(".md")) end @spec collect(%Context{}, Bricks.bricks()) :: %Pages{} @@ 17,7 17,7 @@ defmodule Pages do %Pages{ project_root: project_root, source_files: Path.wildcard(pages_root <> "/**/*.fxg") Path.wildcard(pages_root <> "/**/*.md") |> Task.async_stream(fn path -> {trim_abs_path(path, project_root), File.read!(path)} end) # we assume every file read succeeds :)) always be positive |> Enum.map(fn {:ok, val} -> val end), @@ 54,21 54,14 @@ defmodule Pages do location = page_path |> binary_slice(1..byte_size(page_data)) mustache_context = Map.merge(%{fxg_content: invoke_fxg(page_data), location: location}, pages.bricks) Map.merge(%{fxg_content: MDEx.to_html!(page_data), location: location}, pages.bricks) page_rendered = Mustache.render(template, mustache_context) File.write!(output_path, invoke_hmn(page_rendered)) IO.puts("[COMPILED] #{pages.project_root}/pages#{page_path}.fxg -> #{output_path}") end # doc "Invokes the fxg compiler, a la `fxg -`, piping `data` into the process stdin, and reading the stdout. " @spec invoke_fxg(binary()) :: binary() defp invoke_fxg(data) do {:ok, res} = Rambo.run("fxg", ["-"], in: data) res.out end # doc "Invokes the fxg compiler, a la `fxg -`, piping `data` into the process stdin, and reading the stdout. " @spec invoke_hmn(binary()) :: binary() defp invoke_hmn(data) do {:ok, res} = Rambo.run("npx", ["html-minifier-next", "--preset", "conservative"], in: data)
M kethel/mix.exs => kethel/mix.exs +2 -1
@@ 14,7 14,8 @@ defmodule Kethel.MixProject do defp deps do [ {:mustache, "~> 0.5.0"}, {:rambo, "~> 0.3.4"} {:rambo, "~> 0.3.4"}, {:mdex, "~> 0.12"} ] end end
M kethel/mix.lock => kethel/mix.lock +6 -0
@@ 2,11 2,17 @@ "certifi": {:hex, :certifi, "2.15.0", "0e6e882fcdaaa0a5a9f2b3db55b1394dba07e8d6d9bcad08318fb604c6839712", [:rebar3], [], "hexpm", "b147ed22ce71d72eafdad94f055165c1c182f61a2ff49df28bcc71d1d5b94a60"}, "hackney": {:hex, :hackney, "1.25.0", "390e9b83f31e5b325b9f43b76e1a785cbdb69b5b6cd4e079aa67835ded046867", [:rebar3], [{:certifi, "~> 2.15.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.4", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "7209bfd75fd1f42467211ff8f59ea74d6f2a9e81cbcee95a56711ee79fd6b1d4"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, "jason": {:hex, :jason, "1.4.5", "2e3a008590b0b8d7388c20293e9dcc9cf3e5d642fd2a114e4cbbb52e595d940a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b0c823996102bcd0239b3c2444eb00409b72f6a140c1950bc8b457d836b30684"}, "mdex": {:hex, :mdex, "0.13.4", "9e42874ee4e9f8be110a5c03a91f838068c1b089bc0c586243d83503b153a2b1", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:lumis, "~> 0.1", [hex: :lumis, repo: "hexpm", optional: true]}, {:mdex_native, ">= 0.2.6", [hex: :mdex_native, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}], "hexpm", "915e579df919923c0685e6ea9851cf6e4a346d014795f03ce5a1a9c52455192b"}, "mdex_native": {:hex, :mdex_native, "0.2.6", "16c0d9ffca05990982ef8113c0a61950ffc250bf0792e17b95b28b74e1f572dc", [:mix], [{:rustler, "~> 0.32", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.8", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "eaaf2af27162c9879f5aef66344101dadf1898e71ea6ac9eb811c8d92d8e49ad"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mimerl": {:hex, :mimerl, "1.4.0", "3882a5ca67fbbe7117ba8947f27643557adec38fa2307490c4c4207624cb213b", [:rebar3], [], "hexpm", "13af15f9f68c65884ecca3a3891d50a7b57d82152792f3e19d88650aa126b144"}, "mustache": {:hex, :mustache, "0.5.1", "1bfee8a68a8e72d47616541a93a632ae1684c1abc17c9eb5f7bfecb78d7496e5", [:mix], [], "hexpm", "524c9bbb6080a52d7b6806436b4e269e0224c785a228faf3293ef30a75016bfa"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, "rambo": {:hex, :rambo, "0.3.4", "8962ac3bd1a633ee9d0e8b44373c7913e3ce3d875b4151dcd060886092d2dce7", [:mix], [], "hexpm", "0cc54ed089fbbc84b65f4b8a774224ebfe60e5c80186fafc7910b3e379ad58f1"}, "rustler_precompiled": {:hex, :rustler_precompiled, "0.9.0", "3a052eda09f3d2436364645cc1f13279cf95db310eb0c17b0d8f25484b233aa0", [:mix], [{:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "471d97315bd3bf7b64623418b3693eedd8e47de3d1cb79a0ac8f9da7d770d94c"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "tzdata": {:hex, :tzdata, "1.1.3", "b1cef7bb6de1de90d4ddc25d33892b32830f907e7fc2fccd1e7e22778ab7dfbc", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "d4ca85575a064d29d4e94253ee95912edfb165938743dbf002acdf0dcecb0c28"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.1", "a48703a25c170eedadca83b11e88985af08d35f37c6f664d6dcfb106a97782fc", [:rebar3], [], "hexpm", "b3a917854ce3ae233619744ad1e0102e05673136776fb2fa76234f3e03b23642"},
D pages/blog.fxg => pages/blog.fxg +0 -3
R pages/colophon.fxg => pages/colophon.md +3 -2
@@ 1,6 1,7 @@ ====== colophon ====== colophon -------- you're looking at a <#https://en.wiktionary.org/wiki/beautiful#English beautiful> site, written with 100% non-ai code. you're looking at a (beautiful)[ttps://en.wiktionary.org/wiki/beautiful#English] site, written with 100% non-ai code. ===== fonts =====
D pages/index.fxg => pages/index.fxg +0 -11
@@ 1,11 0,0 @@ ====== haii :3 i'm mika! ====== haii! i'm mika (also sometimes //m1ka//, //m1kadev//). i'm a (mostly backend) developer from <#https://wikipedia.org/wiki/The_Netherlands The Netherlands>. besides programming, i also like to play music and cook. ===== about me ===== i do VWO (dutch a-levels) physics, in the greater rotterdam area. i enjoy implementing things from scratch. this website is made with <#https://codeberg.org/m1ka/fxg a custom markup language>, writen in rust, using <#https://codeberg.org/m1ka/www.m1kadev.nl/ a custom build system>, written in elixir. ===== contact ===== feel free to reach out to me! i'm available at m1kadev on discord, or otherwise on my e-mail, "mika [dot] dupunkto [at] org". (you're not stupid; i think you know what characters go where).
A pages/index.md => pages/index.md +16 -0
@@ 0,0 1,16 @@ haii :3 i'm mika! ================= haii! i'm mika (also sometimes *m1ka*, *m1kadev*). i'm a (mostly backend) developer from [The Netherlands](https://wikipedia.org/wiki/The_Netherlands). besides programming, i also like to play music and cook. about me -------- i do VWO (dutch a-levels) in physics and maths, in the greater rotterdam area. i enjoy low-level programming in rust, and i also use c++ (which i oftentimes enjoy less). this website is made with my custom SSG, [kethel](https://codeberg.org/m1ka/www.m1kadev.nl/src/branch/main/kethel), in elixir. contact ------- feel free to reach out to me! i'm available at m1kadev on discord, or otherwise on my e-mail, "mika [dot] dupunkto [at] org". (you're not stupid; i think you know what characters go where).
D pages/now.fxg => pages/now.fxg +0 -4
@@ 1,4 0,0 @@ ====== now ====== currently im working on a few (potential) unnamed projects, mostly to learn new languages. also, i've been researching stack based vm's, to hopefully be able to (some day) target my own vm. most of my current projects are low-level graphics related, or very simple graphical apps.
D pages/projects.fxg => pages/projects.fxg +0 -8
@@ 1,8 0,0 @@ ====== projects ====== ===== fxg ===== <#https://github.com/m1kadev/fxg fxg> is my own markup language, written in <#https://rust-lang.org/ Rust>. it aims to maximise readability in text form, and tries to only have one way to write markup (unlike Markdown). you can view <#https://codeberg.org/m1ka/www.m1kadev.nl/src/branch/main/pages/projects.fxg the source> of this page, if you'd like to see for yourself. ===== m1kadev.nl ===== the site you're on right now! the <#https://codeberg.org/m1ka/www.m1kadev.nl/src/branch/main/kethel generator> for this site is written in <#https://elixir-lang.org/ elixir>. all code for the generator is written by me.
A pages/projects.md => pages/projects.md +19 -0
@@ 0,0 1,19 @@ projects ======== www.m1kadev.nl -------------- the site you're on right now! the [SSG for this site, kethel](https://codeberg.org/m1ka/www.m1kadev.nl/src/branch/main/kethel) is written in [elixir](https://elixir-lang.org/) ### archived projects fxg ------------------ [fxg](https://codeberg.org/m1kadev/fxg) is my own markup language, written in [rust](https://rust-lang.org/). it aims to maximise readability in text form, and tries to only have one way to write markup (unlike Markdown), you can view [the source](https://codeberg.org/m1ka/www.m1kadev.nl/src/commit/fbf618ecafa959b70d39a0ede68f10be2ab7fdda/pages/index.fxg) of this page, if you'd like to see for yourself.
M styles/base.css => styles/base.css +5 -1