GenieFramework / GenieFramework/StippleUI.jl

[Suggestion]How about simplify and unify the elements style/format ?

Open
#20 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
90
Forks
16
PR merge metrics
No merged PRs in 30d

Description

If all elements keep the same syntax style/format, it will be simple and easy to learn and use.

Let's take a look at the `NORMAL_ELEMENTS` from the module `Genie.Renderer.Html`

#### Basic HTML Element style

```html
content
```
The above html element style can be translate to `NORMAL_ELEMENTS` as the following (take `h1` as example of `tag`, which may not express the true meaning)

```julia
julia> h1("content",attr_1="xxx", attr_2="", attr_3="yyy")
"

content

"
```

or

```julia
julia> h1(attr_1="xxx", attr_2="", attr_3="yyy", ["content"])
"

content

"
```

That's fine from `HTML` to `Julia`. Let's look at something from `Julia` to `HTML`

```julia
julia> h1(attr_1="xxx", :attr_2, attr_3="yyy", ["content"])
"

attr_2

"

julia> h1(:a=>1)
"

:a => 1

"

julia> h1([:a=>1,:b=>2])
"

[:a => 1, :b => 2]

"
```
Obviously, the above `julia` style CANNOT translate to correct `HTML` format as we want.

If keeping style as simple as possible is the first important thing, the less julia function style for `NORMAL_ELEMENTS` is better. And same rule is suggested for elements in `StippleUI`.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue points to NORMAL_ELEMENTS in Genie.Renderer.Html and to elements in StippleUI. Start by reviewing the existing Julia element-call forms and their rendered HTML examples. Done means the proposed syntax is consistently defined for attributes and content and produces valid HTML across the affected elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.