dbohdan / caddy-markdown-site

Serve Markdown files as HTML pages with CSS using just Caddy
MIT License
52 stars 5 forks source link

markdown templater and limits of caddy templating. #7

Closed gedw99 closed 1 week ago

gedw99 commented 1 week ago

It looks like the built in caddy templater can only take us so far, so ...

https://github.com/paganotoni/markito is worth a look.

https://templ.guide/static-rendering/blog-example/ is a decent one but it requires the full gamut of markdown to be done, because it requires compilation at design time.

https://github.com/NikolaLohinski/gonja is a generic template process at runtime, from what I can see.

Store and cache

One question I have if we want to also store to disk as well as output as a http response ?

It woudl speed up processing as we only do work required.

With a simple hash we can detect cache misses and just reprocess.

A markdown file delete, that would mean that also have to detect it and delete the corresponding html on disk. A polling file watcher would do that for us.

watcher of files and processes

If we do want to react to file changes in a robust way with caddy...

https://github.com/cirello-io/runner might be a good thing for this because it has a built in cross platform watcher and automatically kicks off recompile on changes. It also has supervisions trees, and formations.

Formations is for when you want to run clusters of the same process.

A web gui exists for admin to see logs of all processes running.

Just one of many examples. The docs go into detail of running many processes and formations.


workdir: .
observe: *.go frontend/*
ignore: /vendor
build-backend: make darwin
backend:       ./alreadyread ht

The config is really impressive because you can run clusters of the same things, along with caddy clusters. I have been using it as a replacement for docker compose and k8.

It could be a central watcher of file and well as supervisor of processors. It kind of goes hand in hand with caddy.


https://github.com/F1bonacc1/process-compose is another one, which is simpler. I have only used this a bit.

dbohdan commented 1 week ago

It sounds like you are brainstorming a new project that would be similar to mine but more ambitious, probably with bespoke Caddy plugins. I would like to keep the scope of caddy-markdown-site limited to what it is. It means no bespoke plugins. While I wish you luck and will gladly look at the result, I am not interested in working on this larger project. You should create your own repository and perhaps find people who'd work on your project with you.

gedw99 commented 1 week ago

Your right ! Scope creep .

Yes bespoke addy plugins needed . Just need a sturdy mark down on html package and then a store with eventing . Will use my trusty NATS

I am working in the EU Open Science project and need a decent markdown renderer for caddy .

Will close this.