ionide / Fornax

Scriptable static site generator using type safe F# DSL to define page templates.
MIT License
241 stars 44 forks source link

HtmlElement.Custom #104

Closed Freymaurer closed 2 years ago

Freymaurer commented 2 years ago

Is your feature request related to a problem? Please describe. Hello, i am trying to use lit web-components in fornax and one problem i have is, that i cannot use custom html tags in fornax.

So i would really like to have a custom option in this discriminate union type.

Describe the solution you'd like

type HtmlElement =
        private
        | Custom of tagName: string * props: HtmlProperties list * children: HtmlElement list
// ...
and helper level tag =
    match tag with
    | Custom (name, props, children) -> format name props children level
module Html =
        let custom (tagName:string) (props : HtmlProperties list) (children: HtmlElement list) = HtmlElement.Custom(tagName, props,children)

Describe alternatives you've considered I could propably use some js to replace an placeholder element with my custom html tag element, but thats seems not like a clean solution to me.

Additional context What i want my Html to look like in the end: image

Freymaurer commented 2 years ago

As i would like to have this option rather sooner than later, please tell me if i can help somehow. If you want i can implement it and do a PR. 😃

Freymaurer commented 2 years ago

Hey i just went ahead and added the above implementation with unit tests. Would be nice if the PR would be looked into as soon as possible, as i need this for production.

Freymaurer commented 2 years ago

Hey i really don't want to be that guy, but can you guys give me at least some info. Is the PR fine? Will you implement it? If so, when will this be live?

baronfel commented 2 years ago

Merged, need to consider a release next I suppose. Thanks for poking!