Skip to content

Commit

Permalink
Update metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyelowo committed Oct 11, 2023
1 parent e45521c commit 191298d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
workspace.resolver = "2"
members = ["tw-macro", "tailwind"]

# name = "tailwind-rust"
# version = "0.1.0"
# edition = "2021"

[workspace.package]
version = "1.0.0"
name = "twust"
version = "1.0.3"
edition = "2021"
authors = ["Oyelowo Oyedayo"]
description = "One codebase to rule them all"
documentation = "https://codebreather.com/oyelowo"
license = "MIT/Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion examples/leptos-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ leptos_meta = { version = "0.5.0-beta2", features = ["csr", "nightly"] }
leptos_router = { version = "0.5.0-beta2", features = ["csr", "nightly"] }
log = "0.4"
gloo-net = { version = "0.2", features = ["http"] }
twust = { git = "https://github.com/oyelowo/twust", features = ["daisyui"] }
twust = { version = "1.0.3", features = ["daisyui"] }
# twust = { git = "https://github.com/oyelowo/twust", features = ["daisyui"] }


# dependecies for client (enable when csr or hydrate set)
Expand Down
7 changes: 4 additions & 3 deletions examples/leptos-demo/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ pub fn App() -> impl IntoView {
fn Home() -> impl IntoView {
// Try to break mistype any of the class name and see what happens.
// Daisyui classes are also ssupported via a feature flag
let x = tw!("my-5 mx-auto max-w-3xl text-center");
view! {
<div class=tw!("my-5 mx-auto max-w-3xl text-center")>
<h2 class=tw!("p-6 text-4xl")>"Tw-macro"</h2>
<i class=tw!("p-2 text-2xl")>"Check your tailwind classes instantly with tw-macro."</i>
<h2 class=tw!("p-6 text-4xl")>"Twust"</h2>
<i class=tw!("p-2 text-2xl")>"Check your tailwind classes instantly with twust."</i>
<p class=tw!("p-2 text-2xl")>"We also support daisyui plugin."</p>

<div class=tw!("mockup-code w-[50px] [margin:auto]")>
<pre data-prefix="$"><code>cargo add tw-macro</code></pre>
<pre data-prefix="$"><code>cargo add twust</code></pre>
<pre data-prefix=">" class=tw!("text-warning")><code>installing...</code></pre>
<pre data-prefix=">" class=tw!("text-success")><code>Done!</code></pre>
</div>
Expand Down
7 changes: 6 additions & 1 deletion tw-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ name = "twust"
version = { workspace = true }
edition = { workspace = true }
authors = { workspace = true }
description = { workspace = true }
# description = { workspace = true }
documentation = { workspace = true }
license = { workspace = true }
repository = "https://github.com/Oyelowo/twust"
description = "Static checker for tailwindcss class names in rust for rust"
readme = "../README.md"
keywords = ["tailwindcss", "tailwind", "css", "leptos", "yew"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
14 changes: 7 additions & 7 deletions tw-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,28 +726,28 @@ fn parse_top(input: &str) -> IResult<&str, Vec<&str>> {
#[proc_macro]
pub fn tw(raw_input: TokenStream) -> TokenStream {
let r_input = raw_input.clone();
let input = parse_macro_input!(r_input as LitStr);
let (_modifiers, _valid_class_names) = match setup(&input) {
let input_original = parse_macro_input!(r_input as LitStr);
let (_modifiers, _valid_class_names) = match setup(&input_original) {
Ok(value) => value,
Err(value) => {
return syn::Error::new_spanned(input, value)
return syn::Error::new_spanned(input_original, value)
.to_compile_error()
.into()
}
};
let full_classnames = input.value();
let full_classnames = input_original.value();

let (input, _class_names) = match parse_top(&full_classnames) {
let (_input, _class_names) = match parse_top(&full_classnames) {
Ok(value) => value,
Err(value) => {
return syn::Error::new_spanned(input, value)
return syn::Error::new_spanned(input_original, value)
.to_compile_error()
.into()
}
};

quote::quote! {
#input
#input_original
}
.into()
}

0 comments on commit 191298d

Please sign in to comment.