Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use "with" syntax for nested elements #1230

dridk started this conversation in Ideas
Discussion options

Did you seen the niceGUI project ? They use a very clever syntax to create the DOM syntax.

Instead of using this syntax :

html.div(
 html.h1("My Todo List"),
 html.ul(
 html.li("Design a cool new app"),
 html.li("Build it"),
 html.li("Share it with the world!"),
 )
)

why not using this one ! Easier to write and read

with html.div():
 html.h1("My Todo List")
 with html.ul():
 html.li("Design a cool new app")
 html.li("Built it")
 html.lit("Share it with the word!")
You must be logged in to vote

Replies: 2 comments

Comment options

This was debated a little bit here: #916 (comment)

Technically you could create your own utility that implements this interface.

You must be logged in to vote
0 replies
Comment options

With the release of ReactPy v2 rapidly approaching, I've created a new ticket about this #1279.

Hopefully we can get some users that voice their opinion on which interface feels better to use.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /