aleksrutins / valapkg

A package manager for Vala projects.
https://aleks.rutins.com/projects/valapkg
GNU General Public License v3.0
8 stars 0 forks source link

Provide HTML web interface #8

Open alcinnz opened 1 year ago

alcinnz commented 1 year ago

It'd be nice to be able to view the packages available on this service via a web browser! I certainly like doing so with the equivalent tools for other languages.

Also, I'm curious what you'd design here?

alcinnz commented 1 year ago

Mostly I just opened this issue to share some code you expressed interest in during the Vala meetup. I've now successfully extracted it from my defunct project and put it in its own GitHub repository: https://github.com/alcinnz/Prosody

Its not packaged very well, but I do have it building a library & demoscript which sucessfully passes its testsuite. Also: I'll be happy to transfer repository ownership over to you if you want it!

This templating language is heavily inspired by Django's and includes several useful features:

All written in pure Vala! Would this be useful?

aleksrutins commented 1 year ago

Yep! I've started to try to integrate it, but I can't seem to figure out how to render a template to a response. Here's my current attempt: https://github.com/aleksrutins/valapkg/blob/fdff1f180f9d15772ce6a129cd214cfaa1569f36/server/main.vala#L66-L72

However, it doesn't work:

ERROR:streamiterator.c:557:gee_stream_iterator_real_get: assertion failed: (_current != null)
Bail out! ERROR:streamiterator.c:557:gee_stream_iterator_real_get: assertion failed: (_current != null)
Aborted

What am I doing wrong?

aleksrutins commented 1 year ago

Oh gosh, sorry, I already extracted it: https://github.com/aleksrutins/Prosody

alcinnz commented 1 year ago

Yes, I noticed I had something lacking there as I did my own extraction.

The story is I was rendering directly into WebKitGTK, so I needed something a bit more convoluted to write into an OutputStream rather than an InputStream. I fixed that in my extraction work.

P.S. I find a bit more code to extract sometime, and I'm tempted to try implementing template inheritance again akin to Django.

alcinnz commented 1 year ago

But at first glance, looking at your code, it looks fine!

aleksrutins commented 1 year ago

I actually figured it out finally a couple of hours ago, when I realized looking at your example that I can pass data as JSON. Thanks!