minijinja as staticjinja replacement? #567
Replies: 3 comments
-
|
I'm not sure how to help here or even what you are trying to accomplish or why. Is the goal to just replace a Python library with a Rust library or to port the entire tool to Rust? Either way I think the question is: why? :) |
Beta Was this translation helpful? Give feedback.
-
|
To answer your question: no, not port; IIUC, after re-reading the mini
jinja README and the links to HTML generation derivative tools, mini jinja
is a near drop-in replacement for static jinja where there may be a few
code and data differences to beware of at the edges, i.e. assuming direct
template compatibility and parse-ability, it should be no-code, low-code,
alignment of templates, perhaps a Makefile and connective shell scripting.
Does that make sense?
…On Sun, Sep 1, 2024 at 3:10 PM Armin Ronacher ***@***.***> wrote:
I'm not sure how to help here or even what you are trying to accomplish or
why. Is the goal to just replace a Python library with a Rust library or to
port the entire tool to Rust? Either way I think the question is: why? :)
—
Reply to this email directly, view it on GitHub
<#567 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABE23FAZFBJBHPZ2RSCXMDZUNRBBAVCNFSM6AAAAABNHCSSTCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANJRGQYTEOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
To clarify your question David, staticjinja is a static site builder that uses jinja as its string templating library (i.e. substituting and transforming variables in template strings). You'd want to create a replacement to the staticjinja library in Rust and ship a binary for command line use, which could be built on minijinja (the Rust crate). It's MIT licensed so a port would be fine! As someone whose site (a dozen static sites in a trench coat) depends on staticjinja myself, and who's been doing lots of Python rewriting in Rust, I'm interested in this idea now you mention it! staticjinja builds are slow (it's the markdown conversion from what I can see).
Somehow it had never occurred to me there was demand for this (it is a cliche that developers have a tendency to be re-developing their website for no reason so I aim to avoid it!), I just landed on this thread while searching out minijinja for an unrelated project. (P.S. mitsuhiko loving your work in Rust land too with insta! sorry if this is off-topic 👋 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I apologize if this is old hat and I didn't find the relevant thread.
LSS: I've used staticjinja for a few years and have various content rendering with it and a fair bit archived that can be rendered with it as well.
https://github.com/staticjinja/staticjinja
I'd like to move all of my staticjinja code and templates to a rust platform as I've leaned toward rust tooling given its emergent influence in python.
Is minijinja a good target for such a move and if so, what's the best path to take to get there?
I'm willing to abandon various pieces/parts, as some were at best, barely viable.
I'm also willing to contribute code, doc, or whatever might be required to connect the dots in minijinja.
My rust foo is nil but I'm motivated to learn more given rust is clearly the future of python tooling, if not the future of computing. 👍
My jinja templates are based on pico.css and are quite minimal, so if the static mode of execution is possible, then I'm hopeful that the path from staticjinja to minijinja may be straightforward.
My templates, starting with the base template::
https://github.com/davidthewatson/davidthewatson.github.io/blob/master/src/_base.html
That includes the partials:
https://github.com/davidthewatson/davidthewatson.github.io/tree/master/src/partials
The static jinja code that builds all the content from these jinja templates:
https://github.com/davidthewatson/cms/blob/main/src/md2html.py
Thoughts?
Thanks for any pointers or insight you can provide.
I realize it's a monstrosity that I hope minijinja may help me simplify by deprecating most of it!
I'm open-minded about alternatives, though I've tried other approaches which produce more complexity and latency as opposed to less. 😞
Beta Was this translation helpful? Give feedback.
All reactions