TailwindCompilerZig.Candidates (TailwindCompilerZig v1.0.0)

View Source

Extracts Tailwind candidate tokens from source text.

Tailwind source detection treats files as plain text and looks for tokens that could be class names. This module follows that model: it intentionally over-collects candidate-like tokens and leaves final utility validation to the compiler.

Summary

Functions

Extracts unique candidate-like tokens from source text or iodata.

Lazily extracts unique candidate-like tokens from an enumerable of iodata chunks.

Functions

extract(source)

@spec extract(iodata()) :: [String.t()]

Extracts unique candidate-like tokens from source text or iodata.

stream(chunks)

@spec stream(Enumerable.t()) :: Enumerable.t()

Lazily extracts unique candidate-like tokens from an enumerable of iodata chunks.

This is intended for streams such as IO.stream/2 and File.stream!/3. The implementation keeps a small trailing token carry so candidate strings split across chunk boundaries are still emitted as a single token.