rust-sailfish / sailfish

Simple, small, and extremely fast template engine for Rust
https://rust-sailfish.github.io/sailfish/
MIT License
828 stars 56 forks source link

Feature: Whitespace control #127

Open mahor1221 opened 1 year ago

mahor1221 commented 1 year ago

Consider adding a way to preserve or suppress whitespace, similar to Askama.

This feature is useful in a situation like the following:

# without whitespace control
class User(BaseModel):

    name: str

class UserEvent(BaseModel):

    pass
# with whitespcae control
class User(BaseModel):
    name: str

class UserEvent(BaseModel):
    pass
PaulDotSH commented 5 months ago

Consider adding a way to preserve or suppress whitespace, similar to Askama.

This feature is useful in a situation like the following:

# without whitespace control
class User(BaseModel):

    name: str

class UserEvent(BaseModel):

    pass
# with whitespcae control
class User(BaseModel):
    name: str

class UserEvent(BaseModel):
    pass

This can be done with my new crate https://crates.io/crates/sailfish-minify

However it would require a custom command since it only works with html files by default, if you still need help I'd be open to help