This commit is contained in:
array-in-a-matrix 2024-01-07 22:54:04 -05:00
parent 09216b2e70
commit a62b6a1c03
5 changed files with 3927 additions and 25 deletions

View file

@ -1,25 +0,0 @@
# [Blog in a Matrix](https://bloginamatrix.xyz)
New single page blog site application written in Nim.
Articles/blogs written in markdown using [Joplin](https://github.com/laurent22/joplin/ "The best notes app/markdown editor ever made.") then exported as `HTML` to the `/src/public` directory. Joplin has support for [the extended markdown syntax](https://github.com/laurent22/joplin/blob/dev/readme/markdown.md), [KaTeX](https://khan.github.io/KaTeX/), and [Mermaid.js](https://mermaidjs.github.io/) out of the box. The syntax can be farther extended with [plugins](https://github.com/joplin/plugins/) (e.g. [music sheet notation](https://github.com/joplin/plugin-abc-sheet-music)).
MTH tech stack is used, pronounced _Meth_ or _Math_:
- [Markdown](https://daringfireball.net/projects/markdown/)
- [Tailwindcss](https://tailwindcss.com/)
- [HappyX](https://hapticx.github.io/happyx/)
## Development
Install Nim dependencies:
```sh
nimble install happyx
```
Development server:
```sh
npx dev --reload
```

7
jester/main.nim Normal file
View file

@ -0,0 +1,7 @@
# example.nim
import htmlgen
import jester
routes:
get "/":
resp h1("Hello world")

12
karax/index.html Normal file
View file

@ -0,0 +1,12 @@
<!DOCTYPE html><html>
<head>
<meta charset="utf-8">
<title>Blog in a Matrix</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div id="ROOT" class="relative min-h-screen flex"></div>
<script src="./main.js"></script>
</body>
</html>

3900
karax/main.js Normal file

File diff suppressed because one or more lines are too long

8
karax/main.nim Normal file
View file

@ -0,0 +1,8 @@
include karax / prelude
proc createDom(): VNode =
result = buildHtml(tdiv):
text "Hello World!"
setRenderer createDom