livebud / livebud/tailwind

How to use with html/template?

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
56
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hi, this looks interesting!

I saw you [claim](https://www.reddit.com/r/golang/comments/10yijrr/easily_use_tailwind_in_your_go_projects/j7y9reh/) that this works well with go templates, but it isn't immediately obvious to me what that use-case would look like.

Say I have a directory of go template files that uses most of the available features: `define`s, `template` invocations, `range`, `if`, custom funcs, etc, and I load them all up into a single `*template.Template` instance. How could I process that object to get the corresponding css for it? Or am I overthinking it and I should just process the template files directly? In that case, how to process multiple files at once?

(As an aside, dynamically setting classes on nodes is possible with `html/template`, but that makes preprocessing impossible (like, the halting problem hard) so lets ignore that case for the scope of this issue. Such a scenario would have to use a CDN solution to be general.)

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no file, test, or entry point. Start by examining how this Go Tailwind project processes template files and whether it supports multiple files or a *template.Template; done means documenting a concrete workflow for Go templates, including the scope limitation around dynamically generated classes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, tailwindcss
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.